cancel
Showing results for 
Search instead for 
Did you mean: 

Images and fonts dump from elf file

SafeDev
Associate II

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

 

Mohammad MORADI
ST Software Developer | TouchGFX

View solution in original post

4 REPLIES 4

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

 

Mohammad MORADI
ST Software Developer | TouchGFX

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

Hi Mohammad,

ok, got it but how I could load my external flash with the elf file using STM Cube Programmer?

Thank you

Best regards

 

Hello again,

There is a broad documentation available here that you can refer to for assistance. You can create your own custom external loader.

Kind regards, 

Mohammad MORADI
ST Software Developer | TouchGFX