Arduino Nano Every: upload of sketch suddenly not possible anymore

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.

Problem
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.

Further observations

  • 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
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):
grafik

Solution
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

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
Erase flash
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)
Verify successful
done in 0.203 seconds
CPU reset.

  • 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 !

Closing remarks

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

1 Like

Perhaps the comm port is hosed up. You might see this thread until a real Arduino head answers.

Something similar happened to me. The uploaded sketch was interfering with further upload so I played with reset button until it worked.

Thanks so much for taking the time to share this information @Torschtele!


Regarding the comments, The situation is different depending on whether the board you are using has native USB capabilities (e.g., Leonardo, Micro, MKR, Nano 33 IoT), or a dedicated USB interface chip (e.g., Nano Every, Uno, Mega).

The sketch can interfere or break USB on the boards using native USB because the sketch program is running on the same chip as the USB stack.

The sketch can not break USB on the boards with a dedicated USB chip because the sketch program is running on a separate chip. I am also not aware of any way the sketch can interfere on those boards. The only example of a sketch breaking uploads on such a chip is related to a bug in the handling of the watchdog timer resets by the bootloader used on some of the older Arduino boards.

So reset techniques are helpful with the native USB boards, but likely not for boards like the Nano Every.

Regarding the comment about comments. Using Serial.print on Nano Every can absolutely interfere with further upload. Thanks for reading.

Can you provide instructions I can follow to reproduce the issue?

Just in case someone is curious, the above question was not directed at me specifically. Thanks for reading.

It is complicated. The reset on Every is done by 1200 baud touch as for boards with native USB and the newer fw for SAMD11 added reset on new USB connection too. I have the new one uploaded in 2019 with the same procedure OP described.

I know that I have to first open the Serial Monitor after power up and only then upload (in Sloeber (maybe it matters)). If I start with upload, after that I don't get the Serial output until I upload again.

And many times the Every doesn't accept the upload until I reconnect it or wait some minutes.

1 Like

It was directed at you specifically. I should have quoted to make that clear.

Interesting. I have never encountered a problem with uploads on the Every related to the use of Serial and don't recall seeing previous reports of it. I don't use that board extensively, but I do use it periodically. I'll keep it in mind.

I’m confused at step 3. Can you explain it more detailed please? I’m not that experienced using windows command prompt.

Hi!
Just leftclick w/ your mouse on the Windows Icon (the four rounded squares in one end oh your Windows toolbar) and start typing "cmd". Or enter "cmd" in the Cortana search field. Then Windows will show you results matching the "cmd" search pattern. From those doble click on the one that looks like good old black DOS command line (aka Command prompt).
There should be plenty of videos in the www showing thus step by step...
Does that answer your question?
Cheers

Hello! I knew how to open command prompt, but I didn’t get what you did with the firmware and how to type in the command. I copy + pasted the command into command prompt, pressed enter, and nothing happened.

Ok, I opened the folder through windows terminal and put in the command changing the COM port. However, I did not get the last bit that you got when you executed the command. Here's what I got:

PS C:\Users(my name)\Downloads\bossac-1.7.0-mattairtech-2-mingw32-64\bossac-1.7.0-mattairtech-2-mingw32-64> ./bossac --port=COM5 -U true -i -e -w -v MuxTO.bin -R
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
Erase flash
done in 2.233 seconds

No such file or directory
PS C:\Users(my name)\Downloads\bossac-1.7.0-mattairtech-2-mingw32-64\bossac-1.7.0-mattairtech-2-mingw32-64>

I still have an unrecognized COM port. Do you have any ideas why it says "No such file or directory?"

Do you have the file MuxTO.bin in this folder?:

C:\Users(my name)\Downloads\bossac-1.7.0-mattairtech-2-mingw32-64\bossac-1.7.0-mattairtech-2-mingw32-64

I don't actually, I have the "bossac" and "bossac64" files only

can you please send me that file if you can somehow?

Here it is:
https://github.com/arduino/ArduinoCore-megaavr/raw/master/firmwares/MuxTO/MuxTO.bin

Thank you! I just found it on the github and it worked.

You are welcome. I'm glad to hear it is working now.

@helparduinonerd: Thanks for your questions. Showed me that the description was not good enough. I used your input and edited the solution description. Hope its better now.

@in0: Thanks for helpin @helparduinonerd out. I was not able to do so during the last days.

1 Like