AN5056 Rev 8 31/49
AN5056 Tips for debugging
48
6 Tips for debugging
6.1 Compiler optimizations level
Projects are delivered with the highest level of compiler optimizations turned on for size
aspects. Such optimizations can make the debug complex. Changing the compiler
optimization level possibly impacts memory mapping.
Figure 27. Compiler optimizations
6.2 Memory mapping adaptation
When changing the compiler optimizations level or activating the development mode with
the verbose compilation switch, the user may have to adapt the SBSFU memory mapping,
for instance reducing firmware image slots to avoid overlap.
Caution: The security peripheral configuration (RDP, WRP, PCROP, FWALL, secure user memory if
available for the series) is automatically computed based on the SBSFU linker symbols
except for the MPU configuration due to the constraints detailed in Section 3.2: Memory
mapping definition. Disabling temporarily the MPU protection can be an efficient workaround
for the debug.
Figure 28 depicts the 3 steps of the memory adaptation based on an example:
1. Identify the gap by analyzing the linker message: 0x1d9 bytes
2. Identify the concerned region by consulting the project.map file:
__ICFEDIT_SB_region_ROM_start__
3. Apply the modification in file mapping_sbsfu.icf: 0x300 bytes