树莓派Pico除了支持MicroPython开发环境,还支持C/C++开发环境,按照官方文档getting-started-with-pico,在windows下搭建C/C++开发环境搭建一直没有成功,VScode、Clion都尝试,均失败。最后还是在ubuntu下成功,我的ubuntu安装了Clion,按照教程很容易就成功了。主要用到的命令如下:
cd ~/
mkdir pico
cd pico
git clone -b master https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init
cd ..
git clone -b master https://github.com/raspberrypi/pico-examples.git
sudo apt update
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential
sudo apt install libstdc++-arm-none-eabi-newlib
设置好clion环境变量PICO_SDK_PATH。编译一个hello_usb例程,使用cdc串口输出:
|