Build number autogenerating

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

Build number autogenerating

529 Views
Glogov_Kolac
Contributor II

Is there a possibility to autogenerate build number after building the project in codewarrior. This way every time project is built, some location in FLASH (constant) will be incremented and we can clearly distinguish the difference between two device by reading the build number .

Labels (1)
Tags (3)
0 Kudos
1 Reply

300 Views
BlackNight
NXP Employee
NXP Employee

Have a look at http://blogs.freescale.com/2012/06/26/codewarrior-tool-tip-8-extending-the-build-system/

So this could be used say to run a script/batch file which changes a source file and increments the build number.

Another possibility is to use the burner which would modify the S19/binary file. Again either with a .bbl or with a post build step:http://mcuoneclipse.wordpress.com/2012/09/27/s-record-intel-hex-and-binary-files/

What I'm using as a build identification is as well the __DATE__ and __TIME__ compiler macros. This is not a build number, but gives date and time of the build in a string. I use it like this in my FSShell component:

  FSSH1_SendStatusStr((const unsigned char*)"Firmware", (const unsigned char*)__DATE__, io->stdOut);

  FSSH1_SendStr((unsigned char*)" ", io->stdOut);

  FSSH1_SendStr((unsigned char*)__TIME__, io->stdOut);

  FSSH1_SendStr((unsigned char*)"\r\n", io->stdOut);


The output of this you can see n the last screenshot in http://mcuoneclipse.wordpress.com/2012/08/05/a-shell-for-the-freedom-kl25z-board/.

Hope this helps,

Erich