Blink Example to ATmega328p-u Using FTDI FT232RL Error "stk500_recv()"

I have uploaded successfully bootloader to the chip ATmega328p with the Arduino Nano 3.0.

Switching to the FTDI FT232RL USB adapter I can not upload the Blink code to the chip. The chip is sitting in an TQFP Adapter on a breadboard.

Using this Guide:
https://www.electronoobs.com/eng_arduino_tut6.php

Arduino: 1.8.12 (Windows 10), Board: “ATmega328, Yes (UART0), 328P / 328PA, BOD 1.8V, LTO disabled, External 16 MHz”

Error message:

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\barna\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\barna\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\barna\Documents\Arduino\libraries -fqbn=MiniCore:avr:328:bootloader=uart0,variant=modelP,BOD=1v8,LTO=Os,clock=16MHz_external -vid-pid=0403_6001 -ide-version=10812 -build-path C:\Users\barna\AppData\Local\Temp\arduino_build_507572 -warnings=none -build-cache C:\Users\barna\AppData\Local\Temp\arduino_cache_365354 -prefs=build.warn_data_percentage=75 -verbose C:\Users\barna\Desktop\Blink2\Blink2.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\barna\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\barna\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\barna\Documents\Arduino\libraries -fqbn=MiniCore:avr:328:bootloader=uart0,variant=modelP,BOD=1v8,LTO=Os,clock=16MHz_external -vid-pid=0403_6001 -ide-version=10812 -build-path C:\Users\barna\AppData\Local\Temp\arduino_build_507572 -warnings=none -build-cache C:\Users\barna\AppData\Local\Temp\arduino_cache_365354 -prefs=build.warn_data_percentage=75 -verbose C:\Users\barna\Desktop\Blink2\Blink2.ino
Using board ‘328’ from platform in folder: C:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4
Using core ‘MCUdude_corefiles’ from platform in folder: C:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4
Detecting libraries used…
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_ATmega328 -DARDUINO_ARCH_AVR “-IC:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4\cores\MCUdude_corefiles” “-IC:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4\variants\standard” “C:\Users\barna\AppData\Local\Temp\arduino_build_507572\sketch\Blink2.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 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_ATmega328 -DARDUINO_ARCH_AVR “-IC:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4\cores\MCUdude_corefiles” “-IC:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4\variants\standard” “C:\Users\barna\AppData\Local\Temp\arduino_build_507572\sketch\Blink2.ino.cpp” -o “C:\Users\barna\AppData\Local\Temp\arduino_build_507572\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\barna\AppData\Local\Temp\arduino_build_507572\preproc\ctags_target_for_gcc_minus_e.cpp”
Compiling sketch…
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_ATmega328 -DARDUINO_ARCH_AVR “-IC:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4\cores\MCUdude_corefiles” “-IC:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4\variants\standard” “C:\Users\barna\AppData\Local\Temp\arduino_build_507572\sketch\Blink2.ino.cpp” -o “C:\Users\barna\AppData\Local\Temp\arduino_build_507572\sketch\Blink2.ino.cpp.o”
Compiling libraries…
Compiling core…
Using precompiled core: C:\Users\barna\AppData\Local\Temp\arduino_cache_365354\core\core_097c30f0e700ef29f10e5ad4a4e0387d.a
Linking everything together…
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc” -w -Os -Wl,–gc-sections -mmcu=atmega328p -o “C:\Users\barna\AppData\Local\Temp\arduino_build_507572/Blink2.ino.elf” “C:\Users\barna\AppData\Local\Temp\arduino_build_507572\sketch\Blink2.ino.cpp.o” “C:\Users\barna\AppData\Local\Temp\arduino_build_507572/…\arduino_cache_365354\core\core_097c30f0e700ef29f10e5ad4a4e0387d.a” “-LC:\Users\barna\AppData\Local\Temp\arduino_build_507572” -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\barna\AppData\Local\Temp\arduino_build_507572/Blink2.ino.elf” “C:\Users\barna\AppData\Local\Temp\arduino_build_507572/Blink2.ino.eep”
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy” -O ihex -R .eeprom “C:\Users\barna\AppData\Local\Temp\arduino_build_507572/Blink2.ino.elf” “C:\Users\barna\AppData\Local\Temp\arduino_build_507572/Blink2.ino.hex”
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-size” -A “C:\Users\barna\AppData\Local\Temp\arduino_build_507572/Blink2.ino.elf”
Sketch uses 1068 bytes (3%) 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:\Users\barna\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4/avrdude.conf -v -patmega328p -carduino -PCOM5 -b115200 -D -Uflash:w:C:\Users\barna\AppData\Local\Temp\arduino_build_507572/Blink2.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:\Users\barna\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.4/avrdude.conf”

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

