Generate multiple HEX files with compile time as hard coded as serial number.

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I am using Atmel Studio 7 on Windows 10. I'm using __DATE__ and __TIME__ in program memory hard coded to generate serial number.

It takes around 4-5 seconds to rebuild project for each individual HEX file generation. though __TIME__ is updates every second so no repetition issue now.

Is there any way to auto generate HEX files on specific time interval? if yes can it be auto renamed by?

 

PS: i'm not allowed to use random number as serial, and its must be hard coded in firmware.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Take a look at srec_cat  http://srecord.sourceforge.net/man/man1/srec_cat.html

 

With the right script it can read in a .hex file, replace certain known offsets with whatever value you want like the host computer's date and time, and write out a new .hex file.  I use it to calculate the program CRC and embed it inside .hex file as a post build script.

Last Edited: Mon. Jul 1, 2019 - 02:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Personally I'd use Pre/Post steps probably done in Python. Snapshot the time at the start so it doesn't matter if it "ticks on"later in the build and feed that into the build. Also feed it into a post build step where the generated files are renamed according to the info recorded at the start.