🛠 Mettre à jour le firmware du module radio (piège de désynchronisation)
Objectives
The LoRa module embeds a second microcontroller (STM32L0) whose AT firmware evolves independently from the SAMD core. The classic pitfall: "Firmware version mismatch" when a recent MKRWAN library encounters an older firmware (issue #126). This tutorial updates the module cleanly.
Hardware
- 1 Arduino MKR WAN 1300
- Either the MKRWANFWUpdate_standalone example (firmware binaries are embedded in the sketch), or a second Arduino for the FWUpdaterBridge
- MKRWAN library + arduino/mkrwan1300-fw repository (reference)
Complete Code
// Etape 1 — lire la version courante :
#include <MKRWAN.h>
LoRaModem modem;
void setup {
Serial.begin(115200); while (!Serial) {}
if (!modem.begin(EU868)) {
Serial.println("Module muet : firmware corrompu ?"); while (1) {}
}
Serial.print("firmware actuel = ");
Serial.println(modem.version); // comparer aux releases du depot fw
}
void loop {}
// Etape 2 — mise a jour :
// Ouvrir File > Examples > MKRWAN > MKRWANFWUpdate_standalone,
// coller les binaires du firmware dans l'onglet, televerser, ouvrir le
// moniteur et suivre la progression. Alternative : FWUpdaterBridge avec
// un second Arduino cable en SPI sur le module.
Expected Verification
After the update, modem.version displays the current release and the messages "Failed to start module" / "Firmware version mismatch" disappear. The OTAA examples run normally again.
Common Errors
- Updating the library without the firmware (or vice versa): desynchronization — always align both.
- Known bug in arduino_read within MKRWANFWUpdate_standalone (issue #134): if the progress stalls, rewire or switch to FWUpdaterBridge.
- Wrong band binary (EU vs US): the module restarts in a loop.
- Confusing this with the SAMD bootloader: here we only flash the module's STM32L0.
Other tutorials for this board
Code examples for this board
emission-p2p.inoArduinoreception-p2p.inoArduinoreglage-sp.inoArduinometeo-lora.inoArduinotrame-crc.inoArduinorelais-radio.inoArduino