arduino / arduino/ArduinoCore-mbed

Can't program via Arduino IDE the Pi Pico in linux

Open
#573 2 comments 0 reactions 0 assignees View on GitHub
RP2040 waiting for feedback
Dominant language
C
Stars
411
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Trying to build & upload the blinky example in Ubuntu 20.04.5 LTS, kernel 5.4.0-113-generic x64.
Only partial success.

I connected the Raspberry PI Pico board keeping pressed the Bootload button.
I do not have automount feature enabled.
Here are the outputs of "sudo lsblk -o NAME,TYPE,FSTYPE,LABEL,UUID,MOUNTPOINT,SIZE,VENDOR,MODEL,SERIAL" and "lsusb" commands:

lsblk:
sdd disk 128M RPI RP2 E0C912952D5
└─sdd1 part vfat RPI-RP2 000B-33DC 128M

lsusb:
Bus 002 Device 114: ID 2e8a:00c0

I started Arduino IDE 1.8.13 (I previously installed the "Arduino Mbed OS RP2040 Boards" and selected the Raspberry PI Pico as target board), opened the blinky example, pressed the upload button. Compilation was fine but the upload stage failed:

...
/home/lubu64/.arduino15/packages/arduino/tools/rp2040tools/1.0.6/rp2040load -v -D /tmp/arduino_build_932857/Blink.ino.elf
rp2040load 1.0.6 - compiled with go1.16.2
.....................
An error occurred while uploading the sketch

So I mounted the Pico board in /media/RPI-RP2 and copied in it the binary (Blink.ino.uf2) found in temp directory /tmp/arduino_build_932857 (from IDE log).

The board rebooted automatically and the led started to blink.
It worked, but so the Integrated Development Environment is not so integrated...

After that, I restarted the Arduino IDE. The serial port "/dev/ttyACM0 (Raspberry PI Pico)" showed up in Tools menu and menu entry Tools->Get Board Info worked as expected so I tried again to upload the sketch.
No success, same error as before.

I tried (almost) any combination of settings, starting the board with/without the bootload button pressed, mounting or not the Pico in /media/RPI-RP2 as root or as myself, adding/removing the "upload_port=/media/RPI-RP2" (or "upload_port=/dev/ttyACM0") row in Arduino IDE preferences.txt, as suggested in [Upload port required](https://github.com/platformio/platform-raspberrypi/issues/2), restarting IDE countless times, etc.
No success. The IDE produces a working binary but it seems impossible to upload it to the board inside the IDE.

Any suggestions welcome!

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the upload failure on Ubuntu 20.04.5 with Arduino IDE 1.8.13, the Raspberry Pi Pico, and the Arduino Mbed OS RP2040 Boards package. Start with the rp2040tools command shown in the IDE log and compare it with the manual UF2 copy that succeeds. Done means the IDE can compile and upload Blink without manual mounting or copying.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, raspberry-pi
Domain
embedded-iot, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.