Self Programming

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

The newer members of the AVR family have the capability to reprogram themselves in circuit. I will be exploring this in the near future as I have an application where it would be desirable.

Discussion of a number of questions would be useful, I know I don't have all the answers.

Before getting into any specifics, I was wondering how many others are interested. If you have an interest in participating in discussions of this topic please indicate by adding to this thread.

Laurence Boyd II

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

When I dump my program in the Flash memory, it can only last for guaranteed 1000 times, but is that number the same when using SPM ? (I think it is, not sure)

admin's test signature
 

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

Hi :

I think this is a hot issue.

Personally, I am interested in implementing the booloader capability through a gsm modem. The final objective is to upgrade the firmware remotely. To make this, several aspects need to be considered. My main concern, is how to manage an error in the reprograming process.

Any comments ?

Regards,
Alejandro.

admin's test signature
 

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

Hi!

Only erase is damaging to FLASH. Some metal-oxid layer destroly by erasure. Writing is harmless to flash.

VFx
http://www.vfx.hu

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

Hello

This response is to Alejandro's specific questions.

There are two ways to do this. The first would need the boot section
to be able to handle the upload process including handling the GSM
modem in case you loose the connection while trying to load new
firmware. This will require quite a bit of code development for the
boot section.

The second approach is to put a serial eeprom or Atmel serial Data Flash
on the board. The main firmware would have commands to receive the
new firmware and load it to the serial storage device. The main firmware
would verify that the uploaded code is correct with the remote connection.
At this point the remote connection would give a command to 'load new firmware'.
The main code would jump to the bootload section and the boot load section would reprogram the device flash from the contents of the serial storage device(eeprom).
This way the boot section code only needs to be able to program and verify from
the serial eeprom. After the boot section verifies OK then the sytem would
'reboot' and run from the new firmware.

We are planning to implement our uploading this way. We have not gotten the
purchase order to implement the code.

I hope this gives you some ideas.

Thanks

John

admin's test signature
 

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

Hi :

Thank you for your answer John.

I thought in the second approach (storing the program in dataflash or eeprom memory ), but for cost reasons, I prefer to use the first approach (let the bootloader communicate directly with the gsm ).

I know that letting the bootloader manage the comunication with the gsm modem is not trivial, but I will experiment with this alternative.

I think to use something like Xmodem protocol to transfer the firmware. In case there is some problem during the transmission, the bootloader will wait another call to download the firmware. I hope this doesn't use to much code space.

Regards,
Alejandro.

admin's test signature
 

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

The mega128, and IIRC the mega64, can have 8 Kbytes of bootloader code.

Eric

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

Xmodem+crc+loading into flash plush rs232 comms about 600 bytes top end with sloppy programing.
MIke

Keep it simple it will not bite as hard

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

May i know why some of people prefer the serial eeprom approach?

why not use just the first way 

and how can the programming remotely done by both ways

as i assume that there is already a firmware running on a far place and i want to update its firmware code remotely. (ie. i assume the running code now isnt the boot loader one) 

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

embedded.system wrote:
May i know why some of people prefer the serial eeprom approach? why not use just the first way

Perhaps things have changed in the thirteen years since the thread started. ;)

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.