Burn bootloader to Arduino Mega 2560

I have an arduino mega 2560, in the last couple of weeks I messed with the driver IC (Atmega16u2) to turn it into a MIDI, turns out corrupted the driver somehow. Since then I used an arduino uno as ISP to upload my sketch to arduino mega. So just by today I finally found out how to restore the Atmega16u2 driver and now when I plug in my arduino mega, it finally appears in the ports.

And there is another problem. Turns out I can't upload my sketches to arduino mega even though the device appears in the ports. I thought it might be the bootloader. So I followed some instructions I found. And since I got an Arduino Uno this is the instructions I got.

  1. Upload the Arduino as ISP sketch to arduino uno.
  2. Connect Uno to Mega using SPI connection:-
    Uno:Mega
    10:RESET
    11:51
    12:50
    13:52
    5V:5V
    GND:GND
  3. Select Arduino Mega 2560 as board
  4. Select Arduino as ISP as programmer.
  5. Burn Bootloader.

And I did exactly that and then it says the bootloader has been burnt into the arduino mega. Then I found that the L led blinks in an interval of less than a second. I already had a feeling that something didn't go well. When I plug my Mega to the computer and try uploading a sketch, turns out, it still didn't work.

Anyone got any idea what's happening? Thank you in advance if anyone is reading this.

Did you change the driver? Or did you mean “firmware” instead of “driver”?

If so, which firmware did you upload to the ‘16U2? IIRC, it should be this one: ArduinoCore-avr/firmwares/atmegaxxu2/Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex at master · arduino/ArduinoCore-avr · GitHub

This is normal behavior for a fresh bootloader, when you burn the bootloader, it also replaces the main sketch with a blink sketch.

What error messages are you getting?

First I updated the firmware from device manager manually, file location was pointed to Atmel/Atmel Drivers, then it became Atmega16U2,
Appears under a hierarchy named Atmel Driver in the device manager.
Then I used Atmel Flip to upload the Arduino Mega2560 firmware. The Arduino Mega hex file was from Arduino folder itself, named "Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex" under
Arduino/avr/firmwares/atmegaxxu2/arduino-serial.

When I upload a sketch (after burning bootloader), the "Uploading" progress bar took a very long time. An error then shows up, it just says "An error occured while uploading sketch", it doesn't show any details.