My system has a STM32F2xx bootloader(0x0800 0000) and an app (0x0800 4000).
1. No bootloader(only app, placed at address 0x0800 0000), the app works as expected.
2. No LTO enabled, bootloader jumps to __main successfully and app is loaded at power up.
When Link time optimisation (LTO) option in KEIL is enabled for app (0x0800 4000), a hard fault is encountered in __scatterload. Here is a snapshot of fault and saved register in my fault hander (fault handler has a breakpoint instruction).
Hi Friends,
Just found that ARM suggests not using LTO with Scatter file (which I am reluctantly doing).
https://developer.arm.com/documentation/100748/0620/Writing-Optimized-Code/Optimizing-across-modules-with-Link-Time-Optimization/Restrictions-with-Link-Time-Optimization
Has anyone found a solution/workaround to overcome this issue?
Thank you.