I have an Arduino Nano (ATMEGA328P) which has a corrupted bootloader. I'm trying to use an Arduino Uno to burn the Nano bootloader and hopefully fix the issue. I've followed the steps on the tutorial for doing this, but I'm getting a weird error when I try to "Burn Bootloader".
As you can see, the device signature is incorrect. I'm sure my Nano has an ATmega328P chip, so I'm thinking the device signature itself might have been corrupted. How can I fix this? It says I can use -F to override, but I'm not sure what it means by this... there is no command line input in the Arduino IDE, right?
The AVRDUDE tool used by the Arduino IDE for this "Burn Bootloader" operation checks the signature returned by the microcontroller before starting the write. That safety check can be disabled by adding a -F flag to the avrdude command.
That is correct. You must run AVRDUDE directly from the command line if you want to use the -F flag.
If you have Verbose output during: [] upload checked in the Arduino IDE's File > Preferences, the output panel will show the avrdude commands generated by the Arduino IDE during the "Burn Bootloader" attempt. You can copy/paste those commands to the command line, modifying those as you like.
Thank you. I was able to override and burn the bootloader (albeit with a few ignored errors), but unfortunately that didn't fix my Nano, as I still cannot upload to it.
That's highly unlikely unless you blew up your 328P; in which case you're wasting your time. But you will probably only know that once you have explored all other options
I and many people have this same problem. I purchased three Nano's and none of them have bootloaders and when I try burn a bootloader onto them I get this same error on all three. Surely someone has figured out a fix for these issues that have been going on for years and just for info I'm a novice at this , so some of the jargon used flies right over my head.
"Don't buy Nanos from sketchy dealers that don't put a bootloader on them"?
More seriously, the "bad signature" error can have many causes, depending on what signature it actually sees (which it will show if you turn on "verbose" in the upload preferences.) Signatures that start with 0x1E are probably "unexpected Atmel chips" (m328 or m168 vs m328p, for example.) Zeros or 0xFF's are usually wiring problems or dead chips (or perhaps non-Atmel 328 chips like the LGT8F328p, which are "somewhat" ATmega328p compatible, but NOT wrt to uploading the bootloader.)
So here is a thing, I connected the wires from the new board ISP header pins to the programming boards breakout pins. I had already fitted the 10uF capacitor to ground and reset pins as suggested. What I did was comment out the "#ifdef USE_OLD_STYLE_WIRING" as shown below and made "#define USE_OLD_STYLE_WIRING" the active code:
// Uncomment following line to use the old Uno style wiring
// (using pin 11, 12 and 13 instead of the SPI header) on Leonardo, Due...
#define USE_OLD_STYLE_WIRING
// #ifdef USE_OLD_STYLE_WIRING
Low and behold, I then found with the other two boards that I had to undo the change to the above code and now I'm happy after days of searching the net.
After programming the three Nano's, one fails to upload the Blink sketch. Damn, just saw that I had connected the ISP header 180 degrees around, it's probably dead now.