Generating .srec file from command line
- February 16, 2025
- 1 reply
- 1065 views
Hey,
I am using the STM32f769NIH controller and my application has Touchgfx and freeRTOS enabled. The code downloading time is too slow and I want to speed it up.
I figured that turning off the external loaders in the debug configurations yields a smaller code size. Originally it was 6.08 MB and after the it became 256 KB.
This .srec file takes mere 6 seconds to download while the 6.08 MB file took 1 minute.
The issue is the IDE keeps waiting for debugger connection for almost 1.5 minutes before it finds it and then downloads the code (Image attached).
I need the command which can generate the .srec file with input elf file. It should exclude external loaders. I'll manually download this .srec file from the STMCubeprogrammer.
Currently I'm using this command which generates the file but the code doesn't work.
"%OBJCOPY%" -O srec --gap-fill 0xFF --strip-debug --srec-len=32 --srec-forceS3 --remove-section=.loader --remove-section=*FlashSection "%BUILD_DIR%\STM32F769I_DISCO.elf" "%BUILD_DIR%\STM32F769I_DISCO.srec"
Thanks
