AnsweredAssumed Answered

Release vs. Debug difference while writing to flash K64

Question asked by roymessinger on Mar 9, 2017
Latest reply on Mar 11, 2017 by roymessinger

This question is intended for Erich Styger, or whoever else can help. I'm writing this question in continuous to my post here. I've used the nice document Erich has written regarding using _attribute_ to write to specific address in flash.

Maybe I'm missing something here but I've noticed there's a difference between Debug and Release when writing to the flash (in the freedom_bootloader source code).

 

In Release version, the appFlag I've written is (I think) optimized and vanished, while in Debug version it is well written to the address I've specified (0x20020000).

I've used the arm-none-eabi-nm.exe to look for my appFlash flag and I've seen differences between the Rls & Dbg versions:

In the Rls version:

20020000 d appFlag.4961
w atexit
In the Dbg version:

20020000 D appFlag
w atexit

I do not know what is the difference between the d and D (or the .4961 numbers mean).

Furthermore, in the map files I'm seeing these differences also:

In the Rls version:

.appFlag 0x20020000 0x1 C:\...\AppData\Local\Temp\ccRzaGIi.ltrans1.ltrans.o

 

In the Dbg version:

.appFlag 0x20020000 0x1 C:\...\AppData\Local\Temp\ccXjJvWa.ltrans0.ltrans.o
0x20020000 appFlag

 

Obviously, something is making this flag to disappear in the Release version, and that is why in my post here , the 'if' in line 367 is ignored.

This was not mentioned in Erich's doc. Have I done something wrong when using the _attribute_ method?

Any help will do.

Thanks!

Roy

Outcomes