|
|
View previous topic :: View next topic |
Author |
Message |
wipsri
Joined: 10 May 2011 Posts: 6
|
i2c eeprom bootloader |
Posted: Sun Feb 02, 2014 7:29 am |
|
|
hi all,
i am implementing the below code, pl suggest whether it works, if so any ideas/code snippets.
1) running the application program, logging the hex code (updated code) thru GPRS and saving into external eeprom
2) running the i2c bootloader (preloaded) and fetching the hex code from ext eeprom and writing to the program memory
3) exit the i2c bootloader code and run application code
using pic18f6722, 24c1024, gprs modem
modifying the ccs serial bootloader to i2c bootloader, any hints/suggestion
what should be the write and read procedure? page/line by line/location wise/any other pattern.
in which pattern the updated hex code to be sent from the server to remote thru gprs - page/line by line/location wise/any other pattern. the gprs modem has 1024 bytes of buffer. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9247 Location: Greensville,Ontario
|
|
Posted: Sun Feb 02, 2014 9:42 am |
|
|
There's a whole lot of 'issues' to deal with... so start off with the basics.
1) start with solid running hardware and confirm you can write/read to the external I2C EEPROM. Be sure to run several tests with known data over the ENTIRE code space.EEPROM memory!
2)use a PC, hardwired to PIC and confirm you can get the 'normal ' bootloader to work reliably.
3) cut code to control/receive data from the GPRS modem.
obvious things to watch for is corrupt data,missing data,need for timeouts,solid power supply,power fail detection,etc.
this should keep you busy for a week or so.......
you've got to break the project into small,workable 'sub programs' or you'll go grey fast!
hth
jay |
|
|
wipsri
Joined: 10 May 2011 Posts: 6
|
|
Posted: Sun Feb 02, 2014 11:51 am |
|
|
hi temtronic, thx for your reply.
hardware is functioning as required and the i2c eeprom also working in all aspects like reading & writing.
my ccs serial bootloader with pc serial port is working and tested with different example codes.
gprs code to&from data transfer is also working fine, now how to transfer the hex code/save & retrieve for programming with bootloader i mean pattern?
for corrupt data/missing data, timeouts i thought of implementing the crc checking techniques.power supply i have battery source in the H/W.
need help in hex code transfer format/length and storing format.
need help in modifying the serial bootloader to i2c bootloader. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9247 Location: Greensville,Ontario
|
|
Posted: Sun Feb 02, 2014 12:43 pm |
|
|
hmm..
the next task would be....
.. super easy to reassign the serial to the gprs module instead of the PC. Since you know the PC bootloader code is OK, and the gprs is 'alive', just change the 'stream' assignment and it should work 'wirelessly'.
Where the PIC gets the serial data from doesn't matter,so this step will confirm you can update via the gprs.
The next step would be to edut the bootloader to store into I2C for later update, but first you need to confirm 'bootloader via gprs' works. As no major code change is required, it should be simple.
several small steps are easier than one big jump !
hth
jay |
|
|
wipsri
Joined: 10 May 2011 Posts: 6
|
|
Posted: Sun Feb 02, 2014 10:17 pm |
|
|
hi temtronic, my gprs code is in application not in bootloader code, so i need to log the data and store into i2c thru application code, later using i2c bootloader dump the code/replace the existing application code. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19553
|
|
Posted: Mon Feb 03, 2014 2:19 am |
|
|
The same comments apply, though another set are added:
First thing, do you really need/want a 'bootloader' then?. A bootloader carries a 'cost' with it, of adding a fractional delay to boot itself, and delaying interrupt handling a tiny amount. May not 'matter', but must be considered. A high memory 'reprogrammer', should be considered, rather than a bootloader.
Then is EEPROM the right technology for holding the data?. Remember that writes to this are slow, and 'why use it'. Given that the data arrives, and then is written, there is no need for the storage used for this to survive power loss.
Then the key comments already given, arrive. You need to design the whole transmission, so that you can be confident that the data is complete, undamaged, and ready to be written. What does the unit do if partial data loss occurs?. How can this be recovered?.
Design the transmission first, and how the protection is going to be done.
Best Wishes |
|
|
lucasromeiro
Joined: 27 Mar 2010 Posts: 167
|
Re: i2c eeprom bootloader |
Posted: Mon Nov 09, 2015 4:42 pm |
|
|
wipsri wrote: | hi all,
i am implementing the below code, pl suggest whether it works, if so any ideas/code snippets.
1) running the application program, logging the hex code (updated code) thru GPRS and saving into external eeprom
2) running the i2c bootloader (preloaded) and fetching the hex code from ext eeprom and writing to the program memory
3) exit the i2c bootloader code and run application code
using pic18f6722, 24c1024, gprs modem
modifying the ccs serial bootloader to i2c bootloader, any hints/suggestion
what should be the write and read procedure? page/line by line/location wise/any other pattern.
in which pattern the updated hex code to be sent from the server to remote thru gprs - page/line by line/location wise/any other pattern. the gprs modem has 1024 bytes of buffer. |
I need to do exactly the same thing!
Can you tell me if you could?
I'm starting now, I need help. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|