One year on: is the iPad any better for Raspberry Pi Pico development?

Imagine my surprise when I connected a Raspberry Pi Pico in UF2 mode to my iPad and it mounted as an accessible drive. Yes, iPadOS now supports UF2 drives, something it did not do just over a year ago when I last reported on my efforts to use an iPad as a mobile Pico development system.

iPadOS' Files app views a mounted Raspberry Pi Pico
iPadOS 16.3.1’s Files app presents a boot-mode Raspberry Pi Pico

Back then, about the only Pico work you could do on an iPad was with a Pico running CircuitPython. This augmented version of MicroPython presents the Pico it’s running on as a FAT32 USB drive that’s always mounted — though it doesn’t have to be. That being the case, you can write code in an iPadOS app like Pythonista and copy it across to the Pico.

However, the newly introduced support for FAT16, the basis for UF2 drives, raises the prospect of C/C++ Pico development. Are there grounds of optimism? Yes, but it will take some time for hopes to be realised.

Development on an iPad is possible — there are plenty of tools to help you write code — but you run into barriers when you want to compile and debug that code. Apple’s Playgrounds app, for example, provides both features but only supports Swift, so you can’t build the Pico SDK, which is written in C. The logical alternative is to install the standard ARM cross-compiler toolchain and build Pico C/C++ apps at the command line.

Is there an iPad command line? With certain apps there is. I use iSH, which provides a local terminal running a Bash-ish shell called Alpine and includes a bunch of standard Unix commands and utilities. Its sandboxed filesystem is nonetheless accessible through the Files app. How does it fare?

Terminal Experiences

iSH’s package manager is apk, and so I started out installing the tools I’d need: git, cmake and arm-none-eabi-gcc. All three are available and I installed them with apk add. I was feeling very positive, a sense of excitement building. And then I tried to clone a repo.

This process started well — I used a public repo to begin with — and the code downloaded, but the resolving deltas phase got a small way in and then froze. It may be a bug in git or, more likely, a compatibility issue. Either way, it’s a blocker, and more work will be required before I can use it to install the Pico SDK and a code repo.

How about sideloading? Not much joy there, either, I’m afraid. iSH’s underlying system is the BusyBox VM running x86 code. Transferring archives via the Files app was clumsy but doable, but extracting the archive only unpacked some elements. In the end, I copied across the unarchived repo (after first renaming dotfiles, which Files will not copy), restored hidden files’ correct names, and proceeded to install the repo’s submodules.

iSH chucks in the towel as I try to initialise a repo’s submodules
iSH chucks in the towel as I try to initialise a repo’s submodules

Which crashed iSH or, more accurately, its underlying shell. I may try copying over the fully installed repo, but to be honest, I’m no longer sure it’s worth the effort.

My workflow has now become to use Termius to SSH into a headless Raspberry Pi I use for a variety of tasks, such as Pi-Hole. I clone repos and build them on the Pi, and then copy the build product to the iPad with Termius. The Files app can then be used to transfer the .uf2 to the mounted Pico. Yank the Pico from the iPad and you’re ready to go.

You might reasonably ask why I don’t just do everything on the Pi? A fair question, more so since it doesn’t provide the truly mobile development process I envisage — though it might should I make the Pi accessible over the Internet. To be honest, if I’m at home, I’d sooner work on my MacBook Pro than the iPad, though it’s clearly not as mobile as the tablet when I’m travelling.

The Way Forward

What would solve all this? A native terminal app for the iPad — ie. one running ARM64 code — to which I can install git, cmake and the ARM toolchain with apt or something like it. That’ll allow me to clone git repos and populate their submodules. It can even operate within a sandbox — I don’t need full-disk access, only support for Files so I can open the filesystem and copy a built .uf2 file to the mounted Pico.

Incidentally, a-Shell, with its emphasis on compiling C/C++ to WebAssembly, is not the answer, but is shows promise.

A year ago, mounting the Pico was impossible. Maybe next year the terminal part will be available too.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s