Skip to content

Commit 4e735a1

Browse files
committed
bootloader: Fix LPC55S69 bootloader segmentation
As the build tool in mbed-os 5.13 cannot appropriately deal with a segmented bootloader when combining it with an application, this commit adjusts the size reserved for interrupts (via the linker file) to avoid a bootloader segmentation due to an unpopulated ROM area. The microcontroller has a total of 60 vector interrupts + 16 exception handlers. The allocated ROM flash for interrupts should be (60 + 16) x word size in bytes = 76 x 4 = 304 = 0x130. This commit changes the interrupt reserved space from 0x140 to 0x130.
1 parent 9cc1caa commit 4e735a1

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_M33_NS/device/TOOLCHAIN_ARMC6/LPC55S69_cm33_core0_flash.sct

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@
7979

8080

8181
#define m_interrupts_start MBED_APP_START
82-
#define m_interrupts_size 0x140
82+
#define m_interrupts_size 0x130
8383

84-
#define m_text_start MBED_APP_START + 0x140
85-
#define m_text_size MBED_APP_SIZE - 0x140
84+
#define m_text_start MBED_APP_START + m_interrupts_size
85+
#define m_text_size MBED_APP_SIZE - m_interrupts_size
8686

8787
#define m_interrupts_ram_start MBED_RAM_START
8888
#define m_interrupts_ram_size __ram_vector_table_size__

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_M33_NS/device/TOOLCHAIN_GCC_ARM/LPC55S69_cm33_core0_flash.ld

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,19 @@ __ram_vector_table__ = 1;
5757
#define MBED_BOOT_STACK_SIZE 0x400
5858
#endif
5959

60+
#if !defined(MBED_NVIC_SIZE)
61+
#define MBED_NVIC_SIZE 0x130
62+
#endif
63+
6064
__stack_size__ = MBED_BOOT_STACK_SIZE;
6165

6266
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0800;
6367
M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x200 : 0x0;
6468

6569
MEMORY
6670
{
67-
m_interrupts (RX) : ORIGIN = MBED_APP_START, LENGTH = 0x140
68-
m_text (RX) : ORIGIN = MBED_APP_START + 0x140, LENGTH = MBED_APP_SIZE - 0x140
71+
m_interrupts (RX) : ORIGIN = MBED_APP_START, LENGTH = MBED_NVIC_SIZE
72+
m_text (RX) : ORIGIN = MBED_APP_START + MBED_NVIC_SIZE, LENGTH = MBED_APP_SIZE - MBED_NVIC_SIZE
6973
m_data (RW) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
7074
m_usb_sram (RW) : ORIGIN = 0x40100000, LENGTH = 0x00004000
7175
}

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_M33_NS/device/TOOLCHAIN_IAR/LPC55S69_cm33_core0_flash.icf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ if (isdefinedsymbol(__heap_size__)) {
8181
}
8282

8383
define symbol m_interrupts_start = MBED_APP_START;
84-
define symbol m_interrupts_end = (MBED_APP_START + 0x13F);
84+
define symbol m_interrupts_end = (MBED_APP_START + 0x12F);
8585

86-
define symbol m_text_start = (MBED_APP_START + 0x140);
86+
define symbol m_text_start = (MBED_APP_START + 0x130);
8787
define symbol m_text_end = (MBED_APP_START + MBED_APP_SIZE - 1);
8888

8989
define symbol m_interrupts_ram_start = MBED_RAM_START;

0 commit comments

Comments
 (0)