greatscottgadgets / apollo

microcontroller-based FPGA / JTAG programmer
BSD 3-Clause "New" or "Revised" License
63 stars 30 forks source link

Add support for Raspberry Pi Pico RP2040 board #12

Closed cyber-murmel closed 8 months ago

cyber-murmel commented 1 year ago

This PR provides the files to run apollo on the Raspberry Pi Pico.

Compile with

export APOLLO_BOARD=raspberry_pi_pico
make -C firmware clean
make -C firmware

Pin Map

    TMS_GPIO = 5,
    TDI_GPIO = 3, // MOSI
    TDO_GPIO = 4, // MISO
    TCK_GPIO = 6, // SCK

I plan on also adding code for the Adafruit QT Py RP2040.

Please feel free to edit the code where you see fit.

mndza commented 1 year ago

Thank you for your contribution! We would like to merge this but I'm having some problems during the build process. This PR seems to expect a Pico SDK inside the TinyUSB repository, which I did not manage to find. I also get error messages providing an external path to it. Are you willing to take a quick look?

cyber-murmel commented 1 year ago

RP2040 should be supported as of tinyusb 0.14.0 Maybe this PR needs to be rebased on a commit after https://github.com/greatscottgadgets/apollo/pull/13 If that doesn't help, I might make some time to get another look at it.

mossmann commented 11 months ago

I've marked this as a draft as it requires some rebasing.

cyber-murmel commented 8 months ago

I got around to work on this again. The new branch is essentially the code form this branch copied over to master and adapted where required. It's at a stage where it compiles successfully for rp2040 targets and I confirmed the result by uploading blink.

Currently there is platform dependent code in button.c and usb_switch.c due to #include <hal/include/hal_gpio.h>. I think this could be resolved by either moving both files to the boards code (like led.c) or by enabling this include with some SAMD dependent define. I'd guess that moving it to the platform dependent code would be the preferred solution, but wanted to ask for your input.