at first i suspected it was wrong connections since i came across two different pinouts so i tried to use the pinout in the second image but i got an error, and when i switched back i got the same error. i tried switching com ports but it didnt work.
"C:\Users\anirb\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\anirb\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -patmega2560 -cstk500v1 -PCOM3 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xD8:m -Ulfuse:w:0xFF:m
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\anirb\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM3
Using Programmer : stk500v1
avrdude: ser_open(): can't open device "\\.\COM3": Access is denied.
avrdude done. Thank you.
Failed chip erase: uploading error: exit status 1
Restarting my laptop got rid of the error message, but it was stuck on burning bootloader again. I changed the COM port to 15, but then I got the error which I have already pasted so I changed it back to 3 again and got the error again. So i restarted my laptop yet again and now I am stuck on burning bootloader again.
1. Which Arduino (UNO, NANO, MEGA) you are using as ISP Programmer? 2. What happens when you "Burn Bootloader" into MEGA 2560? to speak another way -- what is the meaning of "Burning Bootloader" into MEGA 2560?