I have a problem with a Mega that just slowly refused to play ball. Having used (tried) the Arduino 1.8.xxx IDE, the new 2.xx.xx IDE and also PlatformIO in VSC (excuse my French!) I now have a board that just wont load anything.
I have gone back to the 1.8.xx IDE to keep things simpler. First symptoms were that simple Bool comparisons just didn't work and slowly I could'nt update the board. After much effort to write a novel by jumping on the keyboard, I can at last see Arduino Mega 2560 in DM, but for a long time I also simultaneously saw an entry for Atmega 16Ux too. I have failed many times with "Flip" and also tried various other ideas that included hooking up to an Arduino to quiz and update the bootloader, but always without immediate success. So I now have this entry which is almost correct - but it has a yellow triangle. I tried updating it to no avail. I thought it was time to get in touch here, because it is real pogress to see the Mega mentioned in DM, but it could easily disapear again if I fiddle ad hoc.
Any troubleshooting steps from here would be gratefull received.
N.B. The most frequent hint that I've seen from error reports after trying to get this to work is a complaint about address 0x0000, and oh, my dear old Uno with the CH340 continues to connect faultlessly. My port numberings are also very confused - devices apparantly on the same port at times (not fully functioning devices I hasten to add).
The board is probably bad, throw it away and move on.
There are many tests that you can do, but in the end the board is probably bad.
Measure the 5V pin, it should be above 4.5V.
Let the board run for example for 5 minutes. Check with your finger if something gets warm.
There seems to be a problem with the device driver or the usb-serial chip. The usb-serial chip has firmware that you can burn into it. Clones have a CH340G usb-serial chip and those can be broken. For the newest device driver, just install the Arduino IDE 1.8.19 from here: https://www.arduino.cc/en/software I suppose you have already done that.
Did you use motors or 12V with that board, then there is a good chance that it is broken.
The chips on a Arduino board can be damaged for just a small part. The board might work now and then a little, but that does not mean that nothing is damaged.
I haven't connected anything power hungry to the board and in fact I was using it only for the third day, even though I've had it for a few years. I have a feeling that maybe the new Arduino IDE was a bit trying for it - the Build progress wheel was constantly running - even when I was writing the code.
I think it's best to plot my position now, as I sincerely hope that this board is just down, and not out:
I have just installed the latest old-style Arduino IDE. It now populates Device Manager with "Genuino Mega 2560" and it does not have a triangle. I still have the previous Mega listed and still with a yellow triangle. However, the new IDE (1.8.19) still wont connect to it. I can at least select a port, although I have no idea how the ports are organised, especially given that I can freely assign a new number to any port of my choosing - even if that number is already listed against another device! So, to quote the IDE, some of the feedback is:
avrdude: AVR device initialized and ready to accept instructions
An error occurred while uploading the sketch
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x14 != 0x0c
avrdude: verification error; content mismatch
avrdude done. Thank you.
It seems to me that I'm very close to making contact, but having tried so many things, including Nick Gammons advice for quizing the board, that I just don't want to bounce up and down on the keyboard anymore. Incedentally, I couldn't get Nick's code to connect - it just kept timing out and Flip all too frequently (several attempts) finished up reporting that vailidation failed at address 0x00000.
Edit: The board doesn't seem to be getting hot. Also; the Device Driver dialogue says "Device USB\VID_2341&PID_0242\5543733343735121C062 was not migrated due to partial or ambiguous match."
I tried to explain that if the boards works "almost", it still might be a bad board. If you can make it work, that would be very nice, but perhaps that is not possible.
There seems to be a driver conflict. Can you try it on a other computer ? Just install *.exe of the Arduino IDE 1.8.19. Or try it on linux
[Toupee]
Build process can take a couple of minutes. I'd avoid writing or editing when it is not finished. Does the serial monitor work? By the way IDE version does not matter, if you think there is a problem, just remove the old version and install a new.
Is USB working in your computer.
But, in the end, you probably need a new board. It is the easiest way to fix problems
[/Toupee] Don't worry. Your hair will grow back when your Arduino is working.
Thanks pierrehammitt, it looks like I've pulled back from the brink...
referencing this thread "Burn new bootloader in Arduino Mega 2560 R3", and now that my board could at least be communicated with, I just took the standard Arduino IDE route as in that thread. My mega seems to be now mega good! I'll keep an eye on it though for compromised parts, as suggested.
N.B. I achieved it using a different computer, but I don't think that was instrumental in the breakthrough - or at least I can't tell, given that I took a brand new route. By the way, I used the .hex file as supplied by the installation of Flip - but of course, ultimately didn't use it in the final salvation.
You should not do that Let Windows determine the port. I have never had a need to do it, but you might have to clean out your COM stack; you can find instructions on the web.
I have the same view regards renaming, but had conflicting/contrary ports shown in IDE and Device manager and so any port would do . I'll checkout clearing the COM stack as I hate the idea of confused ports.