adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.13k stars 1.22k forks source link

SAMD21 Xplained Pro support #2425

Open riegaz opened 4 years ago

riegaz commented 4 years ago

Is this Atmel Evaluation Kit supported? I was not able to get it going.

Any help is welcome.

ladyada commented 4 years ago

not yet but it ought to work with internal storage (unless it has a SPI flash on it?)

riegaz commented 4 years ago

I didn't get it working by flashing any bootloader onto it. It has a serial flash installed but I would prefer it working qith the internal storage.

ladyada commented 4 years ago

ok start with the UF2 bootloader, you can probably look at the Trinket M0 or Feather M0 Basic for inspiration :)

tannewt commented 4 years ago

Check out this guide about adding new boards to CircuitPython: https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython

barawn commented 4 years ago

I've gotten this working (although I just grabbed USB VID/PIDs, so don't ask for the binary :) ). The UF2 portion is painless - just copy over a board_config.h from the Feather M0, change LED_PIN to PB_30 (and keep in mind it's inverted, so it'll be opposite whatever the Feather's does), change CHIP_VARIANT to SAMD21J18A, and build it.

The CircuitPython part requires fixes in the asf4 repository (this has an open pull request to fix it, should be merged soon I imagine) and the samd-peripherals repository (already fixed in master, not updated in circuitpython master).

Once that's done creating a board with CHIP_VARIANT = SAMD21J18A builds fine. The SPI flash is an AT25DF081A, on PB22/PB16/PB23/PA13 (MOSI/MISO/SCK/CS), so just update those in mpconfigboard.mk/mpconfigboard.h.

glucee commented 4 years ago

@barawn can you share a bin file for that.

tannewt commented 4 years ago

@barawn Feel free to mention me on anything pending that still needs to be reviewed. I can provide a USB VID and PID too. So, feel free to make a PR and we can sort things out there.