2024-09-19 06:00 AM
Good morning,
we have a problem with ELF file loading. We are using an STM32U575 MCU on a Nucleo board.
In particular:
the location 0x0802A61B in the ELF file is set at 0x00 (we see it by open the ELF file with Cube Programmer).
1) If we load the ELF file with Cube Programmer and read the memory again then we see that the location 0x0802A61B is correctly set to 0x00.
2) But: If we load the ELF file with Cube Ide debugger and read the memory again with Cube Programmer then we see that the location 0x0802A61B is set to 0xFF.
Issue is systematic: we found same problem on 3 different NUCLEO boards.
Couly you explain this behaviour?
Thank you in advance
2024-09-20 12:04 AM
We found a solution. We put . = ALIGN(4); in every flash section of the LD script.
Now we obtain the same flash read both when download ELF image from Cube Ide and when download from CubeProgrammer.
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
} >FLASH
In the end we cannot understand why the old LD script without . = ALIGN(4) works only with the CUBE Programmer.