STK500_getsync() ... NOT IN SYNC

Dear community,

I read tons of topics here about error "avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x3e" but no solution worked for me. Maybe I did not see a problem in my circuit...?

I am using ATMega328P with Ch340G. I have all drivers installed and working. I tryed dozens of boards, downgrading arduino core, used "old bootloader" option etc... There is no problem. I burn bootload with ICSP without problem. I even upload test sketch via ICSP. After plug-in USB cable, I see incoming data with serial monitor and my test program even respond to serial inputs. So there is also no problem. The problem is when I try upload new sketches via USB. From my point of view, there is a problem with synchronization but I not know how to fix this. Below is errors I am getting all the time, no metter If I try to use reset button before/while uploading. Circuit scheme is attached. Sid anyone think of anything that might be a problem?

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\Alex\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"**
** Using Port : COM8**
** Using Programmer : arduino**
** Overriding Baud Rate : 57600**
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x3e
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xf8
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x38
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xf8
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x3a
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xf8
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x3e
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xf8
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x38
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xf8
avrdude done. Thank you.

Thanks for help.
AB

Looks like serial line sync problem. The bootloader you've used is it for 57600 baud?

At this moment I not remember which development board was selected while loading bootloader. I belive it was Arduino NANO, but I am using Ch340G chip (not FT232) so maybe the problem is here ... I wil take a look on it.

Thanks.

  1. CH340G requires different driver.
  2. There are 2 versions of Nano/bootloader for Nano: older is for 57600, newer is for 115200. I think, it is better to use newer - the Optiboot bootloader which takes half of memory (512B) and is for 115200 baud. It is same as for UNO R3.

I tryed to upload bootloader while selected different development boards. USB communication work (I see incoming serial data and can send commands to the ATMega from sketch uloaded via ICSP) but uploading new sketch through USB did not work. Still same problem - not in sync. It is a mystery!

unknow001:
... sketch uloaded via ICSP...

Wait! Did you upload sketch via ICSP after bootloading? If so, then the bootloader has gone.

Yes and no. I uploaded test sketch via ICSP and after reset I saw data coming through USB in both way. This way I test USB communication. Of course I tryed to upload bootloader first via ICSP and than tryed to upload sketches via USB.

If your test passed, then USB/serial works correctly.
Only 3 premises for uploading via USB/serial line are needed:

  1. serial data must pass to and from MCU (Rx,Tx)
  2. reset signal must pass to MCU's reset pin
  3. correct bootloader for specific speed and correct fuse settings for specific configuration; it is just one premise fulfilled during bootloading.

Which bootloader exactly you've used? Read out the HEX from flash and post it (use avrdude from cmd) and also post the command which cause the error.