After I did this:
int i;
for(i = 0; i < 55; i++) {
pinMode(i, INPUT_PULLUP); // set all pins to this mode so that unused pins end up like this
}
my Due board will not accept any new program and I get this response:
Write 45388 bytes to flash (178 pages)
[ ] 0% (0/178 pages)
SAM-BA operation failed
Failed uploading: uploading error: exit status 1
How can I rescue my Due board?
Hello ianr9000
My experience: disconnect the native USB port during programming.
hth
According to the response I guess the bootloader is destroyed.
The Arduino IDE provides the function "Burn bootloader" in menue Tools.
You need a programmer to burn it. For instructions search for "burn bootloader" on the arduino main page. There is a description "Burn the bootloader on SAMD boards".
Did you read this:
Automatic (Software) Reset
The SAM3X microcontroller differs from AVR microcontrollers because the flash memory needs to be erased before being re-programmed. A manual procedure would involve holding the erase button for a second, pressing the upload button in the IDE, then the reset button.
Because a manual erase-flash procedure is repetitive, this is managed automatically by both USB ports, in two different ways:
Native port
Opening and closing the ''Native' port at the baud rate of 1200bps triggers a "soft erase" procedure: the flash memory is erased and the board is restarted with the bootloader. If, for some reason, the MCU were to crash during this process, it is likely that the soft erase procedure wouldn't work as it's done in software by the MCU itself.
Opening and closing the Native port at a baudrate other than 1200bps will not reset the SAM3X.
source: https://www.arduino.cc/en/Guide/ArduinoDue
1 Like
Thanks. That's good to know.
When I tried to program the board this morning (the normal way), it worked fine again. I'm not sure what went wrong yesterday but all is working again this morning!
2 Likes