tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.33k stars 905 forks source link

Raspberry Pi RP2040 microcontroller(s) #1587

Closed alankrantas closed 3 years ago

alankrantas commented 3 years ago

Something wild just appears:

https://www.raspberrypi.org/products/raspberry-pi-pico/ https://www.raspberrypi.org/products/raspberry-pi-pico/specifications/

Dual-core Cortex-M0+ (up to 133 MHz) with UF2 bootloader for 4$. Both Adafruit and Arduino will have their own RP2040 version as well.

deadprogram commented 3 years ago

Also see https://github.com/posborne/cmsis-svd/pull/123

aykevl commented 3 years ago

For anybody wanting to implement support, please take a look here: https://twitter.com/therealjpster/status/1353063981619965956?s=19 It contains important information on the reset sequence.

rajiv-kanchan commented 3 years ago

Just curious to know if anyone's working on this?

utahcon commented 3 years ago

Just curious to know if anyone's working on this?

Also see posborne/cmsis-svd#123

Nerzal commented 3 years ago

I'm happy to help out at this topic, as soon as my pi picos arrive. Ordered 4, but they are currently not deliverable.

deadprogram commented 3 years ago

https://www.cnx-software.com/2021/01/27/a-closer-look-at-raspberry-pi-rp2040-programmable-ios-pio/ looks helpful.

jeffmhastings commented 3 years ago

I've got the blinky1 example running on a raspberry pi pico. Right now the sleep timing is a bit off, and there are a number of things I still need to clean up before I would be ready to submit a PR. I hope to have one ready in the next couple of days though.

rammanokar commented 3 years ago

any progress on this..?

kurtmc commented 3 years ago

I just received a couple of these boards and I am keen to help out getting tinygo working. I am not really familiar with the process of adding new boards but I am happy to checkout forks and test them.

@jeffmhastings I have checked out your branch and managed to get the blinky example going, nice work!

I have noticed that putchar is not implemented yet (https://github.com/jeffmhastings/tinygo/blob/rp2040/src/runtime/runtime_rp2040.go#L144) I assume this is important for getting the println function to work. I had a quick go at implementing it but I am pretty new to micro controllers and it would probably be easier for someone who knows what they are doing :joy:

kenbell commented 3 years ago

I've got a couple (pico and an Adafruit RP2040 feather) - will take a look if no-one gets there first. Waiting on FedEx to deliver me a J-Link though. In my experience SWD and a logic analyzer makes this stuff so much easier.

deadprogram commented 3 years ago

Is anyone actively working on this? :crossed_fingers:

rythmkraze commented 3 years ago

Ive been working on a minimal integration, just enough to run the blinky1 example, based on the Pico C SDK.

deadprogram commented 3 years ago

@rythmkraze I assume you have seen the @jeffmhastings fork?

rythmkraze commented 3 years ago

@deadprogram Yes I have.

lexfrei commented 3 years ago

Any news?

bartekpacia commented 3 years ago

I second @lexfrei, where can we expect more info?😄

soypat commented 3 years ago

As far as I know there are two attempts at bringing RP2040 support to TinyGo. Both seem abandoned and have similar amount of progress

To anyone else who embarks on this apparently perilous journey, godspeed.

rythmkraze commented 3 years ago

branch pico has been updated. Contains minimal implementation to get blinky1 example working. Only supports the machine.Pin API and that too in PinOutput mode.

lexfrei commented 3 years ago

@rythmkraze is there any ETA? No pressure, just an interest.

aykevl commented 3 years ago

@rythmkraze can you please make a PR with that branch? That makes it a lot easier to review the changes for eventual inclusion. On a first glance, it looks pretty good although it needs a few changes to match the style of the rest of the TinyGo targets.

a-h commented 3 years ago

I noticed that the latest release has support, and it was added to the README.

https://github.com/tinygo-org/tinygo/releases/tag/v0.19.0

Is this... closed?

deadprogram commented 3 years ago

Yes, I think we can close this issue now. Thank you everyone who helped get this added!