Hello,
we are using arm-none-eabi-gcc to cross build for MSPM0G3507 MCU. The version set is
- arm-none-eabi-gcc: 10.3.1
- MSPM0 SDK: 1.20.0.5
If using compiler settings -O0 and -flto code runs as expected.
If using -O1/2/s and -flto the binary gets suspiciously small and when downloaded kind of "bricks" the MCU .. at least I cannot access it via SWD anymore.
As a root cause I figured that the interruptVectors table in the startup_mspm0g3507_gcc.c is completely removed from the binary.
If I change
void (*const interruptVectors[])(void) __attribute__((section(".intvecs"))) = { (pFunc)&__StackTop, /* The initial stack pointer */ Reset_Handler, /* The reset handler */ NMI_Handler, /* The NMI handler */
to
void (*const interruptVectors[])(void) __attribute__((section(".intvecs"), used)) = { (pFunc)&__StackTop, /* The initial stack pointer */ Reset_Handler, /* The reset handler */ NMI_Handler, /* The NMI handler */ HardFault_Handler, /* The hard fault handler */ 0, /* Reserved */
the interruptVectors table is not removed anymore and the code runs. As this modification regards the GCC specific startup file I am fine modifying it.
Yet also the function void DL_Common_delayCycles(uint32_t cycles) in dl_common.c is getting removed when using -O1/2/s and -flto. So still the code shows unexpected behavior in some locations.
I don't want to do modifications in the TI driver lib like setting compiler specific attributes like I did in the startup file.
Any suggestions how to approach this issue? LTOs are absolutely necessary in our project ...
Is there any statement from TI on what arm-none-eabi-gcc versions and optimization options are supported given a specific MSPM0 SDK?
Any changes the interruptVectors table will be marked with the used attribute in next MSPM0 SDK releases?
Best Regards
Marco