From 4806bda72647739af76a8899210ed31053e08862 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Tue, 14 May 2019 08:52:11 -0700 Subject: [PATCH 1/2] Support PIO Wl-T and Arduino -T linking properly The interrupt vectors in IRAM are ommitted when there is a PROVIDE statement in the linker control files when using the PIO method of -Wl,-T. Drop the PROVIDES (they're in RAM anyway and not ROM related), and add the required "-u"s to the P{IO build script. Should have no iumpact on the Arduino side. Fixes #6087 --- tools/platformio-build.py | 5 +++++ tools/sdk/ld/eagle.rom.addr.v6.ld | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/platformio-build.py b/tools/platformio-build.py index dd79c7cfd6..8cc5c7e530 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -93,6 +93,11 @@ def scons_patched_match_splitext(path, suffixes=None): "-u", "app_entry", "-u", "_printf_float", "-u", "_scanf_float" + "-u _DebugExceptionVector", + "-u _DoubleExceptionVector", + "-u _KernelExceptionVector", + "-u _NMIExceptionVector", + "-u _UserExceptionVector" ], CPPDEFINES=[ diff --git a/tools/sdk/ld/eagle.rom.addr.v6.ld b/tools/sdk/ld/eagle.rom.addr.v6.ld index 2628776040..0407fb8806 100644 --- a/tools/sdk/ld/eagle.rom.addr.v6.ld +++ b/tools/sdk/ld/eagle.rom.addr.v6.ld @@ -41,13 +41,8 @@ PROVIDE ( UartRegReadProc = 0x4000381c ); PROVIDE ( UartRegWriteProc = 0x400037ac ); PROVIDE ( UartRxString = 0x40003c30 ); PROVIDE ( Uart_Init = 0x40003a14 ); -PROVIDE ( _DebugExceptionVector = 0x40000010 ); -PROVIDE ( _DoubleExceptionVector = 0x40000070 ); -PROVIDE ( _KernelExceptionVector = 0x40000030 ); -PROVIDE ( _NMIExceptionVector = 0x40000020 ); PROVIDE ( _ResetHandler = 0x400000a4 ); PROVIDE ( _ResetVector = 0x40000080 ); -PROVIDE ( _UserExceptionVector = 0x40000050 ); PROVIDE ( __adddf3 = 0x4000c538 ); PROVIDE ( __addsf3 = 0x4000c180 ); PROVIDE ( __divdf3 = 0x4000cb94 ); From 7502caa4839547d43fbd91953c61015b5f6f8479 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Tue, 14 May 2019 09:23:21 -0700 Subject: [PATCH 2/2] Separate parameters like pre-existing -u entries --- tools/platformio-build.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/platformio-build.py b/tools/platformio-build.py index 5eab604ce0..18b44c2c2e 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -89,12 +89,12 @@ def scons_patched_match_splitext(path, suffixes=None): "-Wl,-wrap,spi_flash_read", "-u", "app_entry", "-u", "_printf_float", - "-u", "_scanf_float" - "-u _DebugExceptionVector", - "-u _DoubleExceptionVector", - "-u _KernelExceptionVector", - "-u _NMIExceptionVector", - "-u _UserExceptionVector" + "-u", "_scanf_float", + "-u", "_DebugExceptionVector", + "-u", "_DoubleExceptionVector", + "-u", "_KernelExceptionVector", + "-u", "_NMIExceptionVector", + "-u", "_UserExceptionVector" ], CPPDEFINES=[