avrdude done. Thank you.

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

Setup picture

All in all it does not tell us much

Could you possibly look at the software settings in attachment: setup33 and comment if you can see what is wrong…

While you had the Nano connected, did you do a Sketch > Upload Using Programmer (or Shift + "Upload" button, or Ctrl + Shift + U)?

Hi pert. Using the Nano I just used the Arrow button "Upload" Skecth - Upload. Ctrl+U...

Tools: Board Arduino Nano
Programmer: Arduino as ISP

...

When Using the FTDI:
Pressed the Arrow button
Tools:
Board: Atmega327
Clock: External 16 Mhz
BOD: BOD 1.8V
Compiler LTO: LTO disabled
Variant: 328P / 328PA
Bootloader: Yes (UARTO)
....
Programmer: AVRISP mkII

Then always the error msg "stk500_recv()" in red text 10 times?

All those settings are worrying. One wrong and upload error I guess. And I am not that sure what I am doing... :frowning:

arnarson:
All those settings are worrying. One wrong and upload error I guess.

These settings you need to have set the same as you had them when you did the Tools > Burn Bootloader:

arnarson:
Board: Atmega327
Clock: External 16 Mhz
BOD: BOD 1.8V
Compiler LTO: LTO disabled
Variant: 328P / 328PA
Bootloader: Yes (UARTO)

This setting only matters when you are doing a Burn Bootloader or an Upload Using programmer:

arnarson:
Programmer: AVRISP mkII

When you are doing a standard Upload, the Tools > Programmer menu setting makes no difference.

I am a big skeptical about the way you have your crystal wired. You should have the crystal as close as possible to the ATmega328P with the shortest possible wires. You have those super long jumper wires, which is definitely not best practices. You can see a good breadboard setup of the crystal in this picture:

See how it's as close as possible to the ATmega328P? Of course the situation is a bit different in your case, but you get the idea.

Hi pert

These settings you need to have set the same as you had them when you did the Tools > Burn Bootloader:

I just tried the previous settings used with the Nano but no joy... :frowning:

I thought as I changed from the Ardino Nano 3.0 used only for the bootloader. Then per instruction I was to change to the FTDI for the upload of the Blink and later other code. I should change the settings to:
When Using the FTDI:
Pressed the Arrow button
Tools:
Board: Atmega327
Clock: External 16 Mhz
BOD: BOD 1.8V
Compiler LTO: LTO disabled
Variant: 328P / 328PA
Bootloader: Yes (UARTO)
....
Programmer: AVRISP mkII

Good to know that the Avrisp Mkii does not affect the blink upload. Thx

And the crystal setup can easily be corrected. I will do that

Always the same red text error. I have tried for hours... Do you know a better way to load code to this 328p - u chip? I am not ready to solder it into the design before I can load code to it

It sounds like there's a lot of confusion going on here. Let's start from scratch. Please follow these instructions exactly.

Make the following connections between the Nano you will be using as the programmer and the ATmega328P target chip. Refer to the "Connections" table on the SPI library reference page to determine the pins:

| Programmer | | Target |
| - | - |
| ----------- | |------- |
| 12 | | MISO |
| ----------- | |------- |
| +5V | | VCC |
| ----------- | |------- |
| 13 | | SCK |
| ----------- | |------- |
| 12 | | MOSI |
| ----------- | |------- |
| 10 | | RESET |
| ----------- | |------- |
| GND | | GND |

Connect the Nano to your computer with a USB cable.

File > Examples > 11.ArduinoISP > Arduino ISP

Tools > Board > Arduino Nano

Select the port of your Nano from the Tools > Port menu.

Sketch > Upload

Wait for the upload to finish. You have now turned your Nano into an "Arduino as ISP" programmer.

Tools > Board > ATmega328

Tools > Clock > External 16 Mhz

Tools > BOD > BOD 1.8V

Tools > Compiler LTO > LTO disabled

Tools > Variant > 328P / 328PA

Tools > Bootloader > Yes (UART0)

Tools > Programmer > Arduino as ISP

Tools > Burn Bootloader. You have now configured the ATmega328P to work with the board settings you chose above. You must always have those settings selected when uploading to the ATmega328P from now on.

Wait for the process to finish successfully.

Unplug your Nano from your computer.

Connect your FTDI module to the ATmega328P with the connections: RX-TX, TX-RX, VCC-VCC, GND-GND

Connect the FTDI module's USB cable to the computer.

Tools > Port > select the port of the FTDI module

Sketch > Upload

Thank you Pert for clarifying those things

All is working good now. Low power state was causing the message and when done in the right order the Bootloader is working and the Blink code

Great to be able to move on
All the best
B

I'm glad to hear you got it working. Enjoy!
Per