Bluetooth (serial) Bootloader
Posted: Mon Aug 04, 2014 2:53 pm
I'm looking at the options for writing a bootloader for my project and was hoping I could get some tips and pointers from the board before going too deeply in to researching this.
I'm using the PIC18LF46K22. I have a RN42 on the UART and was hoping to update via this Bluetooth link.
My understanding is that I need to find some way to trigger the bootloader code - I'm planning to look for a particular button press on power-up. Easy enough.
I have a 64K EEPROM in my circuit so I'm thinking that it would be safer to write my new code to this EEPROM, do some checking (CRC) to see if the data has transmitted correctly then write it to the PIC. This allows me to recover the device to an operating unit if the upload fails to work. The other option would be the opposite way, I copy the current program memory to the EEPROM, write directly from the input data stream and recover from EEPROM if necessary.
So, the PIC side of things doesn't seem overly complex, the only hassle is fitting it in to 4k or less of memory.
What I don't know is how to get my compiled program out to the bootloader.
I've tried loading in a compiled .hex file and comparing the contents to what I see in the PICKit 3 programmer window. I can see some of the data but not all and I can't see a pattern as to how the data is stored. Can anyone point me in the direction of how to interpret this data?
Is there anything else I need to be aware of or to cover?
Any help much appreciated.
I'm using the PIC18LF46K22. I have a RN42 on the UART and was hoping to update via this Bluetooth link.
My understanding is that I need to find some way to trigger the bootloader code - I'm planning to look for a particular button press on power-up. Easy enough.
I have a 64K EEPROM in my circuit so I'm thinking that it would be safer to write my new code to this EEPROM, do some checking (CRC) to see if the data has transmitted correctly then write it to the PIC. This allows me to recover the device to an operating unit if the upload fails to work. The other option would be the opposite way, I copy the current program memory to the EEPROM, write directly from the input data stream and recover from EEPROM if necessary.
So, the PIC side of things doesn't seem overly complex, the only hassle is fitting it in to 4k or less of memory.
What I don't know is how to get my compiled program out to the bootloader.
I've tried loading in a compiled .hex file and comparing the contents to what I see in the PICKit 3 programmer window. I can see some of the data but not all and I can't see a pattern as to how the data is stored. Can anyone point me in the direction of how to interpret this data?
Is there anything else I need to be aware of or to cover?
Any help much appreciated.