Electronics > Microcontrollers

How Can Your Disable the Debug Fuse In an AVR Microcontroller After Enabling it?

(1/2) > >>

Kalcifer:
I enabled the debugWire fuse (DWEN) in an ATtiny84A so that I could debug it using avarice and avr-gdb; however, now that I have the DWEN fuse set, I'm not sure how to then reset it. Enabling the DWEN fuse changes the RESET pin's functionality, so the ISP programming method to change the fuse initially, no longer works. Is there a way to change a fuse byte while in debug mode, or have I essentially bricked the MCU? There must be some way to change it back as Atmel Studio is able to debug the chip no problem. From what I understand, when you enter debug mode in Atmel Studio, it automatically sets the DWEN fuse, and then clears it after the debug session has completed. It could be possible that Atmel Studio is doing some proprietary trickery, but there must be some way to get around this.

technix:
If you are using Atmel Studio, it enables and disables DWEN following the debug session starting and terminating. You need to enter and leave debug mode once, including using a dummy project if you don't mind wiping the existing program, to disable DWEN.

Or if you have a high voltage programmer, that would work too.

Kalcifer:

--- Quote from: technix on May 13, 2021, 02:13:09 am ---If you are using Atmel Studio, it enables and disables DWEN following the debug session starting and terminating. You need to enter and leave debug mode once, including using a dummy project if you don't mind wiping the existing program, to disable DWEN.

--- End quote ---
Is there no way to imitate this behaviour outside of Atemel Studio?

EDIT: I just now realized that terminating a debug session with avr-gdb also automatically resets the DWEN fuse. Problem solved! MCU no longer a tiny paperweight!

Kalcifer:
Strangely enough, however, I seem to be unable to go back into debug mode now. I can change the fuse that enables or disables DWEN in both Atmel Studio, and avrdude, but it does not enable debugWire. What should immediately happen is that when I set DWEN, I should loose all ISP functionality, but everything is working fine, and on top of that, I cannot connect to it as a debug target. Could manually programming the fuse break it in some way...? That doesn't really make any sense to me.

technix:

--- Quote from: Kalcifer on May 13, 2021, 05:50:40 am ---Strangely enough, however, I seem to be unable to go back into debug mode now. I can change the fuse that enables or disables DWEN in both Atmel Studio, and avrdude, but it does not enable debugWire. What should immediately happen is that when I set DWEN, I should loose all ISP functionality, but everything is working fine, and on top of that, I cannot connect to it as a debug target. Could manually programming the fuse break it in some way...? That doesn't really make any sense to me.

--- End quote ---
I'd say you may want to perform a full erase on it, maybe using a high voltage programmer now. That would reset a lot o things to default, and if after that you are still getting problems, you would likely have used up all the write cycles.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version