Part Number: TMS320F280025
1.Bcakground Introduction:
- Operating System: windows 11
- Code Composer Studio Version: 12.5.0.00007
- Compiler Version:TI v22.6.1.LTS
- Output format:eabi(ELF)
- Flash uses SEC0 and SEC1, the final program and data is not full for the 2 flash sectors.
FLASH_BANK0_SEC0 : origin = 0x080000, length = 0x001000
FLASH_BANK0_SEC1 : origin = 0x081000, length = 0x001000
- Final Hex has unused areas because of data alignment(flash holes)
- I can generate HEX files(e.g. Intel Hex) right, and use this file to generate BIN files using other tools;
- But I have some problems when generating BIN files using CCS directly;
2.Solutions I have tried:
2.1 Post-Build
Using tiobj2bin.exe in Post-Build (Properties→Build→Steps→Post-build steps):
"${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd2000" "${CG_TOOL_ROOT}/bin/hex2000" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"
<C28x files built with --abi=eabi are not supported> erro will appear, because of Project output format is eabi(ELF)
2.2 Using C2000 Hex Utility
Set output format to Binary(--binary,-b), --memwidth=8 --order=MS --romwidth=16, and generate bin fies.
The final result is that, flash holes is not filled, and programe/data is written at the wrong places after the first falsh hole;
2.3 --image
Based on 2.2, I trun on the --image property and set --fill to 0xFFFF, add a file describing ROMS as below(because of 8-bit and 16-bit reason, the address is multiplied by 2):
ROMS
{
FLASH_ALL : org = 0x00100000, len = 0x004000
}
In this way, the bin can generate right with holes filled 0xFFFF, but the reserved flash that the programe is not used is set to 0xFFFF also.
For example, the hex end address is 0x081500, data from address 0x081500 to 0x081FFFF in bin file is also set to 0xFFFF, but there is no data at this address in hex files.
I want to get the bin files wihout ununsed flash area and it can change automatically according to programe size.
How should I do to get the right BIN file I want to get?