I try to program the following atmel devices in my projects: ATMega32, ATMega328P, AtTiny85 and Attiny 4313.
I setup a test project for each of them in platformio with a supersimple program to just alter some io pins. My platformio.ini file for all of them looks like this:
[env:atmel]
platform = atmelavr
board = different for each device of course
framework = arduino
upload_protocol = atmelice_isp
upload_flags =
-e
upload_port = usb
I attach my atmel Ice to the devices and try program them via platformio/avrdude. It works for ATMega32 and ATMega328P. It does NOT work for Attiny85 and Attiny 4313 with the following error:
avrdude: jtag3_open_common(): Did not find any device matching VID 0x03eb and PID list: 0x2141
I then tried to program all four chips via the Atmel Studio. Exactly the same hardware setup. I works without any trouble
Checking the atmel ICE in the device manager of windows tells me that VID and PID are exactly as they need to be.
In a post in this forum I found the following line for PlatformIO Core CLI:
C:\Users\<myuser>\.platformio\packages\tool-avrdude\avrdude -v -C "C:\Users\<myuser>\.platformio\packages\tool-avrdude\avrdude.conf" -c atmelice_isp -p t4313
Having the 4313 attached to my atmel ICE prints the following output:
avrdude: Version 7.1-arduino.1
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is C:\Users\volke\.platformio\packages\tool-avrdude\avrdude.conf
Using Port : usb
Using Programmer : atmelice_isp
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
AVR Part : ATtiny4313
Chip Erase delay : 9000 us
PAGEL : PD4
BS2 : PD6
RESET disposition : possible i/o
RETRY pulse : SCK
Serial program mode : yes
Parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 6 4 0 no 256 4 0 4000 4500 0xff 0xff
flash 65 6 32 0 yes 4096 64 64 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 1 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 1 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 1 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 1 0 9000 9000 0x00 0x00
signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00
calibration 0 0 0 0 no 2 1 0 0 0 0x00 0x00
Programmer Type : JTAG3_ISP
Description : Atmel-ICE (ARM/AVR) in ISP mode
ICE HW version : 0
ICE FW version : 1.42 (rel. 161)
Serial number : J41800041661
SCK period : 8.00 us
Vtarget : 4.94 V
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e920d (probably t4313)
avrdude done. Thank you.
I could really need some help here.