The GNU ARM Eclipse plugins from Liviu already offer several built-in actions which can be performed at the end of a build: creating flash image, create listing file and printing the code and data size:
But what if I need different things, or even more things?
For this there is the ‘Post-build steps’ settings I can use: that command is executed at the end of the build:
💡 Be aware that by default pre-build scripts might not wait until finished before starting the build. Disabling parallel build avoids the problem — see https://community.nxp.com/message/1058714
❗ The post build step is only executed if sources files have been compiled and linked. If you want to enforce that there is always a ‘true’ post build, then you need to delete some files in the Pre-build step to enforce a compilation and a link phase.
Multiple Post-Build Steps
But what I need more than one action in the post-build step? I could call a batch or script file, but this is probably an overkill in too many cases, and adds a dependency to that script file. A better approach is to directly execute multiple commands as post-build step.
Unfortunately, the documentation found about the post-build step with a web-search is misleading (e.g. in the Eclipse Luna documentation):
“Command: Specifies one or more commands to execute immediately after the execution of the build. Use semicolons to separate multiple commands.”
Unfortunately, semicolons is plain wrong (at least did not work for me) :-(. The solution is to use ‘&‘ (ampersand) to separate multiple commands on Windows:
💡 On Linux, use the ‘;’ to separate commands as noted in the documentation/help, and use ‘&’ on Windows. Unfortunately, this makes project not cross-platform.
And this works for me, at least under Windows 7 :-).
Links related to that topic:
- GNU Additional Tools: Create Flash Image, Print Size and Extended Listing Options
- S-Record Manipulation with GNU objcopy and Burner Utility
- S-Record Generation with gcc for ARM/Kinetis
- Converting S19 Files into Binary Files with GNU objcopy
Happy Post-Stepping 🙂