Hi,
I am trying to get JTAG to work with a Leonardo (ATmega32U4), but I am having problem understand what settings I need to set in platformio.ini,
Maybe someone out there knows what to set?
My setup:
Have a SEGGER JTAG+SWD programmer connect to PC with USB.
Device Manager says: Jlink CDC UART Port (COM3) (standard driver, see below)
The Leonardo pins 36-39, Reset, GND are connect to the SEGGER J-Link programmer pins according to the JTAG Interface/Wiring Connections on this page:
https://docs.platformio.org/en/latest/plus/debug-tools/jlink.html
I am powering the Leonardo with USB power as the JTAG adapter only give 3.3v and the board like 5v.
(The programmer works with another board and SWD in platformio.
The board works to update using USB Arduino Leonardo COM18.)
Leonardo JTAG env. settings in platformio.ini:
[env:leonardo]
platform = atmelavr
board = leonardo
framework = arduino
– log
Configuring upload protocol...
AVAILABLE: avr109
CURRENT: upload_protocol = avr109
Looking for upload port...
Auto-detected: COM3
Forcing reset using 1200bps open/close on port COM3
Waiting for the new upload port...
Uploading .pio\build\leonardo\firmware.hex
Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "F"; type = @
Software Version = !.w; Hardware Version = “.ð
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader
--
Tested changing USB driver using Zadig 2.5.
So, instead of having a COM3, I have a device under USB controller called J-Link driver.
– log
Configuring upload protocol...
AVAILABLE: avr109
CURRENT: upload_protocol = avr109
Looking for upload port...
Error: Please specify `upload_port` for environment or use global `--upload-port` option.
For some development platforms it can be a USB flash drive (i.e. /media/<user>/<device name>)
*** [upload] Explicit exit, status 1
--
Tested different combination of following settings:
debug_tool = jlink
upload_protocol = jlink-jtag
but get same error.
Don’t know how or what --upload-port I should specify.
So I guess I should stick with Windows default drivers?
Any suggestion what I can try?
Cheers
-Anders