Skip to main content
Associate III
March 8, 2024
Solved

Images and fonts dump from elf file

  • March 8, 2024
  • 1 reply
  • 1903 views

Hi all,

we have successully used an external SPI memory to store images.

We have defined an external Flash section in our linker file

 

ExtFlashSection :

{

*(ExtFlashSection ExtFlashSection.*)

*(.gnu.linkonce.r.*)

. = ALIGN(0x4);

} >SPI_FLASH

 

and then extract the images from elf file with this command:

arm-none-eabi-objcopy.exe --dump-section ExtFlashSection=images.bin Test.elf

All works perfectly.

Now we want to store the fonts into the external memory. From the TouchGfx guide we see that we have to add the font section into linker file and thats ok.

ExtFlashSection :

{

*(ExtFlashSection ExtFlashSection.*)

*(.gnu.linkonce.r.*)

. = ALIGN(0x4);

} >SPI_FLASH

FontFlashSection :

{

*(FontFlashSection FontFlashSection.*)

*(.gnu.linkonce.r.*)

. = ALIGN(0x4);

} >SPI_FLASH

Now:

should we extract two separate bin files (one for the images and one for the fonts)? And in that case should we merge the bin togheter?

arm-none-eabi-objcopy.exe --dump-section ExtFlashSection=images.bin Test.elf

arm-none-eabi-objcopy.exe --dump-section FontFlashSection=font.bin Test.elf

Do you have any hints?

Thank you in advance for your help.

Best regards

 

This topic has been closed for replies.
Best answer by Mohammad MORADI ESFAHANIASL

Hello @SafeDev ,

No, you don't need to separate them into two different binaries. You just need to dump both sections into one .elf file. As a reference, you can take a look at the Board Setup available for STM32G071RB_NUCLEO on TouchGFX Designer. There is a similar setup for having Fonts and Images on the SPI Flash.

STM32G071RB Board SetupSTM32G071RB Board Setup

 I hope this helps you,
Good luck

 

1 reply

ST Employee
March 14, 2024

Hello @SafeDev ,

No, you don't need to separate them into two different binaries. You just need to dump both sections into one .elf file. As a reference, you can take a look at the Board Setup available for STM32G071RB_NUCLEO on TouchGFX Designer. There is a similar setup for having Fonts and Images on the SPI Flash.

STM32G071RB Board SetupSTM32G071RB Board Setup

 I hope this helps you,
Good luck

 

SafeDevAuthor
Associate III
March 15, 2024

Hi Mohammad,

 

well in the end we solved by extract the two files and then merge them with an external tool and it works!

Thank you

Best regards