From f2580c1c4a21a6768d5b92978f40e956e093a0c1 Mon Sep 17 00:00:00 2001 From: Laurent Meunier Date: Thu, 21 Feb 2019 11:30:28 +0100 Subject: [PATCH] STM32WB: Fix ARM link error in mbed2 In case of mbed2, BLE feature is not built. As there is a MAPPING_TABLE in BLE feature which is not compiled in case of mbed2, the linker reported the below error [ERROR] "C:/Data/Workspace/mbed/BUILD/test/NUCLEO_WB55RG/ARM/MBED_2/ .link_script.sct", line 65 (column 6): Error: L6236E: No section matches selector - no section to be FIRST/LAST. Solution is to check whether BLE is enabled. --- .../device/TOOLCHAIN_ARM_MICRO/stm32wb55xx.sct | 3 +++ .../device/TOOLCHAIN_ARM_STD/stm32wb55xx.sct | 3 +++ 2 files changed, 6 insertions(+) diff --git a/targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xG/device/TOOLCHAIN_ARM_MICRO/stm32wb55xx.sct b/targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xG/device/TOOLCHAIN_ARM_MICRO/stm32wb55xx.sct index 22f1fb61a5..c89623786d 100644 --- a/targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xG/device/TOOLCHAIN_ARM_MICRO/stm32wb55xx.sct +++ b/targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xG/device/TOOLCHAIN_ARM_MICRO/stm32wb55xx.sct @@ -56,12 +56,15 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region RW_IRAM1 (0x20000000+0x13C) (0x30000-0x13C-Stack_Size) { ; RW data .ANY (+RW +ZI) } + ARM_LIB_STACK (0x20000000+0x30000) EMPTY -Stack_Size { ; stack } ; SRAM2 - Shared memory RW_IRAM2a 0x20030000 0x00002800 { ; RW data +#if defined(BLE) *(MAPPING_TABLE, +First) +#endif *(MB_MEM1) } RW_IRAM2b 0x20038000 0x00005000 { ; RW data diff --git a/targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xG/device/TOOLCHAIN_ARM_STD/stm32wb55xx.sct b/targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xG/device/TOOLCHAIN_ARM_STD/stm32wb55xx.sct index 22f1fb61a5..c89623786d 100644 --- a/targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xG/device/TOOLCHAIN_ARM_STD/stm32wb55xx.sct +++ b/targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xG/device/TOOLCHAIN_ARM_STD/stm32wb55xx.sct @@ -56,12 +56,15 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region RW_IRAM1 (0x20000000+0x13C) (0x30000-0x13C-Stack_Size) { ; RW data .ANY (+RW +ZI) } + ARM_LIB_STACK (0x20000000+0x30000) EMPTY -Stack_Size { ; stack } ; SRAM2 - Shared memory RW_IRAM2a 0x20030000 0x00002800 { ; RW data +#if defined(BLE) *(MAPPING_TABLE, +First) +#endif *(MB_MEM1) } RW_IRAM2b 0x20038000 0x00005000 { ; RW data