diff --git a/platform.txt b/platform.txt index b0e4b1936e..56e42984fe 100644 --- a/platform.txt +++ b/platform.txt @@ -79,7 +79,7 @@ recipe.hooks.core.prebuild.1.pattern.windows=cmd.exe /c mkdir {build.path}\core recipe.hooks.core.prebuild.2.pattern.windows= ## Build the app.ld linker file -recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/eagle.app.v6.common.ld" +recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld" ## Compile c files recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" diff --git a/tools/sdk/include/c_types.h b/tools/sdk/include/c_types.h index e4a1e8e12f..05a8d55ef3 100644 --- a/tools/sdk/include/c_types.h +++ b/tools/sdk/include/c_types.h @@ -84,9 +84,11 @@ typedef enum { #define SHMEM_ATTR #ifdef ICACHE_FLASH -#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text"))) -#define ICACHE_RAM_ATTR __attribute__((section(".iram.text"))) -#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text"))) +#define __ICACHE_STRINGIZE_NX(A) #A +#define __ICACHE_STRINGIZE(A) __ICACHE_STRINGIZE_NX(A) +#define ICACHE_FLASH_ATTR __attribute__((section("\".irom0.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\""))) +#define ICACHE_RAM_ATTR __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\""))) +#define ICACHE_RODATA_ATTR __attribute__((section("\".irom.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\""))) #else #define ICACHE_FLASH_ATTR #define ICACHE_RAM_ATTR diff --git a/tools/sdk/ld/eagle.app.v6.common.ld.h b/tools/sdk/ld/eagle.app.v6.common.ld.h index 8b0d2ebed9..ec84ab2472 100644 --- a/tools/sdk/ld/eagle.app.v6.common.ld.h +++ b/tools/sdk/ld/eagle.app.v6.common.ld.h @@ -127,7 +127,7 @@ SECTIONS *libwpa.a:(.literal.* .text.*) *libwpa2.a:(.literal.* .text.*) *libwps.a:(.literal.* .text.*) - *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text .irom.text.*) + *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom0.text.* .irom.text .irom.text.*) _irom0_text_end = ABSOLUTE(.); _flash_code_end = ABSOLUTE(.); } >irom0_0_seg :irom0_0_phdr @@ -164,8 +164,8 @@ SECTIONS *(.init.literal) *(.init) *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - *.cpp.o(.iram.text) - *.c.o(.iram.text) + *.cpp.o(.iram.text .iram.text.*) + *.c.o(.iram.text .iram.text.*) #ifdef VTABLES_IN_IRAM *(.rodata._ZTV*) /* C++ vtables */ #endif diff --git a/tools/sdk/ld/eagle.flash.16m14m.ld b/tools/sdk/ld/eagle.flash.16m14m.ld index f88d8b6fee..ccce5ddc39 100644 --- a/tools/sdk/ld/eagle.flash.16m14m.ld +++ b/tools/sdk/ld/eagle.flash.16m14m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x411FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.16m15m.ld b/tools/sdk/ld/eagle.flash.16m15m.ld index fd28ab7e18..93b30d219b 100644 --- a/tools/sdk/ld/eagle.flash.16m15m.ld +++ b/tools/sdk/ld/eagle.flash.16m15m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x411FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.1m.ld b/tools/sdk/ld/eagle.flash.1m.ld index 2d758d02e2..b198d8b737 100644 --- a/tools/sdk/ld/eagle.flash.1m.ld +++ b/tools/sdk/ld/eagle.flash.1m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x402FB000 ); PROVIDE ( _SPIFFS_page = 0x0 ); PROVIDE ( _SPIFFS_block = 0x0 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.1m128.ld b/tools/sdk/ld/eagle.flash.1m128.ld index e4ee29443d..c6ab02feb6 100644 --- a/tools/sdk/ld/eagle.flash.1m128.ld +++ b/tools/sdk/ld/eagle.flash.1m128.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x402FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x1000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.1m144.ld b/tools/sdk/ld/eagle.flash.1m144.ld index e7a3d0c960..0da7edf593 100644 --- a/tools/sdk/ld/eagle.flash.1m144.ld +++ b/tools/sdk/ld/eagle.flash.1m144.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x402FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x1000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.1m160.ld b/tools/sdk/ld/eagle.flash.1m160.ld index 83ee195a96..e927985243 100644 --- a/tools/sdk/ld/eagle.flash.1m160.ld +++ b/tools/sdk/ld/eagle.flash.1m160.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x402FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x1000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.1m192.ld b/tools/sdk/ld/eagle.flash.1m192.ld index ff4dd4b079..c45d7e6afe 100644 --- a/tools/sdk/ld/eagle.flash.1m192.ld +++ b/tools/sdk/ld/eagle.flash.1m192.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x402FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x1000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.1m256.ld b/tools/sdk/ld/eagle.flash.1m256.ld index 969e343abb..37bce0c948 100644 --- a/tools/sdk/ld/eagle.flash.1m256.ld +++ b/tools/sdk/ld/eagle.flash.1m256.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x402FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x1000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.1m512.ld b/tools/sdk/ld/eagle.flash.1m512.ld index 9a319852e4..f2df1a0734 100644 --- a/tools/sdk/ld/eagle.flash.1m512.ld +++ b/tools/sdk/ld/eagle.flash.1m512.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x402FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.1m64.ld b/tools/sdk/ld/eagle.flash.1m64.ld index 30023c8e68..eacaa8c0eb 100644 --- a/tools/sdk/ld/eagle.flash.1m64.ld +++ b/tools/sdk/ld/eagle.flash.1m64.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x402FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x1000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.2m.ld b/tools/sdk/ld/eagle.flash.2m.ld index a6e068cfa8..b2d06238d6 100644 --- a/tools/sdk/ld/eagle.flash.2m.ld +++ b/tools/sdk/ld/eagle.flash.2m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x403FB000 ); PROVIDE ( _SPIFFS_page = 0x0 ); PROVIDE ( _SPIFFS_block = 0x0 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.2m1m.ld b/tools/sdk/ld/eagle.flash.2m1m.ld index 27b74fecd2..08fb1b152a 100644 --- a/tools/sdk/ld/eagle.flash.2m1m.ld +++ b/tools/sdk/ld/eagle.flash.2m1m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x403FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.2m512.ld b/tools/sdk/ld/eagle.flash.2m512.ld index 09a0131ae7..2d8f3e78a6 100644 --- a/tools/sdk/ld/eagle.flash.2m512.ld +++ b/tools/sdk/ld/eagle.flash.2m512.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x403FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.4m.ld b/tools/sdk/ld/eagle.flash.4m.ld index 3e8db2ad1e..09166b9e92 100644 --- a/tools/sdk/ld/eagle.flash.4m.ld +++ b/tools/sdk/ld/eagle.flash.4m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x405FB000 ); PROVIDE ( _SPIFFS_page = 0x0 ); PROVIDE ( _SPIFFS_block = 0x0 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.4m1m.ld b/tools/sdk/ld/eagle.flash.4m1m.ld index e8690df995..74bf04bc3d 100644 --- a/tools/sdk/ld/eagle.flash.4m1m.ld +++ b/tools/sdk/ld/eagle.flash.4m1m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x405FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.4m2m.ld b/tools/sdk/ld/eagle.flash.4m2m.ld index c3a4f7e8c5..6eb95b1be9 100644 --- a/tools/sdk/ld/eagle.flash.4m2m.ld +++ b/tools/sdk/ld/eagle.flash.4m2m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x405FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.4m3m.ld b/tools/sdk/ld/eagle.flash.4m3m.ld index 9c39b25210..37acf69daf 100644 --- a/tools/sdk/ld/eagle.flash.4m3m.ld +++ b/tools/sdk/ld/eagle.flash.4m3m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x405FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.512k.ld b/tools/sdk/ld/eagle.flash.512k.ld index cc2347a548..65c5444bd8 100644 --- a/tools/sdk/ld/eagle.flash.512k.ld +++ b/tools/sdk/ld/eagle.flash.512k.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x4027B000 ); PROVIDE ( _SPIFFS_page = 0x0 ); PROVIDE ( _SPIFFS_block = 0x0 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.512k128.ld b/tools/sdk/ld/eagle.flash.512k128.ld index 8bbce9ade2..fbd64a6364 100644 --- a/tools/sdk/ld/eagle.flash.512k128.ld +++ b/tools/sdk/ld/eagle.flash.512k128.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x4027B000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x1000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.512k32.ld b/tools/sdk/ld/eagle.flash.512k32.ld index 1038fff525..0e1d86fc88 100644 --- a/tools/sdk/ld/eagle.flash.512k32.ld +++ b/tools/sdk/ld/eagle.flash.512k32.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x4027B000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x1000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.512k64.ld b/tools/sdk/ld/eagle.flash.512k64.ld index ddc51f0e71..496c47d23b 100644 --- a/tools/sdk/ld/eagle.flash.512k64.ld +++ b/tools/sdk/ld/eagle.flash.512k64.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x4027B000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x1000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.8m6m.ld b/tools/sdk/ld/eagle.flash.8m6m.ld index 027179e74d..b65d46751a 100644 --- a/tools/sdk/ld/eagle.flash.8m6m.ld +++ b/tools/sdk/ld/eagle.flash.8m6m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x409FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld" diff --git a/tools/sdk/ld/eagle.flash.8m7m.ld b/tools/sdk/ld/eagle.flash.8m7m.ld index e84625c7c0..9ec7cc128b 100644 --- a/tools/sdk/ld/eagle.flash.8m7m.ld +++ b/tools/sdk/ld/eagle.flash.8m7m.ld @@ -19,4 +19,4 @@ PROVIDE ( _SPIFFS_end = 0x409FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); -INCLUDE "eagle.app.v6.common.ld" +INCLUDE "local.eagle.app.v6.common.ld"