How to customize the name of the .axf and .bin release output file?

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

How to customize the name of the .axf and .bin release output file?

2,373 Views
cybaluke
Contributor III

Hi,

from the same MCUXpresso project I generate the firmware fo many similar devices changing a label defined in  a general header file and using #ifdef switches in the code, for example in a general_def.h file I define:

   general_def.h: #define FWR_DEVICE_LABEL final_device_type

Now I can switch on the right firmware to compile changing the label "final_device_type" but all the output release names of MCUXpresso have the same name of the project so this generate a little confusion for me.

For this reason I would "automatically" change also the name of the output compiled files from MCUXpresso on the Release dir depending from the same #define FWR_DEVICE_LABEL label already defined in general_def.h file. If possible I would also append the date of the compile at the end of the name .

For example in general_def.h I would define two labels:

   #define OUTPUTRELNAME final_device_type

   #define OUTPUTRELNUMBER final_device_release

and in .\Release\    directory  instead of project_name.axf and  project_name.bin I would find the compiled files with the new names:

   .\Release\final_device_type__final_device_release__compiledate.axf

   .\Release\final_device_type__final_device_release__compiledate.bin

Is it possible? how can I do it? any suggestions?

thanks

0 Kudos
4 Replies

2,103 Views
BlackNight
NXP Employee
NXP Employee

Hi Luca,

the output file name is configured in the 'Build Artifact' page:

pastedImage_1.png

You can use there Eclipse variables (as ${ProjectName}) to configure it, but you cannot access symbols in the source files or header files that way.

What you could use is the concept of 'Build Configurations' in Eclipse CDT (see Build Configurations in Eclipse | MCU on Eclipse ). That way you could use dedicated configuration for each of your builds with using -D option to set some defines as needed.

I hope this helps,

Erich

2,103 Views
cybaluke
Contributor III

Thanks to all for the suggesions. At the moment for this actual project I cannot use different Build Configurations, I think I will still use the #define switches inside the code with a general #define label for the control.

For a next project I will try the way of different build configurations, ...just other questions about this way: in addition to the compile date can I also have an automatic release info to add to the build release? Which is the best way to simplify the release infos management on MCUXpresso?

0 Kudos

2,103 Views
BlackNight
NXP Employee
NXP Employee

I'm using the post-build steps for this kind of things: MCUXpresso IDE: S-Record, Intel Hex and Binary Files | MCU on Eclipse 

I hope this helps,

Erich

2,103 Views
converse
Senior Contributor V

First, I would suggest using a different build configuration for each of your different builds. You then end up with each built file in its own directory.

If this is not what you want, you can use 'Build Variables'. You can see all of the build variable available to a project by looking in the project settings and clicking on the Build Variables section (and making sure the 'Show System Variables' box is checked. See below

pastedImage_1.png

To change the output file name (the build artifact), click on the Build artifact and change the Artifact name. For example to add the date to the name, use ${ProjName}${current_date}:

pastedImage_2.png

Good luck