CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

i2c eeprom bootloader

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
wipsri



Joined: 10 May 2011
Posts: 6

View user's profile Send private message

i2c eeprom bootloader
PostPosted: Sun Feb 02, 2014 7:29 am     Reply with quote

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: 9220
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Feb 02, 2014 9:42 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Feb 02, 2014 11:51 am     Reply with quote

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: 9220
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Feb 02, 2014 12:43 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Feb 02, 2014 10:17 pm     Reply with quote

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: 19492

View user's profile Send private message

PostPosted: Mon Feb 03, 2014 2:19 am     Reply with quote

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

View user's profile Send private message

Re: i2c eeprom bootloader
PostPosted: Mon Nov 09, 2015 4:42 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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