Always getting ser_recv() on upload

arduinoavrdudeserial

I am new to microcontrollers (not electronics) and build a Shrimp except using CP2102 I am using a FT232RL UART. I am not using DTR connection for auto-reset, because it is not connected on my cable.

My circuit itself works fine. Using an ISP-Programmer (AVR Dragon) with AVR Studio 6 it is possible to flash any code. With this setup I flashed optiboot-bootloader onto my ATmega328P. It looks like it is working correctly, because after pressing RESET a LED connected to D13 (PB5) flashes three times.

Sadly, when using Arduino IDE trying to upload the "Blink"-Sketch, I get the following error:

Binary sketch size: 1.084 bytes (of a 32.256 byte maximum)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/tty.usbserial-A4VXM4PQ -b115200 -D -Uflash:w:/var/folders/yp/trpfnkdn75zfzpl33tyw0tpm0000gn/T/build3725234357197838286.tmp/Blink.cpp.hex:i 

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/user/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbserial-A4VXM4PQ
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

Searching the internet for hours all I can find is "check your wires" or "maybe bad bootloader or chip broken". I can say the chip is not broken because it works with AVR Studio and I do not think the bootloader is broken. I downloaded the latest version from code.google and also tried the .hex delivered with Arduino IDE. My wiring is quite simple just connected GND, Rx and Tx of FT232RL like the Shrimp schematic states. Checked everything multiple times and asked an engineering friend (but he is not familiar with Arduino in detail) to check it too… We both found no wiring error.

I also tried different timings from -10 to +10 seconds in relation to pressing RESET, but that did not fix anything. Also my USB-to-Serial cable is tested and working with different devices (RasPI, Cisco Router and other devices). In Arduino IDE the corresponding tty-device is selected. Board setting is set to "Uno".

What can I do to finally get my sketches onto my chip with serial and fix this problem to end my odyssey?

Best Answer

While building an arduino I experienced similar issues. It came down to two things:

1) Some circuit error on the bootloader TX/RX lines that had an accidental short and caused it to not respond

2) Bootloader file I used was incorrect, despite the fact that it downloaded perfectly fine and transmitted and all the instructions told me to use that one. The issue was something in the configuration that apparently changed the baud rate and hence the BSL failed.

I recommend you use a logic Analyzer or Oscilloscope to look at the lines and see what is going on. Some of the things you need to look for is:

1) No Data and lines don't start in their default state

2) Baudrate or speed incorrect