Hi -- I'm getting the same problem as @kronimiciad in this post except I'm on linux. I also found this, but not sure that it applies still. @kronimiciad did you ever figure yours out?
Brand new Arduino Nano Every, Kubuntu 22.04, IDE 2.0.2. I'm trying to upload the Files->Examples->Telemetrix4Arduino sketch. I have run the arduino-linux-setup.sh script which was necessary for permissions; rebooted the computer, reconnected the board, etc.
Board shows up, Tools->Get Board Info works, board selection is Arduino Nano Every on /dev/ttyACM0, Tools->Port-> /dev/ttyACM0 (Arduino Nano Every), RX light on the board flashes a little when the upload is attempted, etc.
I get:
Sketch uses 21797 bytes (44%) of program storage space. Maximum is 49152 bytes.
Global variables use 1630 bytes (26%) of dynamic memory, leaving 4514 bytes for local variables. Maximum is 6144 bytes.
And then many of these:
avrdude: jtagmkII_getsync(): sign-on command: status -1
And after a couple of minutes, finally:
avrdude: jtagmkII_getsync(): timeout/error communicating with programmer (status -1)
Failed uploading: uploading error: exit status 1
Further info: at some point in my ignorance and desperation I tried "Upload using programmer" which, having later researched, AFAIK should be irrelevant and useless because the board is only connected via USB, but I mention it just in case.
At some point the main LED on the board stopped flashing, implying something happened to the default sketch? No idea how/why.
I booted into Windows 10 and installed the IDE and the board flashed fine. This is nice, but I do need linux to be working, so if anyone has any ideas, I'm all ears. Thanks!
Thanks -- (I'm assuming you don't need/want the verbose compilation messages):
/home/savel/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-size -A /tmp/arduino-sketch-014E27C2218B86F33F99FEE7D689DAE1/Telemetrix4Arduino.ino.elf
Sketch uses 21797 bytes (44%) of program storage space. Maximum is 49152 bytes.
Global variables use 1630 bytes (26%) of dynamic memory, leaving 4514 bytes for local variables. Maximum is 6144 bytes.
Performing 1200-bps touch reset on serial port /dev/ttyACM0
"/home/savel/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/home/savel/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega4809 -cjtag2updi -P/dev/ttyACM0 -b115200 -e -D "-Uflash:w:/tmp/arduino-sketch-014E27C2218B86F33F99FEE7D689DAE1/Telemetrix4Arduino.ino.hex:i" "-Ufuse2:w:0x01:m" "-Ufuse5:w:0xC9:m" "-Ufuse8:w:0x00:m" {upload.extra_files}
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/savel/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
User configuration file is "/home/savel/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : jtag2updi
Overriding Baud Rate : 115200
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): sign-on command: status -1
...
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): timeout/error communicating with programmer (status -1)
avrdude done. Thank you.
Failed uploading: uploading error: exit status 1
Some interesting developments; tell me if I'm being a beginner idiot here, but if I plug in the Arduino, start up the IDE, open up the Telemetrix4Arduino sketch, and change the serial monitor baud rate to 1200 (from the 9600 it was at), then it works! Sometimes after it works once I can change to other baud rates and it keeps working no matter what rate (e.g. 9600 worked). But after the Arduino is unplugged/plugged it stops again. I haven't tested every possible permutation of steps and rates, but that seems to be the pattern so far.
So that's an easy workaround, but is that on me for not knowing it was necessary? I know that the serial monitor needs to match the baud rate of Serial calls inside sketches, but didn't know that i could impact the uploading of a sketch?
To answer your questions: yes, it seems to show up fine in Linux:
/dev/ttyACM0 (Arduino Nano Every)
...there is also an "Unknown" at /dev/ttyS0 that shows up.
Get Board Info shows
BN: Arduino Nano Every
VID: 0x2341
PID: 0x0058
...which is what shows up in all CLI inspection, logs, etc.
It certainly seems that the Linux implementation is not giving the correct 1200 baud pulse to the SAMD11 chip which is the USB interface and which also functions as the UPDI programmer for the AT4809. The 1200 baud pulse puts it into programming mode.
The verbose report of the programming output indicated that the pulse was given, but it may not be correct.
Do you have a scope and can monitor the dtr line of the usb connection. If you can see the line being toggled before upload with Windows but not with Linux then that would be something definite.
What do you see with IDE version 1.8.19 ? Perhaps this is a 2.0 issue. In that case you can log a bug against 2.0 and it will get attention for sure.
One other thing you can try is to use MegaCoreX instead of the Arduino core. I personally use it instead of the Arduino core with the Nano Every. If it works with your Linux system that would be another clue. MegaCoreX has issues with 2.0 so you'd be better to try it with 1.8.19.
The Arduino Leonardo and Arduino Micro based on the ATmega32U4 also use the 1200 bps touch to enter programming mode. If you have one of those Arduino's you can also see if there is a difference between the Windows and Linux downloads.
Unfortunately, I have no scope. Sometimes I use my audio interface as a poor man's scope... maybe I could tap the dtr line to a voltage divider to bring it to <= 1V into the line in of my interface? Let me know if it's worth the trouble.
1.8.19: same pattern: doesn't work, change monitor to 1200, works. I'll report it to the link you posted, thanks.
MegaCoreX -- I have only a loose grasp of what this is about; if I follow the instructions here do I then just proceed as before? No chance of bricking my device or not being able to go back to 'normal', right?
Yes, you can follow the Boards Manager Download procedure.
MegaCoreX is just an alternative to the megaavr Core. In my opinion is has better features and is better maintained.
There should be no risk to your Nano Every. I use both MegaCoreX and megaavr core with mine. I can switch back and forth with the board selection in Tools with no issue.
Same behavior with IDE 1.8.19 and MegaCoreX. Although one difference is that 1.8.19 remembers the last baud rate (2.0.2 reverts to 9600 every time). If I just open the serial monitor window, but don't change baud, that's enough to "fix" it and make it work.
Edit: does this mean it's not the core, but the IDE itself? Should I have filed that bug elsewhere?
They replied: "we found this problem some time ago and it looks like a regression in the linux kernel; basically the "set 1200bps" message and the "open port" were well separated (some milliseconds) while in recent kernels (but not on all distributions) the second is being sent immediately after the first, creating some confusion in the D11 firmware.
Setting the port at 1200bps separately gives the fw some time to properly set its internal state.
We definitely need to allocate some time to fix the issue mainline (or simply add a quirk for the Nano every) beacuse updating the D11 firmware is not viable for most of the users."
So that's great -- and even if they don't get to it soon, the workaround is easy. Thanks for the help on this.
Indeed the 1200 bps touch is a complicated area. It appears to be part of the IDE, although I'm not certain exactly where, and there is discussion about making it part of avrdude.
That information mentions the specific traditional application where the "1200 bps touch" is used to trigger bootloader activation on the target MCU. Nano Every is unique in that the "1200 bps touch" is used to signal the "MuxTO" ATSAMD11 programmer chip on the board, which handles the flashing to the ATmega4809.