2020-12-03 03:52 AM
Hi,
I want to split the .BIN file because it is too big... Here is the size of the files :
Here is the memory used :
I am using an USB flash drive to update my system program. I know I need to split .BIN file into multiple files which can describe multiple regions. I can use FromELF to do this but I don't know how to use it...
Could you help me ?
2020-12-03 04:27 AM
Seem to recall FromELF being able to output command line help.
Might also want to just read the ELF specs, and have the update code walk that, the thing isn't that complex if you just want to fish out the code/data sections. It provides addresses and sizes, and you don't need to get into the symbols or entry points.
2020-12-03 04:48 AM
Hi,
I used the example of "STM32Cube_FW_F7_V1.16.0\Projects\STM32756G_EVAL\Applications\USB_Host\FWupgrade_Standalone" (you can see my other post).
First of all, I want to update only the FLASH/RAM section. Then, if the FLASH/RAM works, I will try to update the QSPI section.
How can I use FromELF to separate this two sections ?
2020-12-03 05:08 AM
I think the default behaviour of --bin is the split the binaries as outputting 2GB of empty space is stupid. Not sure you get to be selective. Something like objcopy might provide more options, but the file structure at the section level is relatively simple.
Product: MDK-ARM Lite 5.28
Component: ARM Compiler 5.06 update 6 (build 750)
Tool: fromelf [4d35e3]
ARM image conversion utility
fromelf [options] input_file
Options:
--help display this help screen
--vsn display version information
--output file the output file. (defaults to stdout for -text format)
--nodebug do not put debug areas in the output image
--nolinkview do not put sections in the output image
Binary Output Formats:
--bin Plain Binary
--m32 Motorola 32 bit Hex
--i32 Intel 32 bit Hex
--vhx Byte Oriented Hex format
--base addr Optionally set base address for m32,i32
Output Formats Requiring Debug Information
--fieldoffsets Assembly Language Description of Structures/Classes
--expandarrays Arrays inside and outside structures are expanded
Other Output Formats:
--elf ELF
--text Text Information
Flags for Text Information
-v verbose
-a print data addresses (For images built with debug)
-c disassemble code
-d print contents of data section
-e print exception tables
-g print debug tables
-r print relocation information
-s print symbol table
-t print string table
-y print dynamic segment contents
-z print code and data size information
2020-12-03 05:27 AM
I used this command : arm-none-eabi-objcopy.exe -O binary --only-section=ExtFlashSection "${BuildArtifactFileBaseName}.elf" ExtFlash.bin;arm-none-eabi-objcopy.exe -O binary --remove-section=ExtFlashSection "${BuildArtifactFileBaseName}.elf" STM32F746.bin
Size of file "ExtFlash.bin" : 10.3 Mo (good)
Size of file "STM32F746.bin" : 2.13 Go (not good)
I want only the FLASH section...
2023-05-01 07:42 PM
Did you ever figure this out? I'm trying to do the same thing and like you mention I can separate out the external flash part fine but then application is left with the 2GB of 0's.
Thanks
2023-10-31 12:26 PM - edited 2023-10-31 12:56 PM
I don't know if this will fix your issue, but I was able to separate the internal and external successfully without a 2GB large internal file. It was using a command similar to @MMerc.1 .At least with my project, I had an additional section in my external flash "FontFlashSection", so that section needed to be removed from the internal flash file and added to the external flash section. If I neglect to do this, I get the 2GB size internal flash size bin file.
arm-none-eabi-objcopy.exe -O binary --only-section=ExtFlashSection --only-section=FontFlashSection "${BuildArtifactFileBaseName}.elf" ExternalFlash.bin;arm-none-eabi-objcopy.exe -O binary --remove-section=ExtFlashSection --remove-section=FontFlashSection "${BuildArtifactFileBaseName}.elf" InternalFlash.bin