"Post-build steps" after "Cross ARM GNU Flash Image"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Post-build steps" after "Cross ARM GNU Flash Image"

Jump to solution
2,938 Views
ocmonte
Contributor III

Hello Group!

 

Is there a way to invoke a "Post-build steps" after the IDE calls the "Cross ARM GNU Flash Image"? I have a script that needs to run against the SREC file that gets generated. However, my "post-build step" script is run before the  "Cross ARM GNU Flash Image" and thus, the SREC file has not been created yet.

 

This once worked with the CW tools. Any hints would be appreciated!

 

TIA

 

Cheers,

 

Monte---

Labels (1)
0 Kudos
1 Solution
1,870 Views
davidsherman
Senior Contributor I

If it's any help, I had to "massage" the s-record to split it into two sections, so I invoke objcopy to convert the .elf file and generate two s-record files.  I add this on the build steps page, and use the & to add another step:

${cross_prefix}objcopy -O srec project.elf project.srec&<add another step here>

View solution in original post

0 Kudos
5 Replies
1,871 Views
davidsherman
Senior Contributor I

If it's any help, I had to "massage" the s-record to split it into two sections, so I invoke objcopy to convert the .elf file and generate two s-record files.  I add this on the build steps page, and use the & to add another step:

${cross_prefix}objcopy -O srec project.elf project.srec&<add another step here>

0 Kudos
1,870 Views
ocmonte
Contributor III

I tried it - but no luck. I tired my commend followed by an "echo done". Good suggestion but lo luck.

My post build command with the extra echo:

python ${WorkspaceDirPath}/../Scripts/buildInstallImage.py --file ${BuildLocation}/${BuildArtifactFileBaseName}.srec --output ${BuildLocation}/${BuildArtifactFileBaseName}.bin&echo done

Below is the order how the IDE builds.The post-build is invoked after the link:

'Building target: CloverleafOG.elf'

'Invoking: Cross ARM C++ Linker'

make --no-print-directory post-build

'Invoking: Cross ARM GNU Create Flash Image'

0 Kudos
1,870 Views
ocmonte
Contributor III

I see the thinking here. Disable the "Create flash image" in the "Toolchains" and invoke the flash image creation and any other items in the post-build.

Dave had the right idea, Erich kick started my brain.

Thanks!

0 Kudos
1,870 Views
davidsherman
Senior Contributor I

Yes, sorry about that, I should have elaborated that I had to turn off the flash generation and use other means of doing what I intended, for the same reason.

0 Kudos
1,870 Views
BlackNight
NXP Employee
NXP Employee

Yes, you can run multiple build steps as in the previous reply. However, the syntax depends if you are using windows or Linux, see Executing Multiple Commands as Post-Build Steps in Eclipse | MCU on Eclipse

Erich

0 Kudos