Atmega2560 Pro Embed fuses corrupted

In reference to my previous thread.
I tried to install the OptiBoot bootloader that uses UART1 instead of 0, since apparently RX0 is fried on the Mega.

During installation, I got a verification error, then the message that the fuses are 0.. and that's it. Board dead.
USBASP and a Nano as ISP both report invalid device signature (all zeros) or simply "Target doesn't answer". The board has a 16 mhz crystal hooked up to the 2560, it seems.

Is there any chance to recover it (I don't have a scope)?

did you messed with the fuses ?

No, I did not. I only uploaded optiboot_flash_atmega2560_UART1_115200_8000000L_B7_BIGBOOT.hex specifically, after that I received a verification error, then the error that the fuses are 0, and since then, the board has been completely unresponsive.

I think you may have bricked the mcu. did you change any of the fuse bits ?

Like I said, not actively.
I uploaded the bootloader without changing any fuse bits.

could you post the avrdude command that you used to burn the bootloader

I used an app called BitBurner that automates it. I successfully burnt the stock bootloader with it before, and also to a Nano, so I'm assuming it uses the correct syntax.

Try using IDE 1.8.13 ,(MegaCore).
Select Board: ATmega2560
Clock: External 16 MHz
Bootloader: Bootloader YES (UART1)
Programmer: USBasp

Burn Bootloader and see what you get.

Make sure the USBasp is hooked up correctly.

The bootloader you were using expects a 8 MHz external clock and you have 16 MHz. Plus 115200 baud @ 8 MHZ would require you to change the boards.txt.

Damn! I hadn't even noticed that. I replaced the crystal with an 8mhz one and boom.. it works. Was able to reflash.
Thank you!

Hm.. weird. It works fine now. However, whenever I upload a sketch, I get a verification error, i.e.

Reading | ################################################## | 100% 0.38s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x00c5
        0x90 != 0x94
avrdude: verification error; content mismatch

BUT.. the code runs fine. What gives?
If I upload the same code via ISP, it gives no verification error, but doesn't run.

Edit: Okay, this is getting really weird. If I use the MegaCore bootloader, my UART0 is working fine, reading and writing and flashing. With the stock bootloader, the UART RX pin is dead. However, flashing anything via serial (i.e. uploading a sketch) always results in the above verification error, regardless of the sketch itself.

Why did you select a bootloader that runs at 8 MHz?

optiboot_flash_atmega2560_UART1_115200_8000000L_B7_BIGBOOT.hex

I assume the 8000000 is for 8 MHz here?

CrossRoads:
Why did you select a bootloader that runs at 8 MHz?

optiboot_flash_atmega2560_UART1_115200_8000000L_B7_BIGBOOT.hex

I assume the 8000000 is for 8 MHz here?

Yeah, I had overlooked that part. Using kprim's suggestion and temporarily wiring in an 8 mhz crystal allowed me to reflash it. The board seems to work flawlessly with that bootloader, except for the verification error.

Flawlessy perhaps, but at 1/2 speed.

No? I reflashed it to 16 Mhz and replaced the crystal again after I was able to flash, of course.

Ok, I didn't see that mentioned.

What do your fuses read and what bootloader are you using?

My fuses using MegaCore and m2560 16MHZ

optiboot_flash_atmega2560_UART0_115200_16000000L_B7_BIGBOOT.hex

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: safemode: lfuse reads as F7
avrdude: safemode: hfuse reads as D6
avrdude: safemode: efuse reads as FD

avrdude: safemode: lfuse reads as F7
avrdude: safemode: hfuse reads as D6
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D6, L:F7)

optiboot_flash_atmega2560_UART0_115200_16000000L_B7_BIGBOOT.hex and the exact same fuses, F7/D6/FD. Also from the MegaCore Board pack.

What really gets me is that the stock bootloader doesn't work with RX0 apparently, while the optibootloader DOES.. anytime I flash the stock BL, I can't flash over serial, and any sketches that accept and write text to serial will output to serial, but not accept any text sent to it. It's fine on UART1, it's fine with optiboot, but not the stock bootloader.
On the other hand, with optiboot I always get the verification error, always the exact same one regardless of the sketch. But the sketch seems to be running fine nonetheless.

What really gets me is that the stock bootloader doesn't work with RX0 apparently, while the optibootloader DOES.. anytime I flash the stock BL, I can't flash over serial, and any sketches that accept and write text to serial will output to serial, but not accept any text sent to it. It's fine on UART1, it's fine with optiboot, but not the stock bootloader.
On the other hand, with optiboot I always get the verification error, always the exact same one regardless of the sketch. But the sketch seems to be running fine nonetheless.

This may be a waste of time, but if you want to try a few more things, I think we can resolve this.

I think you may have loaded the optibootloader with out changing the fuses. Also I just ran into a problem with the older issue avrdude having problems with the Lock bits on m2560 chips and failing to change the fuses, which could cause your problem.

1- BitBurner... What issue of avrdude is it using? Can you make the output more verbose (-vvv)?

2- I notice on the schematic for your board a possible problem using USB to TTL.
the Reset button has a capacitor (C12) wired to ground from the Reset lead. This can cause the DTR lead pulse through a capacitor to shunt to ground and not reset the controller to start the bootloader.
https://robotdyn.com/pub/media/0G-00005641==MEGA-PRO-CH340GATmega2560/DOCS/Schematic==0G-00005641==MEGA-PRO-CH340GATmega2560.pdf

I suggest you use the IDE to burn the bootloader for the normal bootloader and for the MegaCore Optibootloader for your tests.

One other thing, at least on the Mega2560 I am using to test, if using Optibootloader I have to use MegaCore to do sketch uploads using the bootloader (USB to TTL), and use the regular Mega2560 old bootloader using the Arduino Mega or Mega2560. Hope this makes sense.

  1. I am using the Arduino IDE to burn the bootloader (either one), BitBurner was only used for the first attempt that had failed.

  2. The board resets properly when uploading a sketch (I also tried manually resetting for that matter). With the stock bootloader, it fails to communicate. Using a serial test sketch via ISP, I can see that with the stock bootloader, nothing ever gets sent to the Atmega (but it sends over serial), while with Optiboot, it's working perfectly fine in both directions.

I am also using the matching setup (MegaCore or stock) to upload with each bootloader, although I also tested the opposite combinations.

I verified the fuses and they did get set properly for each bootloader.

Wish I could have helped, but I am out of ideas. Good Luck!