Go Down

Topic: Can't upload a sketch from the IDE to my bare-bone Arduino Nano (Read 2 times) previous topic - next topic

szangvil

Hi all

I designed a bare-bone Arduino Nano which only has what I need for my project.
I was able to burn a bootloader to it and also, when connected to the PC, it is recognized as a COM port. But when I try to upload a sketch, I get the famous "stk500_getsync() not in sync resp=0x00" message.
I doubled checked my design and soldering and all is fine.

After hours of fiddling with it, I decided to try to avrdude command line options. What finally worked was to change the 57200 default baud rate used by the IDE to 115200! After that change, I had no problems uploading a sketch.

Any ideas why I had to change the baud rate? I am using the same FT232RL and ATMEGA328P-AU that are used in the original design. I did not buy them from Mouser or a "normal" supplier, I got them from some seller on eBay from almost half the price.

Is the baud rate settings used by avrdude are for the PC-FTDI chip communication or the FTDI-ATMEGA chip communication?

Coding Badly

Hi,

Any ideas why I had to change the baud rate?


Because the bootloader, fuse settings, and crystal (or resonator) establish that the baud rate has to be 115200.

Quote
Is the baud rate settings used by avrdude are for the PC-FTDI chip communication...


No.  The PC and FTDI chip communicate via USB at a USB bitrate: 1.5, 12, or 480 Mbit/s (probably 12).

Quote
...or the FTDI-ATMEGA chip communication?


Yes.

szangvil

I used the same resonator as on the original Nano... I tried to burn all possible 328 16MHz bootloaders to a standard Nano, and there were no issues to upload at 57600. I did the same to my bare bone Nano and I could only upload at 115200, regardless of the bootloader used.

tack

Which boooader did you burn to the MCU and via what method?

The bootloader has a baud rate it expects communication on, and this is complemented by the same rate set in boards.txt so the IDE knows what baud rate to use when invoking avrdude.

If you use Arduino as ISP to burn the bootloader then you normally do it with a target board selected and  hence the correct bootloader and boards.txt entry are in sync.

If you used a different method to burn a bootloader file directly then maybe the bootloader and boards.txt entry don't reflect each other?

szangvil

I used an Uno as my programmer and followed these instructions to burn the bootloader:

The steps to burn the bootloader:

1. Open the ArduinoISP firmware (in Examples) to your Arduino board.
Note for Arduino 1.0: you need to make one small change to the ArduinoISP code. Find the line in the heartbeat() function that says "delay(40);" and change it to "delay(20);".

2. Select the items in the Tools > Board and Serial Port menus that correspond to the board you are using as the programmer (not the board being programmed).

3. Upload the ArduinoISP sketch

4. Wire your Arduino board to the target as shown in the diagram below.

5. Select the item in the Tools > Board menu that corresponds to the board on which you want to burn the bootloader (not the board that you're using as the programmer). See the board descriptions on the environment page for details.

6.Use the Burn Bootloader > Arduino as ISP command.



The strange thing is, if I do the EXACT same thing with a "standard nano" and with my "bare bone nano", I get different behaviours... to the standard nano I can upload a sketch from the IDE (at 57600) and to my bare bone nano, I can not - only via command line setting the avrdude baud rate to 115200.

Go Up