So I am using the checkbox from VisualGDB Properties that generates a hex file from my build along with the bin and elfs.
It generates the PROGRAM_FLASH regions all fine and the addresses are correct, but I have a region at the end of flash space as well that I want in the generation as well, which it is…!
The catch though is that it pads the entire space between the end of the actual program and the end region with 0x00’s (which is strange because it is FLASH which should be asserted 0xFF but that’s fine)
I’d like to know why it is padding all these 00’s and if it is possible to not have it do that?
Normally, the hex files should not have any adding at all – the areas between the sections are simply excluded from the file. Either way, VisualGDB generates these files via the objcopy tool from the toolchain. You can try copying the tool command line from the build log, running it manually and experimenting with various options.
Alternatively, you can try using .bin files – VisualGDB explicitly passes the –gap-fill argument to objcopy when generating them, controlling the filler value between the sections.