Using an Uno (original UNO R3 and two "clones) and banging head on wall. This used to be simple, something changed since I last worked with Arduino. First off, I can compile fine and then take the output of the compiler and load that into a burner and program the ATMega328P. Works fine. Cannot use the UNO board to program. I've tried several ATMEga328P's. Same error:
Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
***C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM10 -b115200 -D -Uflash:w:C:\Users\georg\AppData\Local\Temp\arduino_build_872099/Blink.ino.hex:i ***
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:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"***
*** Using Port : COM10***
*** Using Programmer : arduino***
*** Overriding Baud Rate : 115200*** avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00 avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
avrdude done. Thank you.
An error occurred while uploading the sketch
This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
All have the 16U2 USB chip, tried uninstall/re-install drivers. Still the same. This all worked fine last time under Windows 7. Now on Windows 10 (not sure if that's a reason) it is a brick wall. Tried the online compile/load and same thing. I'm thinking bootloader but trying to burn bootloader fails same way.
Reading the 328's I got from Adafruit I see code from 7800--->7FFF assuming that's the bootloader. Just stumped here. Can someone point me the right way?
George Csahanin
All 0x00 means no response from Arduino. It can be the bootloader problem.
This has nothing with this error. It is in your PC.
Explain this. What burner?
You should check the device in the Device Manager first. If it is visible the driver is just fine. The error would be different anyway. Something like it can't open the port.
Also, you can test if the data from PC can reach the target MCU - 328P and back by the "loopback test". Search forum for this. Briefly:
small resistor ~1k between RESET and GND pin on arduino to keep 328P down
shortage between Rx and Tx pin
any terminal emulator like PuTTY, connect to the port and any typing on keyboard should be received back to the screen, you should also see an activity on Tx and Rx LEDs.
This can be primary problem of the error but not only the bootloader, also fuse which defines the start/boot address.
More interesting is how did you read out the 328P. This point to the burner question. If you tried to upload via ISP programmetr then the bootloader has gone.
Try to reload the bootlader to the 328P.
Got it all sorted out late yesterday. No bootloader on some chips I got from Adafruit. So I need to "fix" them. Where can I find the bootloader code? Lots of google and didn't find that. I can read/write the fuse bytes, etc. So tried a known good 328P downloaded (not in Arduino but in a Willem programmer) code, data and config to files and then uploaded them to one of the 328P's that would not program from Arduino. Now it does, repeated 4 more times on different 328P's and even a 328 (not "P"). Works every time. The key, I suppose is having the bootloader in the code and getting the fuse bytes, etc set properly is/was they key. Learned more about the memory map and config bytes in the 328. One point I got confused about was the memory maps. I was thinking 8 byte words but the map is 16 bytes. Was getting confused when the programmer (burner) was showing memory ending at 0x7FFF but according to the Atmel sheet the end is 0x3FFF. So I'm good and thanks.
GeorgeC
That would depend on which bootloader you are referring to.
The source code of the version of the Optiboot bootloader the Arduino UNO boards come with is here:
That is an older version of Optiboot. The community has continued with the development of that bootloader in the years since. The actively developed upstream source code is hosted here:
The older and clone/derivative Arduino Nano boards as well as the Pro Mini boards come with this alternative (and inferior) bootloader:
The bootloader source code is interesting, and valuable in the rare and advanced case where you might want to understand how the bootloader works or make your own modifications. However, there is no actual need for a standard user to ever know where the bootloader source code is. In the case where you actually need to flash a bootloader to a chip (as is generally the case if you buy bare chips instead of pre-made dev boards), you can simply use the Burn Bootloader feature of Arduino IDE. The IDE will handle configuring the fuses and flashing the bootloader binary to the board automatically.
Even if you for some reason don't want to use the IDE, you would generally only want to find the pre-compiled .hex file binary of the bootloader, not the source code.
Not really. You can flash bootloader by itself. Once the bootloader is on the chip, you can use the bootloader to flash the application binary to the chip..