arduino / arduino/ArduinoCore-megaavr

Nano Every on linux: "avrdude: jtagmkII_getsync(): sign-on command: status -1" when uploading sketches

Open
#124 17 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
111
Forks
65
PR merge metrics
No merged PRs in 30d

Description

Hello -- with IDE 2.0.2 or 1.8.19 running on Kubuntu Linux 22.04 I am unable to upload sketches to the Nano Every.

It gives many errors like this:

`avrdude: jtagmkII_getsync(): sign-on command: status -1`

...eventually followed by:
```avrdude: jtagmkII_getsync(): timeout/error communicating with programmer (status -1)
Failed uploading: uploading error: exit status 1
```

The same sketch/board/USB cable/USB port combination works fine in Windows 10 on IDE 2.0.2.

**I have found, in Linux, that if I change the Serial monitor to 1200 baud (from the default of 9600), and then upload the sketch, it works.** After that I can upload the sketch at any baud rate, including 9600 baud, until the board is power cycled.

I was told this was the place to report this issue. Let me know if I can provide any other information.

Verbose console output, in case it's useful:

```
/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
```

I also tried with MegaCoreX on IDE 1.8.19. Same behavior -- 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 (already at 1200), but don't change baud, that's enough to "fix" it and make it work.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the verbose avrdude upload output for the Nano Every on Kubuntu and the serial monitor's 1200-bps touch reset behavior. Reproduce the failure at the default 9600 baud and confirm that uploads work after the 1200-baud workaround; done means normal Linux uploads succeed without opening or changing the serial monitor.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.