Replies: 10 comments 13 replies
-
Hm, well that's interesting. SerialUPDI doesn't offer a way to - it's not even clear to me how you do it. Probably by writefuse command command against address 0x0A? It's never explicitly stated (they seem allergic to documenting anything related to the lockbits, as if it will blow open their security to tell people how to use it (hopefully not...), ie, at an offset of 10 from the start of the fuses... but it's entirely possible that SerialUPDI will reject an attempt to write to fuse10, since it knows there are only 10 fuses, and that the 11th fuse isn't a valid fuse.I've never tried to set the lockbits. I imagine it could be done with avrdude and a updi programmer without any complications. C5 = unlocked, any other value = locked, and they set it to 0x3A to lock it, (values are 0b11000101 and 0b00111010 respectively. The Dx-series made it 4 bytes long - every nybble of the unlocked value a 5 or a C. I suspect that there is some deep reason that those numbers are harder to glitch the chip into reading from the lockbits than a randomly chosen value. (supposedly that's how places usually break into locked chips - they play with the voltage (and clock if they can), trying to make it glitch in just the right way - hence why it's more secure to require it read values other than all 1's or all zeros. |
Beta Was this translation helpful? Give feedback.
-
Here's how I do it, the only method I found at the time at worked, was pymucprog, adjust your COM port and attiny to attiny3227
to chip erase, when locked
To confirm it's locked, use this to read the userrow, which should work when unlocked, but spit errors when locked.
|
Beta Was this translation helpful? Give feedback.
-
Thanks Spence an mechatroniks-git. I will give it a try. First I need to swap the programmer, I still use jtag2updi. |
Beta Was this translation helpful? Give feedback.
-
Looking into locking the 3217 , indeed, there is no explicit instructions how to tackle this, or is it? Best
|
Beta Was this translation helpful? Give feedback.
-
I am using Avrdudess to lock and unlock these tinies. Connecting a CH340 with diode serial adapter to the UPDI pin and despite it tells me that the MCU is not supported I can chenge the lockbits from 0x5C to something else, to lock the device. After that change I can't read the contents. To unlock it again, set the lockbit to 0xC5 and tick "Erase flash and EEPROM" and the Force (-F) flag. programming and locking in one go is also possible. Just select the hexfile you want to program, change the lockbit to e.g. 0xC4 and press "Program!" |
Beta Was this translation helpful? Give feedback.
-
Did you give it a try? https://blog.zakkemble.net/avrdudess-a-gui-for-avrdude/ Linux & macOS
|
Beta Was this translation helpful? Give feedback.
-
And for unlocking / erasing You will need a relatively new version (7.0) of Avrdude |
Beta Was this translation helpful? Give feedback.
-
add -e And if you want to set the lockbit back at 0xC5 add -U lock:w:0xC5:m |
Beta Was this translation helpful? Give feedback.
-
-v Both are not really important Does this work?
(i added 4 x -v, then you get verbosity output level 4, which is a LOT of feedback about the whole operation. |
Beta Was this translation helpful? Give feedback.
-
I am using a 2 dollar CH340G usb to serial adapter with a signal diode between RX and TX.. It has no problem programming at Turbo speed and I can lock unlock at will. So I suspect it has something to do with the programmer you are using. |
Beta Was this translation helpful? Give feedback.
-
Hi,
how I can set the lock bits on ATiny3227 devices to protect the device for read out?
On old ATinys it was very ease to do with AVR Studio, but I have no idea how to set them with updi.
Thanks!
Uwne
Beta Was this translation helpful? Give feedback.
All reactions