Suggestion: Build code or SVN code

When working on embedded HW it is always easy to loose track of what exactly is running. A common trick is to include the SVN rev number, timestamp or some other counter.

Right now the system seems to track the build number. Is this exposed; so we can do something like

printf("Started (Build #" __BUILD_NO__ " - compiled " __DATE__ "\r\n");



28 Oct 2010

Another vote for this. It would be very handy to be able to check the build number!

28 Oct 2010

Hi Dirk, Ian,

We don't support this, but we could do something like it. Would a timestamp be acceptable for you (e.g. a UNIX timestamp)?



28 Oct 2010

Its workable.

i'd like to be able to printf it so that i can identify a 'build number' in the final system.

23 Jan 2011

You can already printf the TIME macro (or variable?):

    printf("******** [%s] *********\n",__TIME__);
23 Jan 2011

Excellent point Hendrik,

See more:

We will still look at including our own data in the build in the future.


03 Jul 2014

Any actions or updates related to this ??

03 Jul 2014


there're 2 macros, one is MBED_BUILD_TIMESTAMP and revision macro MBED_LIBRARY_VERSION.


03 Jul 2014

Did not work as I tried it in this way: Software static char swversion[31] = "MBED_BUILD_TIMESTAMP ";

Any example available ?

03 Jul 2014

Solved: add this into the main() sprintf(swversion,"Build: %f", MBED_BUILD_TIMESTAMP); TODO format more readable year, month, day, hours, minutes, seconds

03 Jul 2014

Quick format: time_t temp; struct tm *timeptr; temp = MBED_BUILD_TIMESTAMP; timeptr = localtime(&temp); strftime(swversion,sizeof(swversion),"Build %A-%b-%d %r", timeptr);