Skip to content

Commit 923c1f2

Browse files
committed
TO BE SQUASHED: Use macros to compute the combined size of interrupts
1 parent 4e735a1 commit 923c1f2

File tree

3 files changed

+46
-7
lines changed

3 files changed

+46
-7
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,20 @@
7777
#define MBED_RAM_SIZE NS_DATA_SIZE
7878
#endif
7979

80+
#if !defined(NVIC_INTERRUPT_NUM)
81+
#define NVIC_INTERRUPT_NUM 60
82+
#endif
83+
84+
#if !defined(EXCEPTION_VECT_NUM)
85+
#define EXCEPTION_VECT_NUM 16
86+
#endif
87+
88+
#if !defined(MEMORY_ADDR_SIZE_IN_BYTE)
89+
#define MEMORY_ADDR_SIZE_IN_BYTE 4
90+
#endif
8091

8192
#define m_interrupts_start MBED_APP_START
82-
#define m_interrupts_size 0x130
93+
#define m_interrupts_size ((NVIC_INTERRUPT_NUM + EXCEPTION_VECT_NUM) * MEMORY_ADDR_SIZE_IN_BYTE)
8394

8495
#define m_text_start MBED_APP_START + m_interrupts_size
8596
#define m_text_size MBED_APP_SIZE - m_interrupts_size

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,20 @@ __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
60+
#if !defined(NVIC_INTERRUPT_NUM)
61+
#define NVIC_INTERRUPT_NUM 60
62+
#endif
63+
64+
#if !defined(EXCEPTION_VECT_NUM)
65+
#define EXCEPTION_VECT_NUM 16
66+
#endif
67+
68+
#if !defined(MEMORY_ADDR_SIZE_IN_BYTE)
69+
#define MEMORY_ADDR_SIZE_IN_BYTE 4
70+
#endif
71+
72+
#if !defined(MBED_INTERRUPTS_SIZE)
73+
#define MBED_INTERRUPTS_SIZE ((NVIC_INTERRUPT_NUM + EXCEPTION_VECT_NUM) * MEMORY_ADDR_SIZE_IN_BYTE)
6274
#endif
6375

6476
__stack_size__ = MBED_BOOT_STACK_SIZE;
@@ -68,8 +80,8 @@ M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x200 : 0x0;
6880

6981
MEMORY
7082
{
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
83+
m_interrupts (RX) : ORIGIN = MBED_APP_START, LENGTH = MBED_INTERRUPTS_SIZE
84+
m_text (RX) : ORIGIN = MBED_APP_START + MBED_INTERRUPTS_SIZE, LENGTH = MBED_APP_SIZE - MBED_INTERRUPTS_SIZE
7385
m_data (RW) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
7486
m_usb_sram (RW) : ORIGIN = 0x40100000, LENGTH = 0x00004000
7587
}

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,26 @@ if (isdefinedsymbol(__heap_size__)) {
8080
define symbol __size_heap__ = 0x0400;
8181
}
8282

83+
if (!isdefinedsymbol(NVIC_INTERRUPT_NUM)) {
84+
define symbol NVIC_INTERRUPT_NUM = 60;
85+
}
86+
87+
if (!isdefinedsymbol(EXCEPTION_VECT_NUM)) {
88+
define symbol EXCEPTION_VECT_NUM = 16;
89+
}
90+
91+
if (!isdefinedsymbol(MEMORY_ADDR_SIZE_IN_BYTE)) {
92+
define symbol MEMORY_ADDR_SIZE_IN_BYTE = 4;
93+
}
94+
95+
if (!isdefinedsymbol(MBED_INTERRUPTS_SIZE)) {
96+
define symbol MBED_INTERRUPTS_SIZE = ((NVIC_INTERRUPT_NUM + EXCEPTION_VECT_NUM) * MEMORY_ADDR_SIZE_IN_BYTE);
97+
}
98+
8399
define symbol m_interrupts_start = MBED_APP_START;
84-
define symbol m_interrupts_end = (MBED_APP_START + 0x12F);
100+
define symbol m_interrupts_end = (MBED_APP_START + (MBED_INTERRUPTS_SIZE - 1));
85101

86-
define symbol m_text_start = (MBED_APP_START + 0x130);
102+
define symbol m_text_start = (MBED_APP_START + MBED_INTERRUPTS_SIZE);
87103
define symbol m_text_end = (MBED_APP_START + MBED_APP_SIZE - 1);
88104

89105
define symbol m_interrupts_ram_start = MBED_RAM_START;

0 commit comments

Comments
 (0)