avr-hal icon indicating copy to clipboard operation
avr-hal copied to clipboard

Add support for Adafruit Circuit Playground Classic

Open dbrgn opened this issue 1 year ago • 1 comments

This should add support for the Adafruit Circuit Playground Classic (atmega32u4): https://www.adafruit.com/product/3000

The place where I'm stuck is uploading. Flashing via ravedude results in:

avrdude error: programmer is not responding
avrdude warning: attempt 1 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 2 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 3 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 4 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 5 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 6 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 7 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 8 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 9 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 10 of 10: not in sync: resp=0x00
avrdude error: unable to open programmer arduino on port /dev/ttyACM0

avrdude done.  Thank you.

When I run the avrdude command manually:

avrdude -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/home/danilo/Projects/avr-hal/target/avr-atmega32u4/debug/circuit-playground-classic-blink.elf:i

...I get the same result.

However, flashing via Arduino IDE works fine. When I look at Arduino IDE logs, the invocation is the same, but there's a reset sequence first:

Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, /dev/ttyS0, /dev/ttyUSB0, /dev/ttyUSB1, } / {/dev/ttyS0, /dev/ttyUSB0, /dev/ttyUSB1, } => {}
PORTS {/dev/ttyS0, /dev/ttyUSB0, /dev/ttyUSB1, } / {/dev/ttyS0, /dev/ttyUSB0, /dev/ttyUSB1, } => {}
PORTS {/dev/ttyS0, /dev/ttyUSB0, /dev/ttyUSB1, } / {/dev/ttyACM0, /dev/ttyS0, /dev/ttyUSB0, /dev/ttyUSB1, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
//bin/avrdude -C//etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/arduino_build_486653/Blink.ino.hex:i
...
avrdude done.  Thank you.

Does ravedude support such a reset sequence somehow?

dbrgn avatar Dec 20 '23 11:12 dbrgn

Does ravedude support such a reset sequence somehow?

It doesn't right now, but I guess we could add one. Is it really enough to just open the port at 1200 baud and close it again? ravedude already uses the serialport crate for serial console access so this shouldn't be difficult to add. I'd just make it another setting that boards can opt into.

Rahix avatar Dec 25 '23 01:12 Rahix