I have an ATmega2560 which I am using MegaCore with. GitHub - MCUdude/MegaCore: Arduino hardware package for ATmega64, ATmega128, ATmega165, ATmega169, ATmega325, ATmega329, ATmega640, ATmega645, ATmega649, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega3250, ATmega3290, ATmega6450, ATmega6490, AT90CAN32, AT90CAN64 and AT90CAN128
To interface with this, I have an Arduino as ISP hooked up to its SPI pins. This works well, but I don't want to always be laden with the extra breadboard coming off my circuit just for reprogramming. I have an FT232R chip hooked up to my AVR's Tx/Rx as well to hopefully alleviate this. The desired end goal here is to have to use the Arduino as ISP 0% of the time, and the FT232R 100% of the time.
As hinted by the subject line, I can't do this yet. The FT232R can successfully upload to the AVR immediately after the bootloader has been programmed to it, but it cannot upload in any other case. The upload procedure likely destroys the bootloader it needs.
So, I need to know how to do one of these to remove reliance on the Arduino as ISP:
- Re-burn bootloader with the FT232R interface (which doesn't work for me now)
- Preserve bootloader when reprogramming with my FT232R.
- Upload with the FT232R interface without needing a bootloader present
Circuit details: I have a 0.1uF capacitor connected between my FT232R and !Reset of my AVR, as I saw recommended somewhere. The rest of the circuit (Rx/Tx connections) should be correct as, again, I am able to reprogram when a bootloader is present.
Here's the current "state machine" I observe when trying various things in the IDE.
Tools Menu Settings
Board:"ATmega2560"
Clock:"8 MHz internal"
BOD:"2.7v"
Compiler LTO:"Disabled (default)"
Pinout:"AVR pinout"
Entry State: Any
USB Cable:Plugged into ISP Arduino
Programmer:"Arduino as ISP"
Command:"Burn Bootloader"
Result: Success
Entry State: Any
USB Cable:Plugged Into FT232R
Programmer:"AVRISP mkII"
Command:"Burn Bootloader"
Result: Error, message below
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Users\REDACTED\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.0.1/avrdude.conf -v -patmega2560 -cstk500v2 -Pusb -e -Ulock:w:0x3f:m -Uefuse:w:0xfd:m -Uhfuse:w:0xd6:m -Ulfuse:w:0xe2:m
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\REDACTED\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.0.1/avrdude.conf"
Using Port : usb
Using Programmer : stk500v2
Error while burning bootloader.
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)
avrdude done. Thank you.
Entry State: Any
USB Cable:Plugged Into FT232R
Programmer:"AVR ISP"
Command:"Burn Bootloader"
Result: Error, message below
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Users\REDACTED\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.0.1/avrdude.conf -v -patmega2560 -cstk500v1 -PCOM11 -e -Ulock:w:0x3f:m -Uefuse:w:0xfd:m -Uhfuse:w:0xd6:m -Ulfuse:w:0xe2:m
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\REDACTED\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.0.1/avrdude.conf"
Using Port : COM11
Using Programmer : stk500v1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03
avrdude: ser_recv(): read error: The I/O operation has been aborted because of either a thread exit or an application request.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: Access is denied.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: Access is denied.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: Access is denied.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03
Error while burning bootloader.
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: Access is denied.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: Access is denied.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: Access is denied.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03
avrdude: ser_drain(): read error: Access is denied.
avrdude done. Thank you.
Entry State: Bootloader successfully burned via Arduino as ISP
USB Cable:Plugged Into FT232R
Programmer:"AVRISP mkII"
Command:"Upload" (normal upload)
Result: Success
Entry State: Program successfully uploaded via FT232R
USB Cable:Plugged Into FT232R
Programmer:"AVRISP mkII" or "AVR ISP"
Command:"Upload" (normal upload)
Result: Error, message below
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\REDACTED\AppData\Local\Arduino15\packages\MegaCore\hardware\avr\2.0.1/avrdude.conf"
Using Port : COM11
Using Programmer : arduino
Overriding Baud Rate : 38400
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xcd
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xcd
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xcd
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xcd
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xcd
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xcd
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xcd
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xcd
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xcd
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xcd
avrdude done. Thank you.
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.