Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Adafruit Circuit Playground Classic #467

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dbrgn
Copy link

@dbrgn dbrgn commented Dec 20, 2023

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?

@Rahix
Copy link
Owner

Rahix commented Dec 25, 2023

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.

Some("Reset the board by pressing the reset button once.")
}

fn dude_options(&self) -> avrdude::AvrdudeOptions {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nees to be avrdude_options :)

Suggested change
fn dude_options(&self) -> avrdude::AvrdudeOptions {
fn avrdude_options(&self) -> avrdude::AvrdudeOptions {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants