Skip to content

Commit b402b7a

Browse files
committed
Fix crash on boot due to vector size mismatch
If NVIC_NUM_VECTORS is larger than the space allocated by the vector table in ram (__ram_vector_table_size__) then the call to mbed_cpy_nvic during boot will corrupt valid data, which can lead to a crash. This patch fixes the declared number of vectors on the KL27Z, KL43Z and KL82Z to fix this crash.
1 parent 4978a08 commit b402b7a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL27Z/device/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extern uint32_t __VECTOR_RAM[];
3939
#endif
4040

4141
/* Symbols defined by the linker script */
42-
#define NVIC_NUM_VECTORS (16 + 240) // CORE + MCU Peripherals
42+
#define NVIC_NUM_VECTORS (16 + 32) // CORE + MCU Peripherals
4343
#define NVIC_RAM_VECTOR_ADDRESS (__VECTOR_RAM) // Vectors positioned at start of RAM
4444

4545
#endif

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL43Z/device/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extern uint32_t __VECTOR_RAM[];
3939
#endif
4040

4141
/* Symbols defined by the linker script */
42-
#define NVIC_NUM_VECTORS (16 + 240) // CORE + MCU Peripherals
42+
#define NVIC_NUM_VECTORS (16 + 32) // CORE + MCU Peripherals
4343
#define NVIC_RAM_VECTOR_ADDRESS (__VECTOR_RAM) // Vectors positioned at start of RAM
4444

4545
#endif

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL82Z/device/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extern uint32_t __VECTOR_RAM[];
3939
#endif
4040

4141
/* Symbols defined by the linker script */
42-
#define NVIC_NUM_VECTORS (16 + 240) // CORE + MCU Peripherals
42+
#define NVIC_NUM_VECTORS (16 + 32) // CORE + MCU Peripherals
4343
#define NVIC_RAM_VECTOR_ADDRESS (__VECTOR_RAM) // Vectors positioned at start of RAM
4444

4545
#endif

0 commit comments

Comments
 (0)