In the "Post-build steps" with CCS, I input the following commands to generate HEX file and BIN files for both firmware and CCFG.
${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}.out
${CG_TOOL_HEX} --binary -o ${ProjName}.bin ${ProjName}.out
${CG_TOOL_HEX} --exclude .resetVecs --exclude .text --exclude .args --exclude .rodata --exclude .cinit --binary -o ${ProjName}.cfg ${ProjName}.out
The generated firmware BIN file (.bin) is not correct when there is a gap between .text and .rodate sections. The gap should be filled with 0x00 or 0xFF, but the generator just merges two sections together without a gap. It causes all sections after the .text have wrong location.
I believe this is a bug. Is there any other utility which can generate the .bin file correctly?
NOTE: I failed to upload my .out/.hex/.map/.bin example files, which should help you to quick reproduce the issue. Please let me know how to upload the files (multiple files over 600KB).