Can burn bootloader but can't upload sketch. Please help.

So I've got a barebones 1284p based arduino, a Pro Micro and a USB to FTDI programmer.

Using the pro micro, I successfully burnt a bootloader onto the bare bones 1284p using nick Gammon's Atmega_board_programmer sketch, the problem is, I can't upload a sketch to it using the FTDI adapter.

Here's the sketch and wiring I used. And the sketch 100% confirms that it's seeing a 1284p and programs it and verifies the bootloader. GitHub - nickgammon/arduino_sketches: Publicly-released sketches for the Arduino microprocessor

I've got another barebones pcb that was made using exactly the same design, and I can program that just fine with the FTDI. Plus it proves my hardware design is okay.

I've also checked all FTDI connections to the 1284p and they all check out fine.

Does anyone know why I can't upload a sketch to it, but can quite happily burn a bootloader to it using another arduino?

What error you are getting while uploading code.

Sometime IC might got damage and it wont allow you to upload code

Most of time crystal oscilator causing problem in uploading code.

Try simple blink code with arduino Lower version software 1.0.1

I get no error code, the FTDI LED blinks 3 times and the IDE just says "uploading" and doing nothing more.

And I can't download Arduino IDE 1.0.1, the link is dead now https://www.arduino.cc/en/Main/OldSoftwareReleases

And if I select a completely wrong board (say the pro mini), then it does exactly the same thing and just sits there saying uploading...

You can check the bootloader and the fuses by reading via ISP and compare with required. I'm not recommending to use v1.0.1 but 1.0.6 if you want to use prior version. The link for downloading is working.

How you saying code not being uploaded.

If uploaded shows its being uploaded else it gives out error.

I will recommend download lower version of arduino IDE and try to upload code

Which OS you are using? Can you share snap shot of after uploading code

So I've run the atmega_board_detector sketch on both boards (working and non working).

I ran a diff compare with winmerge and the only difference in the result is the clock calibration and First 256 bytes of program memory. All fuses are the same, what's going on?

Working:

Atmega chip detector.
Written by Nick Gammon.
Version 1.18
Compiled on Sep  2 2016 at 11:09:28 with Arduino IDE 10610.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x97 0x05 
Processor = ATmega1284P
Flash memory size = 131072 bytes.
LFuse = 0xFF 
HFuse = 0xDE 
EFuse = 0xFD 
Lock byte = 0xEF 
Clock calibration = 0x9D 
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 1024 bytes starting at 1FC00

Bootloader:

***DELETED DUE TO FORUM'S SILLY 9000 CHAR LIMIT, BUT IDENTICAL TO BELOW****

Programming mode off.

Non-working:

Atmega chip detector.
Written by Nick Gammon.
Version 1.18
Compiled on Sep  2 2016 at 11:09:28 with Arduino IDE 10610.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x97 0x05 
Processor = ATmega1284P
Flash memory size = 131072 bytes.
LFuse = 0xFF 
HFuse = 0xDE 
EFuse = 0xFD 
Lock byte = 0xEF 
Clock calibration = 0x59 
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 1024 bytes starting at 1FC00

Bootloader:

