I am currently in the middle of porting a project that was originally built in Keil uVision to PlatformIO. I was able to bring things over with relative ease and the project compiled and built without an issue. However, the output files were not working. The code should have started with the Reset_Handler, but it was starting at a seemingly random point in code.
However, while I was troubleshooting, I used the Inspect Memory tool to make sure everything had the right address and to see where exactly the code was starting. After doing so, the output files got larger. I am currently building an elf file and a hex file. After building, the elf file is 159.3 kB and the hex file is 78.2 kB. Then after using the Inspect Memory tool, the elf file is 384.0 kB and the hex file is 87.8 kB. Not only did the files get larger, but the bigger output files work perfectly! I can reproduce this consistently.
This doesn’t make any sense to me. Does anyone know what’s going on here? What does the Inspect Memory tool do that would alter the size of the output files and make them suddenly work?