Closed MCUdude closed 2 years ago
Strange. I've got a Curiosity Nano board with an AVR128DA48, and much to my surprise, even single-bytre writes in terminal mode do work there (for paged memory devices, they are usually the most critical part). File updates (-U ee:w:…
) do work as well.
No idea about voltage adjustmentst – do you have any documentation for them? (As I don't see any adjustable voltage regulator on the board, I have some doubts it is possible.)
Strange. I've got a Curiosity Nano board with an AVR128DA48, and much to my surprise, even single-bytre writes in terminal mode do work there (for paged memory devices, they are usually the most critical part). File updates (-U ee:w:…) do work as well.
My curiosity nano is quite old. I bought it in 2018 I think. It may be firmware related perhaps? I'll see if I can have the firmware upgraded.
No idea about voltage adjustmentst – do you have any documentation for them? (As I don't see any adjustable voltage regulator on the board, I have some doubts it is possible.)
It does have a voltage regulator, have a look in the schematics. It can be adjusted using Atmel Studio or pymcuprog.
Pymcuprog is open source, so the implementation could be borrowed from there i think.
Yes, I can see the voltage regulator.
Would be cool if Microchip documented their protocols, like Atmel did before.
I can confirm the crashes for pgm
and spi
commands; they should probably just be disabled for UPDI programmers.
So I have another, newer Curiosity Nano board, one with an ATtiny3217 attached.
This is able to write to the EEPROM:
$ ./avrdude -C avrdude.conf -v -pattiny3217 -cpkobn_updi -t
avrdude: Version 6.99-20211218
Copyright (c) Brian Dean, http://www.bdmicro.com/
Copyright (c) Joerg Wunsch
System wide configuration file is "avrdude.conf"
User configuration file is "/Users/hans/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : pkobn_updi
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
AVR Part : ATtiny3217
Chip Erase delay : 0 us
PAGEL : P00
BS2 : P00
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 0
StabDelay : 0
CmdexeDelay : 0
SyncLoops : 0
ByteDelay : 0
PollIndex : 0
PollValue : 0x00
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00
prodsig 0 0 0 0 no 61 61 0 0 0 0x00 0x00
fuses 0 0 0 0 no 9 10 0 0 0 0x00 0x00
fuse0 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse1 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse2 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse4 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse5 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse6 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse7 0 0 0 0 no 1 1 0 0 0 0x00 0x00
fuse8 0 0 0 0 no 1 1 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 1 0 0 0 0x00 0x00
data 0 0 0 0 no 0 1 0 0 0 0x00 0x00
usersig 0 0 0 0 no 32 32 0 0 0 0x00 0x00
flash 0 0 0 0 no 32768 128 0 0 0 0x00 0x00
eeprom 0 0 0 0 no 256 64 0 0 0 0x00 0x00
Programmer Type : JTAGICE3_UPDI
Description : Curiosity nano (nEDBG) in UPDI mode
ICE hardware version: 0
ICE firmware version: 1.21 (rel. 37)
Serial number : MCHP3333021800001022
Vtarget : 3.31 V
JTAG clock megaAVR/program: 0 kHz
JTAG clock megaAVR/debug: 0 kHz
JTAG clock Xmega: 0 kHz
PDI clock Xmega : 100 kHz
avrdude: Partial Family_ID returned: "tiny"
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.08s
avrdude: Device signature = 0x1e9522 (probably t3217)
avrdude> write eeprom 0 1 2 3 4
>>> write eeprom 0 1 2 3 4
avrdude> dump eeprom 0 4
>>> dump eeprom 0 4
0000 01 02 03 04 |.... |
For reference, here is the information about the nEDBG chip found on my 4809 Curiosity Nano:
Programmer Type : JTAGICE3_UPDI
Description : Curiosity nano (nEDBG) in UPDI mode
ICE hardware version: 255
ICE firmware version: 1.02 (rel. 262)
Serial number : ATML3094051800001520
Vtarget : 3.30 V
JTAG clock megaAVR/program: 0 kHz
JTAG clock megaAVR/debug: 0 kHz
JTAG clock Xmega: 0 kHz
PDI clock Xmega : 750 kHz
OK, these spi
and pgm
commands are only meaningful on bitbang programmers.
I disabled these for all programmers that do not implement a setpin
method.
Thus, the only remaining issue here is the lack of voltage regulator support, so I'm moving this from "bug" to "enhancement".
I happened to be in contact with someone that knows these undocumented protocols much better than I do. Here's his response regarding the protocols not being documented and the target voltage setting:
Unfortunately the docs are far from up to date. Setting the supply voltage is done (just like powerdebugger): https://github.com/microchip-pic-avr-tools/pymcuprog/blob/main/pymcuprog/utils.py#L117
I was just experimenting with my ATmega4809 Curiosity Nano in terminal mode when I discovered a few issues. I'm building my Avrdude binary from the upstream source code, and I'm using MacOS. I start the session with the following command:
eeprom
First, I'm having issues writing to EEPROM. It seems like I can't write, but reading works.
(It turns out that I can't write hex files to the eeprom either.)
pgm
When sending a PGM command, I get a segmentation fault and Avrdude crashes:
spi
When sending an SPI command, I get a segmentation fault and Avrdude crashes:
vtarg
Even though the Curiosiy Nano supports voltage adjustments, I'm not able to set the operating voltage: