🛠 Mettre à jour le firmware du module NINA
Objectives
Take back control of the NINA-W102 module firmware — an ESP32 running the Arduino firmware built on ESP-IDF (arduino/nina-fw). A firmware out of sync with the WiFiNINA library is the number one cause of network failures (connect returning 255, server.accept degraded to available, TLS failures). We will look at the official path (IDE 2 Firmware Updater) and the manual path (SerialNINAPassthrough + esptool).
Hardware
- 1 × Arduino MKR WiFi 1010 on a functional micro-USB cable (data)
- Arduino IDE 2.x (includes arduino-fwuploader) or arduino-cli + esptool
- Access rights to the serial port (on Linux: dialout group)
Complete Code
// Etape 1/2 de la voie manuelle : televerser cet exemple (menu
// Fichier > Exemples > WiFiNINA > Utilities > SerialNINAPassthrough),
// ouvrir le moniteur 115200 pour laisser le module en mode boot, puis
// etape 2/2 en ligne de commande :
//
// esptool.py --chip esp32 -b 460800 --before default_reset \
// --after hard_reset --no-stub write_flash --flash_mode dio \
// --flash_size detect --flash_freq 40m 0x10000 NINA102_firmware.bin
//
// Le binaire officiel est livre avec le package board arduino/samd
// (dossier tools/firmware). La voie simple : IDE 2 > Sketch > Se connecter
// a un appareil Arduino WiFi > Firmware Updater.
#include <WiFiNINA.h>
void setup { Serial.begin(115200); Serial1.begin(115200); }
void loop {
while (Serial1.available) Serial.write(Serial1.read);
while (Serial.available) Serial1.write(Serial.read);
}
Expected Verification
After the update, rerun the WiFi Scan sketch: networks should reappear and WiFi.begin should succeed. Check the version consistency between WiFiNINA and the firmware version listed in the nina-fw README. If you are unsure about the module's state, the error message from the first scanNetworks call (often -1 or a total timeout) is the best indicator.
Common Errors
- "Half-flashed" firmware: a USB disconnection during esptool leaves a module that no longer boots; perform a full reflash, ensuring the board is properly powered (the NINA's WiFi draws current spikes, avoid dubious USB hubs).
- Firmware/library desynchronization: a very recent firmware with a very old WiFiNINA (or vice versa) causes obscure failures — keep the two versions paired.
- Hoping to run WiFi + BLE together by reflashing the module with custom firmware: it is possible (the module is an open ESP32, Arduino acknowledges this), but it breaks the module's RF certification — official warning on the product page.
- Confusing the SAMD21 reset with the NINA reset: after flashing, it is the radio module that must restart; a simple USB replug often resolves this.
- Forgetting that the SAMD bootloader (bossac, touch 1200 bauds) is independent: here we are flashing the NINA, not the main MCU.
Other tutorials for this board
Code examples for this board
scan-wifi.inoArduinoconnexion-wpa2.inoArduinohttp-get.inoArduinoserveur-web-led.inoArduinohorloge-ntp.inoArduinoudp-diffusion.inoArduino