Solution to "not in sync: resp=0xc4 avrdude" error

This may help someone having this error in particular, since the solution is in another page I bring it here:

It seems that this error is caused by a serial port bad connection, and may be by one of this causes:

  • old USB cable or broken
  • bad contact on the female USB (PC)
  • use of USB to USB cable to extend the connection between Arduino and PC (my case)

May I add: Charge only USB cable? That one bit me.

The real problem with this error is that it can be caused by a huge number of things:

Wrong board selected
Wrong speed selected
Trying to upload to a 2018 official nano without the latest version of the AVR board package
Trying to upload to a pre-2018 official nano or any nano clone with the latest version of AVR board package - must choose (Old bootloader) version from the processor menu.
Reset circuit not working (can be caused by external components connected to reset pin; clones where this is bad out of the box are not unheardof, but are quite rare)
Something connected to pins 0 or 1
Chip does not have the bootloader you think it does (atmega328p is used in nano (old), nano (new), pro mini, and nano. These all use different bootloaders (though if you load the bootloader for the “wrong” board, it will work as long as you select that board; many people here bootload their nanos and pro minis as Uno, since the uno bootloader is strictly better) - occasionally we hear about batches of clones that ship with a bootloader that doesn’t match the formfactor of the board.

HOWEVER - it is highly unlikely that any “not in sync. resp=” would be caused by any problem relating to the USB cable - that problem typically prevents the serial port from appearing at all. USB is all-or-nothing, if the USB connection is flaky, it will typically not work at all, or will appear and disappear from device manager.