1

What are my options when it comes to reprogramming an AVR in-circuit? The new program will be received via a wireless connection, so it will need to be stored in some temporary memory container.

I know the AVR can be programmed in this manner via a wired connection using SPI. Would it be necessary to implement a dedicated programmer slave controller that would receive the new program and have hard-wired connections and re-flash via SPI?

Any suggestions?

sherrellbc
  • 3,431
  • 6
  • 35
  • 62
  • 6
    Why not have a bootloader that can receive the update via UART, just like the Arduino does? – Ignacio Vazquez-Abrams Apr 10 '14 at 16:01
  • Wouldn't there still be a dedicated second controller in that case - one to receive the transmitted program? So you are suggesting just flashing via UART rather than SPI, correct? I like that idea much better. – sherrellbc Apr 10 '14 at 16:03
  • You don't need a second (or third, in this case) controller; upon receipt of a special packet the wireless receiver should twiddle a GPIO which would reset the AVR and initiate programming, and the rest of the packets would be the actual upgrade, pumped directly into the AVR's UART. – Ignacio Vazquez-Abrams Apr 10 '14 at 16:05
  • I am not familiar enough with receivers to know their capabilities. Are you referring to a programmable receiver in which it itself has GPIO pins? Otherwise, it might be rather difficult to implement this because the AVR would first have to receive the "special" data over serial from the receiver. After which it would then reset itself to initiate programming. – sherrellbc Apr 10 '14 at 16:15

2 Answers2

2

The basic problem of a remote software update is how you force an (unwilling) target into reprogramming mode. The most sure way is to have an extra micro-controller that supervises the communication and can force the main controller into boot- or programming mode, or maybe even do the actual (SPI) programming.

ANY other solution is at the mercy of the software running on your system. If by accident, hardware problem (power failure) or sabotage etc. the software won't cooperate with the reprogramming, you are stuck. Whether this warrants the addition of an extra controller is an engineering decision.

Wouter van Ooijen
  • 48,407
  • 1
  • 63
  • 136
1

Here are a couple of references to look at:

Wireless arduino programing/radio link

Wireless XBee/AVR programming

Eric Gunnerson
  • 1,216
  • 6
  • 6