hippy
Posts: 15198
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Arduino IDE support for RP2040 and Pico arrives

Sat Apr 10, 2021 1:07 pm

Arduino support for RP2040 and Pico -

https://github.com/arduino/ArduinoCore- ... /tag/2.0.0

Using Arduino IDE 1.9.0, and I'd expect it to work for any recent release, going through "Boards Manager", select type "all", filter "mbed" ...

Arduino Mbed OS Nano Boards
by Arduino
Boards included in this package: Arduino Nano 33 BLE, Arduino Nano 33 BLE Sense, Arduino Nano RP2040 Connect.

Arduino Mbed OS RP2040 Boards
by Arduino
Boards included in this package: Raspberry Pi Pico.

Haven't had time to install or try it out.

User avatar
scruss
Posts: 5617
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON

Re: Arduino IDE support for RP2040 and Pico arrives

Sat Apr 10, 2021 3:26 pm

Thanks for the heads-up. I installed "Arduino Mbed OS RP2040 Boards" via the Boards Manager in the Arduino 1.8.13 IDE. It's quite a big download. It may have other dependencies, but I've got so many other ARM core things in my Arduino setup that I may already have had them.

The "rp2040load" tool isn't documented, and by the looks of things is trying to upload something to /dev/ttyACM0 - which isn't a Pico on my machine. I did get Blink to compile and run by finding the uf2 file in /tmp/arduino_build_* and uploading it in the usual way. So yay, it works (kinda)!
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

hippy
Posts: 15198
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Arduino IDE support for RP2040 and Pico arrives

Sat Apr 10, 2021 5:10 pm

scruss wrote:
Sat Apr 10, 2021 3:26 pm
I did get Blink to compile and run by finding the uf2 file in /tmp/arduino_build_* and uploading it in the usual way. So yay, it works (kinda)!
That's good to hear. I'm not that familiar with the Arduino eco-system, and less so ARM's, so wasn't sure what this 'Mbed OS' categorisation meant, or meant in practice, whether that was "Arduino" as we know and love, or something else.

This seems a good explanation, well worth the read, and set my mind at rest -

https://blog.arduino.cc/2019/07/31/why- ... on-mbed-os
Mbed is a fully preemptive RTOS ... but you don’t have to worry if you just want to use it as an Arduino; setup() and loop() are in their usual place, and nobody will mess with your program while it’s running.

But if you want to do MORE ...

TheFlyingKipper
Posts: 1
Joined: Mon Apr 12, 2021 10:20 am

Re: Arduino IDE support for RP2040 and Pico arrives

Mon Apr 12, 2021 10:29 am

I had the same problem with uploads not working and found that when you install "Arduino Mbed OS RP2040 Boards" via the Boards Manager there's a post install script to add a udev rule which fails to run as it requires root privs.
I found this script in ~/.arduino15/packages/arduino/hardware/mbed_rp2040/2.0.0/post_install.sh
running it with sudo installs the rule then upload worked.

User avatar
scruss
Posts: 5617
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON

Re: Arduino IDE support for RP2040 and Pico arrives

Mon Apr 12, 2021 7:34 pm

Good catch: upload works as you described once the udev rule

Code: Select all

SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", MODE:="0666"
is in place and the Pico is in BOOTSEL mode ready to receive the upload.

Code: Select all

…
Sketch uses 80072 bytes (0%) of program storage space. Maximum is 16777216 bytes.
Global variables use 52920 bytes (19%) of dynamic memory, leaving 217416 bytes for local variables. Maximum is 270336 bytes.
/home/scruss/.arduino15/packages/arduino/tools/rp2040tools/1.0.2/rp2040load -v -D /tmp/arduino_build_565646/Blink.ino.elf 
rp2040load 1.0.1 - compiled with go1.15.8
Loading into Flash: [==============================]  100%
Big uploads, though, but I'm old to complain about it.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

asilgado
Posts: 6
Joined: Wed Mar 03, 2021 11:28 am

Re: Arduino IDE support for RP2040 and Pico arrives

Mon Apr 19, 2021 9:28 pm

Do you know if multicore functionality is supported?

dshaw619
Posts: 59
Joined: Thu Jan 04, 2018 7:06 am
Location: San Diego, California, USA

Re: Arduino IDE support for RP2040 and Pico arrives

Sun May 09, 2021 2:40 am

TheFlyingKipper wrote:
Mon Apr 12, 2021 10:29 am
I had the same problem with uploads not working and found that when you install "Arduino Mbed OS RP2040 Boards" via the Boards Manager there's a post install script to add a udev rule which fails to run as it requires root privs.
I found this script in ~/.arduino15/packages/arduino/hardware/mbed_rp2040/2.0.0/post_install.sh
running it with sudo installs the rule then upload worked.
Thank you for this. I was able to take a old, simple Arduino test sketch, change only the pin numbers, compile and run on a Pico. Now, on to more complex sketches.

melmerby37
Posts: 31
Joined: Fri May 28, 2021 1:21 pm
Location: Worcestershire

Re: Arduino IDE support for RP2040 and Pico arrives

Fri May 28, 2021 11:19 pm

Hi all
New member here with first post and no experience of using a Pico.

I have installed the Arduino IDE/RP2040 environment on my PC and tried a couple of simple Arduino sketches on the Pico.
(Blink/Fade etc.) They worked fine.
I then went on to try a little more complex sketch to drive a TMC2208 stepper driver which needs a library.

The question is: How do you include the C++ libraries that the sketch needs?

Cheers

Keith
Computer OS = Windows 10
RPi Pico, Zero 2 W
RPi 4 Model B
Various Arduinos

Return to “General”