Arduino Uno R3 to burn 328P, 8MHz internal bootloader

I use Arduino UNO R3, follow the standard process and wired connection to burn bootloader to 328P.

No problem to burn 16MHz external bootloader (With 16MHz external X'tal.) But always failed to burn 8MHz internal CLK (Follow the minimum circuit connection, without any X'tal connected). I use either Arduino IDE or with MinCore, both show the same result.

Then I connect the 16MHz X'tal when I burn 8MHz internal. Then it works........

I loaded with blink sketch to confirm 8MHz internal (Without X'tal connected), and it works well (just the speed seems changed)

May I know why it need external 16MHz X'tal when burning 8MH internal bootloader? (Not like the circuit it said?)

Another problem is : I can't upload sketch once the bootloader is set 8MHz external (Also follow the connection in the above link (use Arduino UNO R3 without the uP 328P).

So the only way to use 8MHz to run (Minimum circuit). I need : to load sketch first (Under 16MHz external bootloader) then burn the 8MHz bootloader after.

May I know why?

Later on, I found some sketch (DigitalTube ClockDisply with TM1637) can't run well by this process..... will check and ask this question later (If I can't find the root cause.)

If the chip has previously been set to use a crystal, and you then remove the crystal, there will be no clock signal, so ISP programming won't work.

If you use a virgin '328p (which will be running at 1MHz - 8MHz internal clock with CKDIV8 fuse set), instead of one that you've previously bootloaded to use a crystal, this isn't an issue.

Loading a sketch after burning 8MHz bootloader should work - as long as you're uploading with the appropriate board selected (minicore should handle this without issue).

Burning bootloader after uploading a sketch will erase the sketch, so what you're describing about your workflow doesn't make sense.

Yes, I see. Thanks for the quick answer.

As for the sequence I did of loaded sketch first then burning bootloader after. The blink program seems running well after 8MHz internal bootloader. The LED (13 of UNO board or pin 19 of 328P) on and off without X'tal connected (But speed is different.). Are there something can still turn the LED on/off?

As for failed to load the sketch after burning 8MHz internal bootloader. I keep using ArduinoISP to load the sketch many times, but always failed and response 20 lines (10 times)

avrdude: stk500_recv() programmer is not responding
avrdude: stk500_getsync() attempt (from 1 to 10) of 10 :not in sync: resp=0x3b

May I know what's the problem? or what I can do?

I confirmed my wired connection is correct for it can loaded sketch smoothly every time when bootloader is 16MHz external X'tal.

I tried to find the solutions from internet many posted answers, but none of it tell the problem of loading sketch to a 8MHz internal bootloader.

hsieh3k:
Are there something can still turn the LED on/off?

Yes. The bootloader itself blinks the LED. When you do a Burn Bootloader, it erases the sketch that was previously on the ATmega328P. The only program on the chip is the bootloader, which runs continuously. Once you have uploaded a sketch, the bootloader only runs for a short time after reset.

hsieh3k:
As for failed to load the sketch after burning 8MHz internal bootloader. I keep using ArduinoISP to load the sketch many times, but always failed and response 20 lines (10 times)

avrdude: stk500_recv() programmer is not responding
avrdude: stk500_getsync() attempt (from 1 to 10) of 10 :not in sync: resp=0x3b

Please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Sketch > Upload
  • After the upload fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here USING CODE TAGS (</> button on the forum toolbar).

Yes, Thanks for the clarification. it looks I was misleading by using blink sketch which function is similar to the basic function of bootloader.

I try to upload again, still failed. Please see attached log. Thx.

Arduino:1.8.5 (Windows 7), 開發板:"Arduino/Genuino Uno"

Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x4b
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x4b
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x4b
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x4b
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x4b
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x4b
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x4b
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x4b
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x4b
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x4b

上傳到板子時發生問題。可行建議請見http://www.arduino.cc/en/Guide/Troubleshooting#upload。

Please turn on verbose output during upload, per my instructions above. The reason is that I need to see the avrdude command that's being used to get some idea of what's happening.

