avrdude chiperase issue

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My chip is avrxmega256A3.
Let me first explain what I'm trying to achieve so that you can possibly preempt any further discussion if the approach is bad.

I'm developing for a project that imposes a separation between app configuration and code.
The basic idea behind separation of constant config data and application code is to have the ability generate a unique binary app, to be used on a large set of xmega uC that have been reprogrammed with differet configuration (instead of having to produce multiple binary applications).

For the app configuration I chose eeprom memory, whereas for the code I obviously use flash memory.
I'm using avrdude 5.11.1 to reprogram the different memories.

My issue is in the "automation" of the reprogramming procedure.

Specifically I need to support 3 types of procedures:
- flashing of the app + config
- flashing of the config
- flashing of the app

Unfortunately, for the 1st and 2nd reprogramming procedure I need to perform chiperase
- before reprogramming the memory, but also
- after having disabled EEPROM protection bit in FUSE5

It is so unfortunate that avrdude does not allow me to do that. When it sees that I want to perform a write to flash (-U flash:w:./image.bin:r) or a forced erase (-e) it performs the chiperase BEFORE even writing the FUSE bit and therefore the erase operation does not affect the EEPROM if it is locked.

Is there a better support for this ? I see for instance I can invoke avrdude command line with the -t option.. maybe I can feed it with a sequential set of operations ?

Thanks in advance,