microchip-pic-avr-tools / pymcuprog

a Python utility for programming various Microchip MCU devices using Microchip CMSIS-DAP based debuggers
MIT License
96 stars 22 forks source link

Unable to write to userrow when device is locked #1

Closed mechatroniks-git closed 2 years ago

mechatroniks-git commented 3 years ago

The datasheet claims I can write to userrow when device is locked. I've been unable to using this command:

pymcuprog -U -t uart -u COM8 -d attiny1624 write -m user_row -l 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF

Same issue with this method:

pymcuprog -t uart -u COM8 -d attiny1624 write -f userrow.hex -U
pymcuprog.serialupdi.link - WARNING - Check failed
pymcuprog.serialupdi.application - ERROR - Timeout waiting for device to unlock
pymcuprog.nvm - ERROR - Device is locked.
Error:
Failed to enter NVM programming mode: device is locked
pymcuprog.serialupdi.application - ERROR - Timeout waiting for device to unlock
pymcuprog.nvm - ERROR - Device is locked.
Error:
Failed to enter NVM programming mode: device is locked
Pinging device...
pymcuprog.pymcuprog_main - ERROR - Error with st_ptr
Done.

contents of userrow.hex (which programs OK when not locked)

:02000004008575
:10000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
:10001000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
:00000001FF
xedbg commented 3 years ago

Bug logged (internal) as DSG-2859. (Sorry - I had some issues with notifications...)

xedbg commented 3 years ago

Hi @mechatroniks-git Turns out this was not implemented at all on serialupdi. Implementation is now added, and queued for the next release. In the meantime you can try version 3.9.2.123 on pypi test server. pip install -i https://test.pypi.org/simple/ pymcuprog (Bench-tested with AVR DA only at this point.)

xedbg commented 2 years ago

Now fixed in 3.10.2 https://github.com/microchip-pic-avr-tools/pymcuprog/blob/main/CHANGELOG.md