Also, I said "Sketch > Upload" in the instructions above, but really what I should have said is to do whatever process you were doing before when you got the error.

Yes, here are updated copy.

I thought only the avrdude commend, now it includes compiler and linking ....etc.

But can't pasted all (It's very big file !) due to system limited to 9000 characters max. so I pasted only partial of the first part . Avrdude commend are at the end (Not pasted this time) which are the same and only as those posted in previous reply.

Do I need try to paste all of them? Might need several replies.

Arduino:1.8.5 (Windows 7), 開發板:"Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\mtk00486\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\mtk00486\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\mtk00486\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10805 -build-path C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176 -warnings=none -build-cache C:\Users\mtk00486\AppData\Local\Temp\arduino_cache_299385 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\mtk00486\Documents\Arduino\Grove_Clock_Display20180316_NEW\Grove_Clock_Display20180316_NEW.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\mtk00486\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\mtk00486\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\mtk00486\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10805 -build-path C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176 -warnings=none -build-cache C:\Users\mtk00486\AppData\Local\Temp\arduino_cache_299385 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\mtk00486\Documents\Arduino\Grove_Clock_Display20180316_NEW\Grove_Clock_Display20180316_NEW.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176\sketch\Grove_Clock_Display20180316_NEW.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\mtk00486\Documents\Arduino\libraries\TimerOne-r11" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176\sketch\Grove_Clock_Display20180316_NEW.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\mtk00486\Documents\Arduino\libraries\TimerOne-r11" "-IC:\Users\mtk00486\Documents\Arduino\libraries\DigitalTube" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176\sketch\Grove_Clock_Display20180316_NEW.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\mtk00486\Documents\Arduino\libraries\TimerOne-r11" "-IC:\Users\mtk00486\Documents\Arduino\libraries\DigitalTube" "C:\Users\mtk00486\Documents\Arduino\libraries\TimerOne-r11\TimerOne.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\mtk00486\Documents\Arduino\libraries\TimerOne-r11" "-IC:\Users\mtk00486\Documents\Arduino\libraries\DigitalTube" "C:\Users\mtk00486\Documents\Arduino\libraries\DigitalTube\TM1637.cpp" -o "nul"
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\mtk00486\Documents\Arduino\libraries\TimerOne-r11" "-IC:\Users\mtk00486\Documents\Arduino\libraries\DigitalTube" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176\sketch\Grove_Clock_Display20180316_NEW.ino.cpp" -o "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176\preproc\ctags_target_for_gcc_minus_e.cpp"
草稿碼編譯中...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\mtk00486\Documents\Arduino\libraries\TimerOne-r11" "-IC:\Users\mtk00486\Documents\Arduino\libraries\DigitalTube" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176\sketch\Grove_Clock_Display20180316_NEW.ino.cpp" -o "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176\sketch\Grove_Clock_Display20180316_NEW.ino.cpp.o"
Compiling libraries...
Compiling library "TimerOne-r11"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "-IC:\Users\mtk00486\Documents\Arduino\libraries\TimerOne-r11" "-IC:\Users\mtk00486\Documents\Arduino\libraries\DigitalTube" "C:\Users\mtk00486\Documents\Arduino\libraries\TimerOne-r11\TimerOne.cpp" -o "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_512176\libraries\TimerOne-r11\TimerOne.cpp.o"

By the way, the "resp=" are different.

Yesterday is 0x3b, previous one is 0x4b, now it change to 0xca.....

下載https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json時發生錯誤
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xca
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xca
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xca
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xca
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xca
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xca
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xca
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xca
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xca
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xca
上傳到板子時發生問題。可行建議請見http://www.arduino.cc/en/Guide/Troubleshooting#upload。

Try another one with shorter sketch. So I can paste all.