1FC00: 0x0F 0x92 0xCD 0xB7 0xDE 0xB7 0x11 0x24 0x84 0xB7 0x14 0xBE 0x81 0xFF 0xF1 0xD0 
1FC10: 0x85 0xE0 0x80 0x93 0x81 0x00 0x82 0xE0 0x80 0x93 0xC0 0x00 0x88 0xE1 0x80 0x93 
1FC20: 0xC1 0x00 0x86 0xE0 0x80 0x93 0xC2 0x00 0x80 0xE1 0x80 0x93 0xC4 0x00 0x8E 0xE0 
1FC30: 0xCA 0xD0 0x20 0x9A 0x26 0xE0 0x80 0xE3 0x9C 0xEF 0x31 0xE0 0x90 0x93 0x85 0x00 
1FC40: 0x80 0x93 0x84 0x00 0x36 0xBB 0xB0 0x9B 0xFE 0xCF 0x18 0x9A 0xA8 0x95 0x21 0x50 
1FC50: 0xA9 0xF7 0x00 0xE0 0x10 0xE0 0xEE 0x24 0xE3 0x94 0xE1 0xE1 0xDE 0x2E 0xF3 0xE0 
1FC60: 0xFF 0x2E 0xA5 0xD0 0x81 0x34 0x71 0xF4 0xA2 0xD0 0x89 0x83 0xB2 0xD0 0x89 0x81 
1FC70: 0x82 0x38 0x09 0xF4 0x8B 0xC0 0x81 0x38 0x11 0xF4 0x84 0xE0 0x01 0xC0 0x83 0xE0 
1FC80: 0x8F 0xD0 0x8B 0xC0 0x82 0x34 0x11 0xF4 0x84 0xE1 0x03 0xC0 0x85 0x34 0x19 0xF4 
1FC90: 0x85 0xE0 0xA7 0xD0 0x82 0xC0 0x85 0x35 0x91 0xF4 0x89 0xD0 0xA8 0x2E 0xBB 0x24 
1FCA0: 0x86 0xD0 0x08 0x2F 0x10 0xE0 0x10 0x2F 0x00 0x27 0x0A 0x29 0x1B 0x29 0x81 0x2F 
1FCB0: 0x88 0x1F 0x88 0x27 0x88 0x1F 0x8B 0xBF 0x00 0x0F 0x11 0x1F 0x6D 0xC0 0x86 0x35 
1FCC0: 0x21 0xF4 0x84 0xE0 0x8E 0xD0 0x80 0xE0 0xDB 0xCF 0x84 0x36 0x09 0xF0 0x40 0xC0 
1FCD0: 0x6E 0xD0 0x6D 0xD0 0xC8 0x2E 0x6B 0xD0 0x80 0xEE 0x00 0x30 0x18 0x07 0x18 0xF4 
1FCE0: 0xF8 0x01 0xF7 0xBE 0xE8 0x95 0xA1 0x2C 0x51 0xE0 0xB5 0x2E 0x60 0xD0 0xF5 0x01 
1FCF0: 0x81 0x93 0x5F 0x01 0xCE 0x16 0xD1 0xF7 0xF0 0xEE 0x00 0x30 0x1F 0x07 0x18 0xF0 
1FD00: 0xF8 0x01 0xF7 0xBE 0xE8 0x95 0x65 0xD0 0x07 0xB6 0x00 0xFC 0xFD 0xCF 0xF8 0x01 
1FD10: 0xA0 0xE0 0xB1 0xE0 0x2C 0x91 0x30 0xE0 0x11 0x96 0x8C 0x91 0x11 0x97 0x90 0xE0 
1FD20: 0x98 0x2F 0x88 0x27 0x82 0x2B 0x93 0x2B 0x12 0x96 0x0C 0x01 0xE7 0xBE 0xE8 0x95 
1FD30: 0x11 0x24 0x32 0x96 0x82 0xE0 0xA0 0x30 0xB8 0x07 0x61 0xF7 0x85 0xE0 0xF8 0x01 
1FD40: 0x87 0xBF 0xE8 0x95 0x07 0xB6 0x00 0xFC 0xFD 0xCF 0xD7 0xBE 0xE8 0x95 0x25 0xC0 
1FD50: 0x84 0x37 0xA9 0xF4 0x2C 0xD0 0x2B 0xD0 0xB8 0x2E 0x29 0xD0 0x3A 0xD0 0xCB 0x2C 
1FD60: 0x48 0x01 0xF4 0x01 0x86 0x91 0x1C 0xD0 0x08 0x94 0x81 0x1C 0x91 0x1C 0xCA 0x94 
1FD70: 0xC1 0xF7 0x0F 0x5F 0x1F 0x4F 0xBA 0x94 0x0B 0x0D 0x11 0x1D 0x0E 0xC0 0x85 0x37 
1FD80: 0x39 0xF4 0x27 0xD0 0x8E 0xE1 0x0C 0xD0 0x87 0xE9 0x0A 0xD0 0x85 0xE0 0x78 0xCF 
1FD90: 0x81 0x35 0x11 0xF4 0x88 0xE0 0x17 0xD0 0x1C 0xD0 0x80 0xE1 0x01 0xD0 0x61 0xCF 
1FDA0: 0x90 0x91 0xC0 0x00 0x95 0xFF 0xFC 0xCF 0x80 0x93 0xC6 0x00 0x08 0x95 0x80 0x91 
1FDB0: 0xC0 0x00 0x87 0xFF 0xFC 0xCF 0x80 0x91 0xC0 0x00 0x84 0xFD 0x01 0xC0 0xA8 0x95 
1FDC0: 0x80 0x91 0xC6 0x00 0x08 0x95 0xE0 0xE6 0xF0 0xE0 0x98 0xE1 0x90 0x83 0x80 0x83 
1FDD0: 0x08 0x95 0xED 0xDF 0x80 0x32 0x19 0xF0 0x88 0xE0 0xF5 0xDF 0xFF 0xCF 0x84 0xE1 
1FDE0: 0xDF 0xCF 0xCF 0x93 0xC8 0x2F 0xE3 0xDF 0xC1 0x50 0xE9 0xF7 0xF2 0xDF 0xCF 0x91 
1FDF0: 0x08 0x95 0x80 0xE0 0xE8 0xDF 0xEE 0x27 0xFF 0x27 0x09 0x94 0xFF 0xFF 0xFF 0xFF 

****ALSO DELETED****

MD5 sum of bootloader = 0x71 0xDD 0xC2 0x84 0x64 0xC4 0x73 0x27 0xD2 0x33 0x01 0x1E 0xFA 0xE1 0x24 0x4B 
Bootloader name: optiboot_atmega1284p

First 256 bytes of program memory:

0: 0x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0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 
D0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 
E0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 
F0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 

Programming mode off.

I have now uninstalled IDE 1.6.7 and installed 1.0.6. I can program the working board fine with "blink example"

the non functioning board says uploading..... and then after 8 seconds of so:

It gives this error: "avrdude: stk500_getsync(): not in sync: resp=0x00"

I'VE SOLVED IT!!!

Sorry for caps, but I've spent 2 days trying to solve this! In the end it was a dry joint on pin 27 of the AtMega chip (it's the AU SMT package). I'm not sure why it's able to be bootloaded but not serial programmed, but anyway, it's fixed!!! :slight_smile:

Thanks all for your efforts!