Automatic in-field Due reflash

I don't necessarily disagree Gogol. My suggestion was based on my presumption that they already have or plan to have a board where the various processors are connected via SPI. If they're already connected via SPI then why not continue to use that and do firmware updates over the connection as well? If they've already got boards made then using JTAG would require a hardware change and they might not want to do that. Otherwise, you're right, having JTAG would be very handy and bring with it some definite bonuses.

Yes, it is possible to cause the Arduino IDE to emit a permanent hex file that you can grab. Then this file could be streamed over the internet and replace the firmware. Of course, the problem with this approach is that you'd have to write software to do the internet upload and a bootloader that rewrites the firmware. Though, even with JTAG you'd still need some way to stream the firmware over the internet and chances are you'd have to write something for that as well. But, still, the JTAG approach would be a lot less software writing in all likelihood.

The basic outline for SPI based firmware updating would be something like this:

  1. Your control hardware (Raspberry Pi?) sends a command over SPI to the running firmware on a Due/Cortex M3
  2. The firmware sees that this command says to reboot into the bootloader so it shuts down everything and reboots
  3. Upon reboot the bootloader takes control and tells the control side that it is ready
  4. The control side begins to send firmware data which the bootloader uses to overwrite the existing firmware
  5. The control tells the bootloader that it is done
  6. The bootloader jumps to the start of the firmware program

The slight complication here is that you normally want the devices to start up without going into the firmware updating bootloader. On processors with EEPROM the ROM space tends to have a flag set for whether firmware should be updated or not. The Cortex M3 has no EEPROM so you can't signal via a ROM flag. You could store the flag in FLASH memory somewhere outside of the firmware or bootloader space or you could always start up in the firmware updater but timeout quickly if the control side doesn't signal that it is doing an update.

So, it's complicated but possible. I suppose the question is, can you modify the hardware or do you really need to do this via spi?