2022-06-28 02:20 PM
I have a touchgfx project, and I need to send bytes from a hex file over uart to a different micro. Everything in this works, but I am using dummy data that I hardcoded into the program. I want to be able to add a .hex file to my project, have my program open it, read it, and then put it into a byte array for me to eventually send over.
I was going to use the process outlined in this link: HEX File to Array in C : 10 Steps - Instructables, however, I am not certain on the correct way to add the hex to the project and then properly read it especially in the STM32CubIDE environment.
2022-06-29 07:32 AM
Why hex why not bin ? What you mean as runtime? Runtime and STM32CubeIDE is complete different ...
2022-06-30 03:52 AM
Hi @DSand.5 ,
If by “add a .hex file to my project�? you mean add prior to compiling, then you could look at adding a post build step in STM32CubIDE and use srec_cat to insert the contents of the .hex at a known location.
The result would be equivalent to your current hardcoded version.