Keith03
- 13th July 2011, 19:40
Hello All,
I have been lurking about this forum for some time. I really enjoy the ideas and assistance that you all have offered here. I have a project that I am unable to figure out or find anywhere so I joined the club to see if anyone else may have an idea.
I have a PIC-based device that I am using PIC Basic Pro on. I have a serial number stored in EEPROM on a 16F876A device. This serial number is currently programmed by a serial command and stored in the EEPROM after the device firmware is programmed. This is an extra step that is somewhat error-prone and the serial number can be deleted or changed after the board ships.
So, I had an idea to put a dummy pattern in the code space (flash memory) and use a shell script (BAT file) to locate the pattern in the HEX file and replace it with a real serial number right before the firmware is written to the device.
I am using a very customized build environment on a Linux computer. I have a custom build scripting system for revisioning, automatic back ups of builds and running PBPW.exe, etc...
My question is not how to write the shell script nor am I expecting anyone to understand how my build environment works. I just am looking for ideas that I can use to store a dummy pattern in the code space of the PIC device from PIC Basic Pro and be able to locate these bytes in the resulting HEX file. Simple right? LOL
My serial number is eleven ASCII characters. Basically, just the date followed by three digits (i.e. 20110713001). I was thinking of using a pattern like $A5 repeated eleven times.
Thank you in advance if anyone has done anything like this before and/or has any ideas. I will keep plugging away at it.
Thank you for bearing with me on this long description.
Best regards All,
Keith
I have been lurking about this forum for some time. I really enjoy the ideas and assistance that you all have offered here. I have a project that I am unable to figure out or find anywhere so I joined the club to see if anyone else may have an idea.
I have a PIC-based device that I am using PIC Basic Pro on. I have a serial number stored in EEPROM on a 16F876A device. This serial number is currently programmed by a serial command and stored in the EEPROM after the device firmware is programmed. This is an extra step that is somewhat error-prone and the serial number can be deleted or changed after the board ships.
So, I had an idea to put a dummy pattern in the code space (flash memory) and use a shell script (BAT file) to locate the pattern in the HEX file and replace it with a real serial number right before the firmware is written to the device.
I am using a very customized build environment on a Linux computer. I have a custom build scripting system for revisioning, automatic back ups of builds and running PBPW.exe, etc...
My question is not how to write the shell script nor am I expecting anyone to understand how my build environment works. I just am looking for ideas that I can use to store a dummy pattern in the code space of the PIC device from PIC Basic Pro and be able to locate these bytes in the resulting HEX file. Simple right? LOL
My serial number is eleven ASCII characters. Basically, just the date followed by three digits (i.e. 20110713001). I was thinking of using a pattern like $A5 repeated eleven times.
Thank you in advance if anyone has done anything like this before and/or has any ideas. I will keep plugging away at it.
Thank you for bearing with me on this long description.
Best regards All,
Keith