🛠 Sauver une Due invisible : bouton Erase, SAM-BA et bossac en secours

Arduino Due · avance · Schéma : IMG-due-avance-3-reparer-due-bouton-erase-sam-ba.svg — Arduino Due vue de dessus avec les boutons RESET et ERASE surlignés près du connecteur ICSP/JTAG, port Programming relié au PC, étapes numérotées maintenir ERASE puis téléverser, et outil SAM-BA en secours.

Objectives

Counter-intuitive but documented: unlike AVR boards, the SAM3X must ERASE its flash before any re-programming when a sketch is already running. Normally, the IDE handles this via the 1200 baud command (the "touch" that drops the board back into the sam-ba bootloader). But when the board becomes invisible — no Programming port, no Native port, a runaway sketch that disables USB at startup — you need the manual procedure: Erase button + bossac or SAM-BA. This tutorial is the anti-panic insurance for all others.

Hardware

Complete code

Procedure 1 — reprogrammation manuelle au bouton Erase
1. Brancher le port Programming au PC ; verifier qu'un port serie apparait.
2. Maintenir le bouton ERASE enfonce.
3. Tout en maintenant ERASE, lancer Televerser dans l'IDE.
4. Relacher ERASE quand la progression demarre (le bootloader efface
   puis ecrit). Le sketch precedent est perdu, le nouveau prend la main.

Procedure 2 — bossac en ligne de commande (equivalent de l'IDE)
bossac --port COM7 -b -e -R -U flash:w:sketch.bin:i
#  -b reset vers le bootloader, -e efface la flash, -R relance apres ecriture

Procedure 3 — carte totalement invisible (bootloader brické)
1. Tester un autre cable (la cause n°1 reste le cable de charge seule).
2. Sur les clones, verifier la puce du port Native : televerser via
   Programming (16U2 ou equivalent), le Native peut etre inerte.
3. En dernier recours, lancer SAM-BA sur l'UART du port Programming
   (moniteur ROM present a l'adresse 0x00030000 du SAM3X) et effacer
   la flash depuis l'outil, puis re-téléverser normalement.
4. Le connecteur JTAG permet aussi une reprise par sonde (OpenOCD).

Sketch de test « je suis vivant » a televerser apres recuperation :
void setup {
  pinMode(13, OUTPUT);
  Serial.begin(115200);      // port Programming
  SerialUSB.begin(115200);   // port Native
  Serial.println("Due recuperee !");
}
void loop {
  digitalWrite(13, HIGH); delay(100);
  digitalWrite(13, LOW);  delay(100);
  Serial.print(".");
}

Expected verification

After procedure 1 or 2, the upload completes without bossac errors, and the test sketch makes LED 13 blink rapidly while writing dots to the Programming port. In procedure 3, SAM-BA detects the SAM3X on the UART (baud rate 1300000 or the one suggested by the tool) and erases it; the board then reappears in the IDE.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials