Closed RaphaelTetreault closed 8 months ago
Have you tried doing this outside of WSL, following the Windows instructions in section 9.2 of https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf ? WSL isn't something that we provide official support for.
I did try the Windows native setup and it does work which is great. I realized after that I had piecemealed the instructions rather than using the provided document which was a poor choice on my part.
So I decided to redo the steps in the document you provided in WSL and it did work. So it looks like some of my steps were causing the issue (probably setting CXX).
For others who might find themselves here, I recommend following the steps in Getting Started with Raspberry Pi Pico (PDF) Chapter 2.1 (the previously mentioned document by @lurch).
With the caveat that this might go outdated at any point, here are the instructions I followed which worked in Ubuntu in WSL.
# Navigate to where you wish to install the Pico SDK and Pico Examples
cd ~/
mkdir pico
cd pico
# Clone the Pico repositories
git clone https://github.com/raspberrypi/pico-sdk.git --branch master
cd pico-sdk
git submodule update --init
cd ..
git clone https://github.com/raspberrypi/pico-examples.git --branch master
# Update all relevant packages
sudo apt update
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential libstdc++-arm-none-eabi-newlib
# Go to Pico Examples and prepare build
cd pico-examples
mkdir build
cd build
# Set environment variables (temporary) using relative path from ~/pico/pico-examples/build/
export PICO_SDK_PATH=../../pico-sdk
# Finally, build
cmake ..
make
Thanks for the support, @lurch!
I guess folks are just too used to the official documentation being useless. 😫
I think where I was lead astray was that I was expecting command-line instructions for setup in pico-examples
the same as there was in pico-sdk
. Looking back now, it is literally the first link in the examples README, though.
It might just be a user experience thing. I assumed consistency between READMEs for whatever reason. Perhaps a bit of indication as to where to look in the document would benefit?
I'm used to HTML documentation, either generated from source for API or written guides. For me, being dropped into a PDF and reading content headings is not as searchable as web content.
I'm used to HTML documentation, either generated from source for API
We have API documentation (in HTML format) at https://www.raspberrypi.com/documentation/pico-sdk/
I have been trying to compile the Pico examples using Ubuntu in WSL2 on a Windows 10 machine. I can't seem to get it working despite starting from a clean distro image. I will outline the steps taken which I believe ought to work based on the resources I've read online.
Image is installed, you create an account and password. Now you are in the Ubuntu image.
make
will fail citing the compiler is broken. Installingbuild-essential
will seemingly correct some aspect (perhaps something reliant ong++
), but will then "fail spectacularly" by spewing a ton of warnings / errors to the terminal, all seemingly related to failed linking.I've also tried tinkering with the specific compiler
CXX
points at, such as specifyingarm-none-eabi-gcc
but errors are similar/persistent.I've been at this for a few days now, and I have not been able to find answers.