Sketch may be uploaded only once, then takes botloader update

Hi everyone,

It’s my third night with this problem and I’m tired. Here’s the problem: I created an Arduino (almost identical to Arduino Pro 3,3V 8MHz), flashed bootloader, uploaded Blink sketch. Can’t upload any more sketches. When I try, it resets and jums immediately to application (I can tell this from led behavior). What I tried:

Currently my most stable setup:
-Arduino Pro 3,3V 8MHz (atmega328p-au)
-Bus pirate acting as STK500v2 (to flash bootloader)
-FTDI FT232RL-based USB-UART (with RST pin out, not DTR!)
-Bootloader: “…\arduino-1.0\hardware\arduino\bootloaders\atmega\ATmegaBOOT_168_atmega328_pro_8MHz.hex”
-Uploaded with avrdude-GUI
-Fuses: H:DA L:FF E:05
-Lock bits: 0F

-Uploading bootloaders from IDE
-From AvrDude GUI
-Different Bootloaders
-Changing size of bootloader/application are (fuses BOOTSZ0-1)
-Changing reset behavior (fuse BOOTRST)
-On some forums people write that lock bits are 0xCF, not 0x0F; tried that, get an error
-Flashing bootloaders for 16MHz - same
-Flashing Optiboot - can’t upload anything with it

Below are memory snapshots just after bootloader flash, after blink upload and comparison of the two (from which you can tell that the bootloader is preserved and not overwritten).

Is there any requirement to the reset pulse? I’m guessing maybe the capacitor is big/small and the puls is long/short?
Or maybe FTDI must have DTR out, not RST? But why the heck it works just perfectly first time (because application memory is clear I guess and execution travels freely to the bootloader?)

Please help me out.

clean_bootloader.hex (76.7 KB)

corrupted_bootloader.hex (76.7 KB)

boot_comparison.doc (136 KB)

It certainly sounds like your auto-reset feature is not working.

A fresh bootloader has nothing better to do than wait for an upload. It doesn't need a reset to work. Once a sketch is uploaded you have to reset the processor to get the bootloader to check for an upload.

Any ideas how to troubleshoot? I can see reset going down on the scope. How may that be that autoreset doesn’t work if I see the bootloader blinking when IDE start a sketch upload?

Maybe the coupling capacitor is too small or the pull-up resistor on your reset line is to low a value.

I just resoldered that very m328p to a working nano. It works, so the problem was in the board. I just gave up :disappointed_relieved:

dccharacter: -FTDI FT232RL-based USB-UART (with RST pin out, not DTR!)

Hi, I have a similar CP2102 board with RST and no DTR.

My FTDI board has a DTR but it had no pin soldered to the pad on the side, so it was easy to fix. The CP2102 board has no such pad and no place for the extra pin.

Did you manage to autoreset by using the RST instead of the DTR? Is it possible anyway?

Greetings TOM

Hi! Yes, it's doable. My understanding is that I had wrong polarity set in FTDI for both DTR and RST signals.

Hi,

Thanks for your quick reply, but I just looked into the cp2102 datasheet and found out, that the RST is a signal goint TO the cp2102 not comming from it... It's there for resetting the cp2101

Don't confuse it with RTS!

The FTDI chip has a reset pin too, but the datasheet calls it "RESET#" and not RST.

I gues I have to fetch my microscope to determine if the RST pin on my board is connected to the "Reset the cp2102" or any other pin.