Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using chip erase #39

Open
strawberryhacker opened this issue Aug 6, 2023 · 1 comment
Open

Error using chip erase #39

strawberryhacker opened this issue Aug 6, 2023 · 1 comment

Comments

@strawberryhacker
Copy link

By setting fuses, I have enabled CRC scan of boot section during boot. The CRC scan fails.

Then, I perform chip erase by running:

sudo pymcuprog erase -i updi -d avr64ea48

That does not work, and produces following output:

pyedbglib.protocols.jtagice3protocol - ERROR - JTAGICE3 error response code 0x43: 'AVR8_FAILURE_CRC_FAILURE: CRC error' 
pymcuprog.nvm - WARNING - AVR8_FAILURE_CRC_FAILURE: CRC error
pymcuprog.pymcuprog - ERROR - Operation failed with Jtagice3ResponseError: AVR8_FAILURE_CRC_FAILURE: CRC error

The chip erase works when using Microchip Studio: Device Programming -> Memories -> Device -> Erase Now. I assume chip erase should work the same way in pymcuprog.

@strawberryhacker strawberryhacker changed the title Chip erase fails Error using chip erase Aug 6, 2023
@xedbg
Copy link
Contributor

xedbg commented Aug 8, 2023

Hi @strawberryhacker
Yes, this is a bit of a tricky one for pymcuprog... the catch here is that Studio actually automatically and secretly resets the fuse value after an erase (fuses are untouched through an erase), and we did not want to build in this knowledge to pymcuprog.
A possible workaround is to write the corrected fuse value using pymcuprog, and use the chip-erase-locked-device switch to get in. This will perform a UPDI-key-based erase, and immediately write the fuse.
for example on my tiny1627:
pymcuprog write -m fuses -o 5 -l 0xC7 --chip-erase-locked-device
will do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants