Foreword: I opened a new forum topic although this problem has been brought up in the forum several times already. However, those threads are already closed (mainly due to age, not due to being solved), so I could not attach my solution there.
After a while it was all of a sudden NOT possible anymore to upload a sketch from Arduino IDE to some Arduino Nano Every.
At the bottom of these instructions you will find condensed step-by-step instructions. In between I took the freedom to add a little bit more of information that helped me to understand the problem and come to the solution. If there is something wrong, let me know, since I am not an Arduino or programming expert.
- The Arduino Nano Every could still be connected to a computer's USB port and is somewhat recognized, i.e., assigned a COM port (under Windows at least). If no COM Port at all is assigned, the suggested soultion steps belo will probably not work.
- In the Arduino IDE, under menu Tools -> Ports "COM##" (## = digits 0.9) is displayed. If Arduino Nano Every would have been fully recognized, "COM## (Arduino Nano Every)" would be displayed.
- The Arduino Nano Every seems to be executing the formerly uploaded sketch. Bad thing is though, that updating of that sketch w/ newer version is not possible anymore.
- Serial communication to Arduino IDE does NOT work (e.g., nothing displyed in Arduino IDE's Serial Monitor)
- Only in case serial communication is involved in the sketch: There also seemed to be a problem w/ serial data gathered in the formerly uploaded sketch and sent to a connected SD card shield. Only very few of the serial data arrived at the SD card shield. If this is really linked to the problem mentioned above, I am not sure. It's just an observation I made.
- Upload of Sketches to other boards (e.g., Uno, Nano, also other Nano Every !) still works fine. so its definitely a problem of a specific Arduino Nano Every Board)
Cause for the described problem is very likely a problem w/ the SAMD11 firmware. (The real root cause, i.e., why all of a sudden the firmware doesn't work anymore as before, I canot tell. I observed this problem w/ 2 different Arduino Nano Every after each of them was operating 24/7 for about 6 to 9 months in my project (https://create.arduino.cc/projecthub/torstengeppert/logging-2-electricity-smart-meters-using-arduino-nano-every-99f934?ref=search&ref_id=eHZ&offset=0).
A special thing about Arduino Nano Every seems to be, that it does NOT use a bootloader like Arduino Uno or the Arduino Nano to upload sketches. Upload of sketches from Arduino IDE to Arduino Nano Every's ATMeag4809 is handled by the SAMD11 chip. I found the following graphic depicting that here (https://www.avrfreaks.net/forum/closed-successhow-burn-firmware-nano-every-bare-pcba-board):
The solution is in principle really simple - as always - if you know it: Simply flash the correct firmware to SAMD11 !
Trying to do this then turned out rather time consuming. There are many instructions and videos around in the www for the Arduino Uno and Arduino Nano and alike (remember: they all use bootloaders), but not for the Arduino Nano Every.
Follow (some of the) instructions posted here: [Serial interface locks up on Nano Every · Issue #51 · arduino/ArduinoCore-megaavr · GitHub]). That thread contains much more information than actually needed to simply update the SAMD11's firmware. So I tried to extract the relevant stuff, see below.
Condensed step-by-step solution
Step 1: Download the firmware MuxTO.bin for the SAMD11 used in Arduino Nano Every and bossac executable (Attention: different bossac files for Windows and MAC) and unzip to a folder.
- Windows: https://www.mattairtech.com/software/arduino/bossac-1.7.0-mattairtech-2-mingw32-64.zip. This zip file only contains the bossac exe for Windows. The firmware MuxTO.bin for the SAMD11 you have to extract from the link below provided for MAC.
- MAC: Update muxto bootloader to 1.0.6 · arduino/ArduinoCore-megaavr@ee0a9bd · GitHub. On this page click on the link https://github.com/arduino/Arduino/files/3461449/update_muxto.zip
Step 2: To bring SAMD11 into programmable mode, connect GND pin of Arduino Nano Every to SWDIO pad of Arduino Nano Every's J2 pads ("lower left pad"; view from bottom side of Arduino Nano Every) during connecting the Arduino Nano Every via USB cable to your computer. After having established USB connection this GND<->SWDIO connection is no longer needed, i.e., can be removed (I just used connected jumper wires as shown below).
- Ad J2:
- location can be found in the datasheet downloadable here (page 5): https://docs.arduino.cc/hardware/nano-every
- consists of 6 pads. Description see pictures below (from https://forum.arduino.cc/t/how-to-burn-bootloader-on-the-nano-every-board/865169/2
- Ad J2:
Step 3: Open Windows command line, navigate to the folder to where you unzipped the firmware MuxTO.bin and bossac files (they have to be in the same folder) and enter command (the lazy/smart ones among us might simply copy&paste): (Replace $portname by COM10 or whatever COM port is assigned by Windows after plugging your bricked Arduino Nano Every to your Windows computer's USB port):
./bossac --port=$portname -U true -i -e -w -v MuxTO.bin -R
Writing of the firmware to SAMD11 took about 1-2 minutes. Finally command line showed the following output:
Atmel SMART device 0x10030000 found
Device : ATSAMD11D14AM
Chip ID : 10030000
Version : v2.0 May 29 2019 12:13:04
Address : 4096
Pages : 192
Page Size : 64 bytes
Total Size : 12KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
done in 2.225 seconds
Write 12220 bytes to flash (191 pages)
[==============================] 100% (191/191 pages)
done in 29.804 seconds
Verify 12220 bytes of flash
[==============================] 100% (191/191 pages)
done in 0.203 seconds
- Step 4: Disconnect Arduino Nano Every from your computer and then reconnect Arduino Nano Every to your computer. Now the Arduino Nano Every should be recognized by your computer and the IDE as before. Uploading of sketches is possible again !
As mentioned before, I am neither an Arduino nerd nor programming or microcontroller expert. This is just the solution that worked for me. In case you encounter problems or use other operating systems like MAC OS or Linux I probably am not much of a help. You might find hints in the links I included above that showed me the path to the described solution.
Good luck and hopefully success !
BTW: Windows 10, Arduino IDE 1.8.13, 1.8.19, also older ones