This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F29H85X-SOM-EVM: F29 Linker generate and update empty sections for postbuild section update.

Part Number: F29H85X-SOM-EVM

Tool/software:

Hi Experts,

I'm trying to create a empty section with a set address that I could update the section with a binary image from another build project. So far, this is what I have specified in the linker script

SECTIONS
{
    ...
    
    cpu1_app      : {} fill(0) > 0x10018000,  type=COPY, START(app1EntryAddr)
}

And it does generate an empty section with the set address:

In my post build step within CCS, I used c29objcopy to update this section with a custom application image via:

${CG_TOOL_OBJCOPY} --update-section cpu1_app=../../cpu1_firmware.bin ${ProjName}.out ${ProjName}_firmware.out

And the result for the most part is what I expected (replaces the cpu1_app section with a real section that has offsets and addresses)

However, every once a while a failure occurs when I wanted to convert the .out image into binary:

It seems to be complaining about the elf format. And this failure only comes up randomly.

(Note I didn't populate map any code/variables to this cpu1_app. I'm relying on fill(0) to bypass the size checks in this section when updated by c29objcopy )

Is there any suggestions on how can I solve this issue? Or please recommend me the best way to generate and update empty sections.