Tuesday, April 8, 2025

Found a solution to building the code for the PICO processor - Google Colab

BATTLING VARIOUS BRICK WALLS WITH VISUAL CODE ON WINDOWS

I put in too many hours trying to figure out why I couldn't simply build the executable using the same files that had worked before on the Raspberry Pi OS. I kept getting complaints about build.ninja files, errors with CMake and other chases through a sea of barely helpful web hits and truly not useful documentation from RPi. 

As is often the case, the documentation works perfectly to build stupid simple programs to blink an LED or display Hello World, but doesn't cover all the details for a complex program with multiple source files, included libraries and the like. 

RASPBERRY PI ENVIRONMENT STOPPED WORKING FOR PICO BUILD

I had originally set up the Raspbian Linux on a RPi 5 to build PICO executables, using the documentation from RPi. This had worked very well indeed. However, this RPi was modified extensively for the Space Force Museum display project and issuing 'make' no longer produced the proper results. I needed to keep the display project version of the Pi around so I couldn't change it too significantly. 

FOUND SOME POINTERS TO USING GOOGLE COLAB TO INSTALL THE PI PICO TOOLS

Pete Warden produced a YouTube video about using Google's Colab and a link to fire up Colab and load a Jupityr notebook page to use it for PICO code production. This is the link if you are interested - Link to notebook page to run 

The page is set up to load the various Raspberry Pi PICO code examples and to compile the simple blink program, but it is easy to upload your source code and then issue the make command for your own project  - as I did. 

Firing up a colab gave me a running Linux image on my web browser. I could then pull down the tool chain for the Raspberry Pi PICO build system from github and install everything in the online image. I uploaded my source and related files that would not compile on Windows VS Code or on the modified Rasbian system. They built perfectly, producing the object files I needed to load onto the PICO processor and resume my testing. 

No comments:

Post a Comment