Arduino:1.8.5 (Windows 7), 開發板:"Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\mtk00486\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\mtk00486\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\mtk00486\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10805 -build-path C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738 -warnings=none -build-cache C:\Users\mtk00486\AppData\Local\Temp\arduino_cache_202836 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\mtk00486\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\mtk00486\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\mtk00486\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10805 -build-path C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738 -warnings=none -build-cache C:\Users\mtk00486\AppData\Local\Temp\arduino_cache_202836 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738\sketch\Blink.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738\sketch\Blink.ino.cpp" -o "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738\preproc\ctags_target_for_gcc_minus_e.cpp"
草稿碼編譯中...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738\sketch\Blink.ino.cpp" -o "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738\sketch\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738/Blink.ino.elf" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738\sketch\Blink.ino.cpp.o" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738/..\arduino_cache_202836\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738" -lm
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738/Blink.ino.elf" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738/Blink.ino.eep"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -R .eeprom  "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738/Blink.ino.elf" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_747738/Blink.ino.hex"
草稿碼使用了 928 bytes (2%) 的程式儲存空間。上限為 32256 bytes。
全域變數使用了 9 bytes (0%) 的動態記憶體,剩餘 2039 bytes 給區域變數。上限為 2048 bytes 。
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x0e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x0e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x0e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x0e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x0e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x0e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x0e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x0e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x0e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x0e
上傳到板子時發生問題。可行建議請見http://www.arduino.cc/en/Guide/Troubleshooting#upload。

