cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer is writing to the wrong memory address for the given ELF file

newbie_stm32
Associate III

Hi, I have an ELF file modified to write to the main memory address 0x08004000 instead of 0x08000000. Please find the screenshot below and the ELF file in the attachment.


_legacyfs_online_stmicro_images_0693W00000bjWLTQA2.pngBut instead of writing to 0x08004000 it constantly writes to 0x08000000. Why is this happening?

26 REPLIES 26

Hi @bob S​, there is a tab named Open file in the IDE by which I had opened it.


_legacyfs_online_stmicro_images_0693W00000bjkxgQAA.png

Hi @yo3hcv​, thanks for pointing it out. I will try this fix.

This fix solved my issue. Now I can see the updated address in the program header


_legacyfs_online_stmicro_images_0693W00000bjmlDQAQ.png@Community member​ @bob S​ can we point this to STMicroelectronics such that they can fix them in the future release?

The linker scripts are very sensitive to ordering and interpretation.

Not sure I've seen it do the behaviour here, but I tend to lead with the FLASH address.

ST's implementation is a bit haphazard and could have been executed so much better. The crew at Arduino seem more clueful. And Keil/RealView have always been much better with the issues.

+1 for identifying the issue here correctly.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I've been here over a decade, it's like swimming up a waterfall..

The code generator is capable of replicating a lot of junky and broken code. Just get the confidence to see whats wrong and excise it from your own project.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

@mattias norlander​ please flag this to the relevant team(s) need to define the FLASH / RO memory region first. Defaulting to 0x08000000 somewhere. Even in a single / linear pass sense it should be recognizing addresses explicitly provided over defaults, and before it's encountered any content.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

@Community member​ sure