diff --git a/FreeRTOS/Source/portable/esp8266/port.c b/FreeRTOS/Source/portable/esp8266/port.c index 42cb36a..d40340e 100644 --- a/FreeRTOS/Source/portable/esp8266/port.c +++ b/FreeRTOS/Source/portable/esp8266/port.c @@ -120,7 +120,7 @@ static int pending_maclayer_sv; In the original esp_iot_rtos_sdk implementation, arg was a char. Using an enum is ABI-compatible, though. */ -void PendSV(enum SVC_ReqType req) +void IRAM PendSV(enum SVC_ReqType req) { vPortEnterCritical(); @@ -141,7 +141,7 @@ void PendSV(enum SVC_ReqType req) */ extern portBASE_TYPE sdk_MacIsrSigPostDefHdl(void); -void SV_ISR(void) +void IRAM SV_ISR(void) { portBASE_TYPE xHigherPriorityTaskWoken=pdFALSE ; if(pending_maclayer_sv) @@ -206,14 +206,14 @@ static unsigned portBASE_TYPE uxCriticalNesting = 0; * with a save/restore of interrupt level, although it's difficult as * the functions have no return value. */ -void vPortEnterCritical( void ) +void IRAM vPortEnterCritical( void ) { portDISABLE_INTERRUPTS(); uxCriticalNesting++; } /*-----------------------------------------------------------*/ -void vPortExitCritical( void ) +void IRAM vPortExitCritical( void ) { uxCriticalNesting--; if( uxCriticalNesting == 0 ) diff --git a/common.mk b/common.mk index 26dcfbf..dfefff8 100644 --- a/common.mk +++ b/common.mk @@ -84,7 +84,7 @@ endif GITSHORTREV=\"$(shell cd $(ROOT); git rev-parse --short -q HEAD)\" CFLAGS += -DGITSHORTREV=$(GITSHORTREV) -LINKER_SCRIPTS = ld/eagle.app.v6.ld ld/eagle.rom.addr.v6.ld +LINKER_SCRIPTS = $(ROOT)ld/eagle.app.v6.ld $(ROOT)ld/eagle.rom.addr.v6.ld #### #### no user configurable options below here @@ -101,7 +101,7 @@ TARGET_DIR := $(dir $(firstword $(MAKEFILE_LIST))) SDK_LIB_ARGS = $(addprefix -l,$(SDK_LIBS)) LIB_ARGS = $(addprefix -l,$(LIBS)) TARGET_OUT = $(BUILD_DIR)$(TARGET).out -LDFLAGS += $(addprefix -T$(ROOT),$(LINKER_SCRIPTS)) +LDFLAGS += $(addprefix -T,$(LINKER_SCRIPTS)) FW_FILE_1 = $(addprefix $(FW_BASE),$(FW_1).bin) FW_FILE_2 = $(addprefix $(FW_BASE),$(FW_2).bin) @@ -211,9 +211,9 @@ $(eval $(call component_compile_rules,target)) $(foreach component,$(COMPONENTS), $(eval include $(ROOT)/$(component)/component.mk)) # final linking step to produce .elf -$(TARGET_OUT): $(COMPONENT_ARS) $(SDK_PROCESSED_LIBS) +$(TARGET_OUT): $(COMPONENT_ARS) $(SDK_PROCESSED_LIBS) $(LINKER_SCRIPTS) $(vecho) "LD $@" - $(Q) $(LD) $(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $(SDK_LIB_ARGS) $(LIB_ARGS) $(COMPONENT_ARS) -Wl,--end-group -o $@ + $(Q) $(LD) $(LDFLAGS) -Wl,--start-group $(SDK_LIB_ARGS) $(LIB_ARGS) $(COMPONENT_ARS) -Wl,--end-group -o $@ $(BUILD_DIR) $(FW_BASE) $(BUILD_DIR)sdklib: $(Q) mkdir -p $@ diff --git a/core/include/common_macros.h b/core/include/common_macros.h index 5ac611a..74956af 100644 --- a/core/include/common_macros.h +++ b/core/include/common_macros.h @@ -30,4 +30,6 @@ #define INLINED inline static __attribute__((always_inline)) __attribute__((unused)) +#define IRAM __attribute__((section(".iram1.text"))) + #endif diff --git a/ld/eagle.app.v6.ld b/ld/eagle.app.v6.ld index 42fac11..e3c9232 100644 --- a/ld/eagle.app.v6.ld +++ b/ld/eagle.app.v6.ld @@ -192,7 +192,7 @@ SECTIONS *(.entry.text) *(.init.literal) *(.init) - *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) + *(.literal .text .literal.* .text.* .iram1.text iram1.literal .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) *(.fini.literal) *(.fini) *(.gnu.version) @@ -212,7 +212,7 @@ SECTIONS .irom0.text : ALIGN(4) { _irom0_text_start = ABSOLUTE(.); - *(.literal .text .literal.* .text.* .irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text) + *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text) _irom0_text_end = ABSOLUTE(.); } >irom0_0_seg :irom0_0_phdr }