It appears that you turned on verbose output during compilation (which we don't need and causes the output to be too long), but didn't turn on verbose output during upload.

Yes, I set the verbose on/off in Preferences.txt as shown below.

build.verbose=false
build.warn_data_percentage=75

upload.using=bootloader
upload.verbose=true
upload.verify=true

The result looks the same? Did I miss something? (Sorry for I am almost a beginner in this area)

What I did the upload sketch to either 16MHz external or 8MHz internal up are the same. Just click "upload" bottom and let it run. But 8MHz internal always failed, and 16MHz always success....... (With the same breadboard and connection. No any wire changed except 16MHz need an external X'tal.)

Arduino:1.8.5 (Windows 7), 開發板:"Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\mtk00486\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\mtk00486\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\mtk00486\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10805 -build-path C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163 -warnings=none -build-cache C:\Users\mtk00486\AppData\Local\Temp\arduino_cache_430680 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\mtk00486\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\mtk00486\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\mtk00486\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10805 -build-path C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163 -warnings=none -build-cache C:\Users\mtk00486\AppData\Local\Temp\arduino_cache_430680 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163\sketch\Blink.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163\sketch\Blink.ino.cpp" -o "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163\preproc\ctags_target_for_gcc_minus_e.cpp"
草稿碼編譯中...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163\sketch\Blink.ino.cpp" -o "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163\sketch\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163/Blink.ino.elf" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163\sketch\Blink.ino.cpp.o" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163/..\arduino_cache_430680\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163" -lm
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163/Blink.ino.elf" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163/Blink.ino.eep"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -R .eeprom  "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163/Blink.ino.elf" "C:\Users\mtk00486\AppData\Local\Temp\arduino_build_292163/Blink.ino.hex"
草稿碼使用了 928 bytes (2%) 的程式儲存空間。上限為 32256 bytes。
全域變數使用了 9 bytes (0%) 的動態記憶體,剩餘 2039 bytes 給區域變數。上限為 2048 bytes 。
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xd9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xd9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xd9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xd9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xd9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xd9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xd9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xd9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xd9
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xd9
上傳到板子時發生問題。可行建議請見http://www.arduino.cc/en/Guide/Troubleshooting#upload。

I don't know why your verbose upload output isn't working. If it was on, there should be much more to the avrdude output. Like this:

Arduino: 1.8.9 Hourly Build 2019/02/04 10:33 (Windows 10), Board: "ATmega328 on a breadboard (8 MHz internal clock)"

Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB
Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes of dynamic memory.
C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/bin/avrdude -CC:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf -v -patmega328p -carduino -PCOM1 -b57600 -D -Uflash:w:C:\Users\per\AppData\Local\Temp\arduino_build_201705/sketch_feb27a.ino.hex:i 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"

         Using Port                    : COM1
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x06
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x06
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x06
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x06
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x06
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x06
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x06
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x06
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x06
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x06

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Anyway, it's not that important for the purposes of this thread (though I would certainly want to get verbose output working if I were you).

You can't do a standard Sketch > Upload to your ATmega328P through the Arduino as ISP programmer. If you want to do a standard Upload, you need to get a USB to TTL serial adapter and wire it up to the ATmega328P instead of the Arduino as ISP. You can find details on this under the "Programming a sketch" section of this tutorial:

However, I don't recommend the "FTDI cable" used in that tutorial. Instead, I recommend one of the commonly available boards like this:


There are also boards like this with other USB to TTL serial adapter chips like the CH340 and those will work fine too, but make sure to get one that has the standardized FTDI pinout:

  • DTR
  • RX
  • TX
  • VCC
  • CTS
  • GND

The ability to switch between 5 V and 3.3 V is kind of a nice feature.

If you want to upload to your ATmega328P using the Arduino as ISP, then you need to do a Sketch > Upload Using Programmer. Be aware that when you do that you erase the bootloader. So if you ever want to upload to your ATmega328P using the USB to TTL serial adapter as I described above, you'll need to do another Tools > Burn Bootloader first.

Yes, It's kind of strange...... I am not sure why my output didn't show that.
I kept debugging, and think it might be the interface problem...... I found no serial link (TXD LED on/off on UNO R3 board), that mean no response from the 8MHz Internal 328P?? (16MHz are OK)

If I upload sketch to a 16MHz, both the TX/RX LED (On Uno board) are lighted for a short time, and then it shows uploading completed. However, if upload sketch it to 8MHz, the RX LED only on for one and short time, and then it on for ~ 10 times with few seconds interval. TX LED never lighted?? Then the uploading is time out..... and show the failure.

From the very beginning, to make sure the wire connected are all correctly, I had made 2 daughter boards for both bootloader loading and for sketch loading (Please see the attached drawings)

And use a removed 328P UNO R3 board as the FTDI interface.
Also made a (16MHz + 22pF capacitor) module as an option for the boards (So I can plug in/out when needed or not)

In this way, it isrobust to repeat the experiment without wire connection error. So far, all works very well for downloading 16MHz bootloader and upload sketch, Also ok for downloading 8MH bootloader (But except to upload sktech to 8MHz !!! always failed....)

So I am sure all the connection are correct. But still don't know why upload sketch to 8MHz failed...... Why it don't response ?? I also change the baud rate, but nothing improved.....

Is that possible the 8MHz bootloader code issues? Some setting incorrectly? (I use both Arduino IDE default for 8MHz Internal or MiniCore are the same......) Any thing I can change for that ?![](http://D:\MIS\Arduino\8MHz Debug)

Finally, after keep trying, I got issue resolved. For I also made few mistakes.....

  1. I found there is 1MHz internal can be set by MiniCore, so I use it to burn bootloader and then upload sketch .......... magic..... it success......

  2. So I go back to check what's wrong with the 8MHz....... Then I found, since I though the 8MHz Internal bootloader are OK, so not care about the board selection (Tools>) with the Arduino IDE default 8MHz or by MiniCore 8MHz.
    (Please see the attached drawings, Fig. 4 and 5)

Double check and repeated the combinations and results are :

Bootloader Upload Sketch Result

Arduino IDE 8MHz Arduino IDE 8MHz Failed
Arduino IDE 8MHz MiniCore 8MHz Failed
MiniCore 8MHz Arduino IDE 8MHz Failed
MiniCore 8MHz MiniCore 8MHz Successn

I must only did the first 3 combinations.... not No. 4... !!!

So only can use MiniCore to burn bootloader and then upload the sketch (board selection also need to be MiniCore too), then it will success. All the others will be failed.

Now, I can do the 8MHz internal without issues....

So the summary of questions are :

  1. Why use the Arduino default 8MHz Internal doesn't work? (I follow and got the 8MHz boards.txt from the link:

https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard)

Something wrong with it's bootloader code? or upload ?

  1. The Minimum Circuit diagram need to have the X'tal there. (Only if you change Oscillator from internal to internal "1M to 8M or 8M to 1M", you don't need the X'tal.) Others : if changing from external to internal/external or internal to external ..... you do need it. So my suggestion is always connect the X'tal when you are burning the bootloader. Please also see the attached drawings (Fig.6).

Spent 4 days to found all the 8MHz bootloader problems and my mistake !!! also some misunderstanding .......

Thanks to all answers by Pert and DrAzzy, help me to clarify misunderstanding and debugging. It's a great discussion here.....

hsieh3k:

  1. Why use the Arduino default 8MHz Internal doesn't work? (I follow and got the 8MHz boards.txt from the link:

https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard)

Something wrong with it's bootloader code? or upload ?

I have also experienced this with the "breadboard" hardware package. What I notice is that the upload speed for the "ATmega328 on a breadboard (8 MHz internal clock)" board in the "breadboard" hardware package is 57600. The upload speed for the MiniCore ATmega328P, 8 MHz internal board is 38400. The actual baud rate on the microcontroller differs from a given target baud rate according to the clock speed. According to this table:
https://cache.amobbs.com/bbs_upload782111/files_22/ourdev_508497.html
at 8 MHz, the baud rate at the target of 38400 is only off by 0.2%. The baud rate at the target of 57600 is off by 3.7%. On top of that, we have the fact that the internal oscillator is less accurate than an external crystal or resonator. That inaccuracy may end up pushing the baud error of the microcontroller ever farther off. If the actual baud rate of the microcontroller differs enough from that of the computer, communication fails.

You could actually test this fairly easily because MiniCore also provides a bootloader for the ATmega328P, 8 MHz internal board that is compiled for 57600 baud communication. You would need to edit line 130 of the MiniCore boards.txt from:

328.menu.clock.8MHz_internal.upload.speed=38400

to:

328.menu.clock.8MHz_internal.upload.speed=57600

Restart the Arduino IDE, select the MiniCore's ATmega328P, 8 MHz internal board, Burn Bootloader, then try an upload.

I was going to give it a try, but the two ATmega328P boards I have close to hand are currently working even with the "breadboard" hardware package so I can't currently reproduce the issue.

hsieh3k:
2. The Minimum Circuit diagram need to have the X'tal there. (Only if you change Oscillator from internal to internal "1M to 8M or 8M to 1M", you don't need the X'tal.) Others : if changing from external to internal/external or internal to external ..... you do need it. So my suggestion is always connect the X'tal when you are burning the bootloader. Please also see the attached drawings (Fig.6).

If you have set the fuses to use an external clock source, the CPU of the microcontroller will not run, not even enough to change the fuses back to the internal oscillator. For this reason, you need to have an external clock source connected when changing the fuses from external clock to internal oscillator. If the fuses are already set to use the internal oscillator, then there is no point in connecting a crystal. When the ATmega328P comes from the factory, the fuses are set to use the internal oscillator. However, if you buy an ATmega328P "with Arduino bootloader", that chip will have its fuses set to use an external clock (because they configured it like an Uno).

Yes, I think this problem is caused by interface (Wire connection or baud rate). I can't do the test for didn't find the MiniCore boards.txt in my PC? Where is it located?

In my PC, I can only find the boards.txt.
(Program Files(x86)>Arduino>Hardware>Breadboard>avr>boards.txt.)

And its content :

##############################################################

atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.protocol=arduino
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.speed=38400

atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0xFD

atmega328bb.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F

atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=arduino:standard


atmega328bb.bootloader.tool=arduino:avrdude
atmega328bb.upload.tool=arduino:avrdude

I had tried to change the baud rate at different number, but it doesn't change anything....

atmega328bb.upload.speed=38400

How can I set the baud rate for both (default and MiniCore) ?

hsieh3k:
I can't do the test for didn't find the MiniCore boards.txt in my PC? Where is it located?

Hardware packages you install via Boards Manager are saved to a special folder on your computer, which is often hidden by the OS.

The easiest way to find the active hardware package location is as follows:

  • Select a MiniCore board from the hardware package from the Tools > Board menu
  • File > Examples > SPI > BarometricPressureSensor (or any other SPI example sketch)
  • Sketch > Show Sketch Folder
  • Move up folder levels until you reach the one that contains boards.txt

Remember that you need to restart the Arduino IDE before any changes to boards.txt take effect.

hsieh3k:
I had tried to change the baud rate at different number, but it doesn't change anything....

atmega328bb.upload.speed=38400

That will change the baud rate the computer uses to send the sketch to the ATmega328P. However, it will not change the baud rate that the bootloader is programmed to communicate at it will stay at 57600. If the computer is communicating at 38400 and the bootloader is communicating at 57600, it will never work. In order to do this with the "breadboard" hardware package, you'd need to recompile the bootloader from source, which is fairly complicated.

MiniCore has been specially designed so that changing the value of the upload.speed property in boards.txt will also change which bootloader file is flashed to the microcontroller when you do a Burn Bootloader so that the communication speed of the computer and bootloader will match. You can see how that is done on line 51 of boards.txt:

328.menu.bootloader.true.bootloader.file=optiboot_flash/{build.mcu}/optiboot_flash_{build.mcu}_{upload.port}_{upload.speed}_{build.f_cpu}.hex

See how the bootloader file name is dependent on the value of {upload.speed}?

MiniCore provides pre-compiled bootloader files for all common baud rates. This is not something you should expect to be able to do with any random hardware package.

pert:
You could actually test this fairly easily because MiniCore also provides a bootloader for the ATmega328P, 8 MHz internal board that is compiled for 57600 baud communication. You would need to edit line 130 of the MiniCore boards.txt from:

328.menu.clock.8MHz_internal.upload.speed=38400

to:

328.menu.clock.8MHz_internal.upload.speed=57600

Restart the Arduino IDE, select the MiniCore's ATmega328P, 8 MHz internal board, Burn Bootloader, then try an upload.

I was going to give it a try, but the two ATmega328P boards I have close to hand are currently working even with the "breadboard" hardware package so I can't currently reproduce the issue.

Yes, Thanks for the description. I can find the MiniCore boards.txt and do the test. I change the baud rate to 57600 for 8MHz internal then restart the IDE, burn bootloader and upload sketch...... It looks OK, and still success.....

Any other test I can try? I do like to know the root cause of why the Arduino IDE (its 8MHz Internal setting) can't upload sketch to a 8MHz internal 328P ??

328.menu.clock.8MHz_external=8 MHz external
328.menu.clock.8MHz_external.upload.port=UART0
328.menu.clock.8MHz_external.upload.speed=38400
328.menu.clock.8MHz_external.bootloader.low_fuses=0b1111{bootloader.cksel_bits}
328.menu.clock.8MHz_external.build.f_cpu=8000000L

328.menu.clock.8MHz_internal=8 MHz internal
328.menu.clock.8MHz_internal.upload.port=UART0
328.menu.clock.8MHz_internal.upload.speed=57600
328.menu.clock.8MHz_internal.bootloader.low_fuses=0xe2
328.menu.clock.8MHz_internal.build.f_cpu=8000000L

328.menu.clock.1MHz_internal=1 MHz internal
328.menu.clock.1MHz_internal.upload.port=UART0
328.menu.clock.1MHz_internal.upload.speed=9600
328.menu.clock.1MHz_internal.bootloader.low_fuses=0x62
328.menu.clock.1MHz_internal.build.f_cpu=1000000L

The only thing that I can suggest is that you try both MiniCore and the breadboard board definition consecutively. The oscillator speed is affected by temperature so you might get different results when the chip is cold, warm, or hot. That will depend on ambient temperature as well as how long the chip has been powered.

Both board definitions use the same clock configuration via the low fuses value of 0xe2 so once you change MiniCore to communicate at 57600, the only meaningful difference between the two is the bootloader code. I have no idea whether there is something in the bootloader code that makes the Optiboot bootloader used by MiniCore more tolerant to baud error than the "ATmegaBOOT" bootloader used by the breadboard package.