用CLion配合PlatformIO开发树莓派Pico(RP2040)
环境
- Windows 11
- CLion 2024.3
- Python 3.12.3
步骤
安装PlatformIO
执行如下命令
1 | # change directory to the folder where is located downloaded "get-platformio.py" |
编辑名为
Path的系统环境变量并追加C:\Users\UserName\.platformio\penv\Scripts\列表开头的路径(请将UserName替换为帐户名)。
安装PlatformIO插件
Go to Settings | Plugins and switch to Marketplace.

Search for PlatformIO for CLion and click Install.

After the installation is finished, click Restart IDE.
创建PlatformIO项目
选择自己的board或者framework,创建项目;

经过较长时间的等待后,成功创建工程,并生成了Arduino的”stub code”。

实现upload自动上传项目(坑)
一直报错Error 1,最后摸索出来以下这个步骤,百分百成功。
下载zadig 2.5版本,注意一定要是2.5版本,不能太新;
pico板进入bootloader,然后打开zadig,勾选
Options里的List All Devices;为RP2 Boot(Interface 1)安装WinUSB驱动;

进入CLion,为pico随便编译一个程序,在
./.pio/build/pico/里找到firmware.uf2,复制进pico的MSC设备里;然后再使用PlatformIO里的upload就不会报错了。
参考链接
PlatformIO | CLion Documentation
Installer Script (Recommended) — PlatformIO latest documentation
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
