Skip to main content
Associate III
Mar 27, 2021 12:04 AM UTC
Question

Is it possible for TouchGFX to generate the text file and images into a binary/hex file separately when generating code? I have a custom bootloader that i want to use to put the resources on an external QSPI flash during firmware update.

..

This topic has been closed for replies.

7 replies

MM..1
Super User
Mar 27, 2021 7:25 AM UTC

Yes but, little correction in your ask, not generate code create bin/hex. This is linker role and you need change linker file setup in used IDE.

cleonb322Author
Associate III
Mar 29, 2021 3:31 AM UTC

thanks. I was hoping that TouchGFX like Microchip Resource Converter/GDDX would convert all resources into a binary file. I recently added a QSPI external memory section to my linker and during development and I used the external loader option on the debugger to load the images into the external flash. Does anyone have an example on adapting the external flash loader to a custom bootloader (I already have a custom bootloader to loads the application)? I can write one (add it to my custom bootloader), but it would be helpful if someone has an example.

Tesla DeLorean
Guru
Mar 29, 2021 4:34 AM UTC

If you already have an external Loader and BSP code it should be a pretty short walk to pull the code into your own loader.

​

T​he .HEX should provide the addressing of content, or you might want to use the .DFU format for a more compact binary object file standard.

​

The linker should be able to export binaries for each section.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SGasp.1
Associate III
Jul 18, 2021 8:18 AM UTC

Hi Cleonb322.. .at the end were you able to modify the bootloader for updating the qspi flash? Can you provide the steps for doing the dame??' I have the ame task and any help would be appreciated... Thanks a lot.. Regards

cleonb322Author
Associate III
Jul 21, 2021 3:19 AM UTC

For development and debugging, I used their example to load the external resources into the QSPI Flash. For the finished product, I created a hex to bin c# cmd line application to split the hex into two bin files. since the external resources start at 0x9000000, it was simple to split into two bin files. then I added the cmd line application to the post-build step. then I can load my application bin file with the bootloader, in the application I checked a flag to determine if I need to reload the resource. This is an SD-Card bootloader, but this can be accomplished with any bootloader.

Msolinas
Senior
Jun 11, 2023 2:17 PM UTC

Hi cleonb, can you share this command line applications? can be very useful for comunity...

thanks.

cleonb322Author
Associate III
Jun 18, 2023 6:11 AM UTC

I have my own app, but I cannot share it for free. however, you can use the below in the post-build steps to separate the binaries:

arm-none-eabi-objcopy.exe -O binary --only-section=FontFlashSection --only-section=TextFlashSection --only-section=ExtFlashSection "${BuildArtifactFileBaseName}.elf" ExternalFlash.bin;
arm-none-eabi-objcopy.exe -O binary --remove-section=ExtFlashSection --remove-section=FontFlashSection --remove-section=TextFlashSection "${BuildArtifactFileBaseName}.elf" InternalFlash.bin