I am in the process of moving a large project from IAR to VisualGdb with GCC. IAR has a couple of features that i am having trouble replicating in VGDB and I was wondering if anyone knows how to achieve the following.
1: Output a bin file that is the same size as the flash of the chip, with all unused space in the bin file filled with OxFF
2: Calculate a CRC of the above hex file and place that crc into the end of the hex file (we use this crc for validating the binary image)
No problem, please find the answers to your questions below:
It is possible to pad the .bin file with any specified pattern by editing the linker script. Please see this tutorial.
CRC calculation is not directly supported by VisualGDB yet, however we should be able to add it relatively easily (it would require the Custom Edition though).
You can manually set stack/heap sizes by reserving the space for it via the linker script and overriding the _sbrk() function (that controls the heap placement). For devices with VisualGDB-generated linker scripts (e.g. STM32) this is supported out-of-the-box by referencing the “Fixed-size stack/heap” framework via VisualGDB Project Properties -> Embedded Frameworks. For other devices, this can be accomplished by editing the linker script manually (see the .reserved_for_stack and .heap sections in the STM32 linker scripts and also the StackAndHeap.c file).