Build number in firmware version

Technical questions regarding the XTC tools and programming with XMOS.
MaximLiadov
XCore Addict
Posts: 130
Joined: Mon Apr 16, 2018 9:14 am

Build number in firmware version

Post by MaximLiadov »

How to automatically add build number in firmware version? It would also work if version automatically incremented every time I compiled a new firmware.


User avatar
fabriceo
XCore Addict
Posts: 186
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

Hello MaximLiadov
you could generate a APP_NAME_build.h file containing a #define xxx incremented with a shell script.
this shell script can be launched at each build by patching the file
xcommon/module_xcommon/build/Makefile.common1

for example, you can add this launcher
$(call EXEC_$(CONFIG))
at line 1047 just below
@echo Checking build modules

and then somewhere in your project makefile, just add a line describing your EXEC_Default command line
EXEC_Default = @echo creating my incremental build number && buildnumber.sh $(APP_NAME)_build.h

then upto you to write buildnumber.sh and share it here :)
MaximLiadov
XCore Addict
Posts: 130
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

That's a bit too much. I give up and prefer manual increment then. Thank you anyway.
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

I'm generally using a manual increment these days with a test in the regression to make sure it is set correctly.

Previously I used to use a release script - it would tag etc and also search for and update version defines - I'd like to get back to that method at some point I think.