Linker

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linker

800 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by renan on Thu Sep 09 05:43:37 MST 2010
Suppose this is the area defined in my linker scripts:
MFlash512 (rx) : ORIGIN = 0x0, LENGTH = 0x8000 /* 32k */
And this is the output of my build:
   text       data        bss        dec        hex    filename
  15552          4       2860      18416       47f0    Orion_USB_BootLoader.axf

32768 -15552 = 17216 bytes.
There is 17216 bytes left for nothing, the debuger will write anything in this area?
I think it won't write anything, but I want to be sure!

Renan
0 Kudos
Reply
2 Replies

793 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by renan on Thu Sep 09 06:33:18 MST 2010
Right. I forgot about that.

Thanks
0 Kudos
Reply

793 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Sep 09 06:15:01 MST 2010
Not quite, but almost. Remember you are writing to flash, and you will be writing to sectors not bytes.

If you switch to the MCU debug console after you load your image into the debugger, one of the messages you will see will be along the lines of....


Quote:
Writing 15524 bytes to 0000 in Flash (assumed clock: 4.0MHz)
Erased/Wrote page  0-3 with 15524 bytes in 1829msec

The key part here is that the debugger is telling you that it has erased flash sectors 0, 1, 2 and 3 (ie the first 16384 bytes of memory) before it then wrote in 15524 bytes.

Regards,
CodeRedSupport
0 Kudos
Reply