Dear Team:
I'm using S32DS ARM v1.3 and I want to fill the unused flash area with some const. Could you give me an example?
I have tried similar "FILL" operation on Codewarrior but it seems that the GNU linker does not work in a similar way.
Appreciate your support!
Best Regards,
Wang
Solved! Go to Solution.
Hi Wang,
the following article describes how to do this with the GNU linker:
FILLing unused Memory with the GNU Linker | MCU on Eclipse
I hope this helps,
Erich
Hi Wang,
the following article describes how to do this with the GNU linker:
FILLing unused Memory with the GNU Linker | MCU on Eclipse
I hope this helps,
Erich
Hi Erich:
I'm a big fan of your blog. :smileyhappy:
Actually your example is based on Codewarrior 10, and I have tried your setup in my S32DS project but I got some "syntax error" regarding the "FILL" statement.
And I also tried something like " section {} > memory_segment = 0xFF" in linker file, but nothing happened to the generated srec file.
Could you help to build an example under S32DS?
Thanks a lot!
Best Regards,
Wang
Hello Wang,
I found simple solution. It looks very similar to solution which posted Erich above. Please see the following link:
http://www.microchip.com/forums/m555060.aspx
Regards,
Martin
Hello Martin:
Now it works. Thank you. :smileyhappy:
Best Regards,
Wang
Hi Wang,
thank you :-).
The same principle applies as well to S32DS, as it uses the GNU linker as well. the only difference is that in the S32DS the memory sections are named differently.
I tried it quickly in the S32DS, and it worked fine (project attached).
in the linker file I have changed/added
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
/* PROVIDE_HIDDEN (__fini_array_end = .); */
} > FLASH_2
.fill :
{
FILL(0xDEADBEEF);
. = ORIGIN(FLASH_2) + LENGTH(FLASH_2) - 1;
BYTE(0xAA)
___ROM_AT = .;
PROVIDE_HIDDEN (__fini_array_end = .);
} > FLASH_2
I hope this helps,
Erich
Hi Erich:
Now I see the dead beef. :smileyhappy:
The lesson learn is, when disclaim a section, don't forget to put a space between the section name and the comma. In other words, ".fill :" works good, but ".fill:" will cause a syntax error.
Happy spacing. :smileyhappy: