Part Number: MSPM0G3107-Q1
Other Parts Discussed in Thread: MSPM0G3107, UNIFLASH
Hello,
Environment Information
- Compiler: GCC
- Chip: MSPM0G3107
- Linker Script: mxpm0g3107.lds (provided with SDK)
I am working on a project which uses the MSPM0G3107 and I am trying to satisfy a software requirement which states that "unused Flash should be filled with NOP instructions".
The way I am interpreting this requirement is as follows: if the program size is 10KB but your Flash size is 32KB, then the 22KB of flash should be the NOP instruction instead of the default 0xFFFFFFFF.
I have been trying to modify my Linker Script to achieve this, but I have hit a road block. Based on the Linker Script syntax, I should be able to use '=fillexp' to accomplish this.

This does work and the padding added to non 8 byte-aligned data is whatever I set in the fillexp. The problem is that this is only applicable to whatever section it is added to. This still leaves the 22KB being set to 0xFFFFFFFF.
The behavior makes sense to me since the commands being used applies ONLY to the defined section it is added to. So then I thought, I can define another section which is placed AFTER all of the normal Flash stuff and have it stretch (in theory) the size of the remaining flash.

But I end up with the same behavior as before, only the 6 padded bytes after the two BYTE output commands are set to the fill pattern. Which makes sense to me.

I'm leaning towards the conclusion that there isn't a good way of filling in the empty Flash space since it looks like the fill pattern is only applicable to defined sections. But I was wondering if TI knew of a way to accomplish this.
I could also be overcomplicating the requirement and it is actually referencing the padding bytes added in between unused memory spaces.
- What are people's thoughts?
Thanks,
Adan




