
arduino-pico v6.1.0
Raspberry Pi Pico Arduino核心,适用于所有RP2040和RP2350开发板
Arduino-Pico
Raspberry Pi Pico Arduino 核心,适用于所有 RP2040 和 RP2350 开发板
这是 Arduino 向 RP2040(Raspberry Pi Pico 处理器)和 RP2350(Raspberry Pi Pico 2 处理器)的移植。它使用裸机 Raspberry Pi Pico SDK 和自定义 GCC 14.3/Newlib 4.5 工具链,并支持 ARM 和 RISC-V 核心。
文档
更多详细使用信息,请参阅 https://arduino-pico.readthedocs.io/en/latest/ 以及示例。
贡献
阅读贡献指南以获取有关提交拉取请求以及将此核心移植到库或项目的更多信息。
支持的开发板
- Raspberry Pi Pico
- Raspberry Pi Pico W
- Raspberry Pi Pico 2
- Raspberry Pi Pico 2W
- 0xCB Helios
- Adafruit Feather RP2040
- Adafruit Feather RP2040 SCORPIO
- Adafruit Floppsy RP2040
- Adafruit ItsyBitsy RP2040
- Adafruit KB2040
- Adafruit Macropad RP2040
- Adafruit Metro RP2040
- Adafruit Metro RP2350
- Adafruit QTPy RP2040
- Adafruit STEMMA Friend RP2040
- Adafruit Trinkey RP2040 QT
- Amken Bunny
- Amken Revelop
- Amken Revelop Plus
- Amken Revelop eS
- Architeuthis Flux Jumperless
- Architeuthis Flux Jumperless V5
- Arduino Nano RP2040 Connect
- ArtronShop RP2 Nano
- BIGTREETECH SKR-Pico
- Breadstick Raspberry
- BridgeTek IDM2040-7A
- BridgeTek IDM2040-43A
- Cytron IRIV IO Controller
- Cytron Maker Pi RP2040
- Cytron Maker Nano RP2040
- Cytron Maker Uno RP2040
- Cytron Motion 2350 Pro
- Datanoise PicoADK v1
- Datanoise PicoADK v2 (RP2350)
- Degz Suibo RP2040
- DeRuiLab FlyBoard2040 Core
- DFRobot Beetle RP2040
- ElectronicCats Hunter Cat NFC
- EVN Alpha
- ExtremeElectronics RC2040
- GeeekPi RP2040 Plus
- GroundStudio Marble Pico
- Invector Labs Challenger RP2040 WiFi
- Invector Labs Challenger RP2040 WiFi/BLE
- Invector Labs Challenger RP2040 WiFi6/BLE
- Invector Labs Challenger NB RP2040 WiFi
- Invector Labs Challenger RP2040 LTE
- Invector Labs Challenger RP2040 LoRa
- Invector Labs Challenger RP2040 SubGHz
- Invector Labs Challenger RP2040 SD/RTC
- Invector Labs Challenger RP2040 UWB
- Invector Labs Challenger+ RP2350 BConnect
- Invector Labs Challenger+ RP2350 WiFi/BLE
- Invector Labs Challenger+ RP2350 NB-IoT
- Invector Labs RPICO32
- Melopero Cookie RP2040
- Melopero Shake RP2040
- METE HOCA Akana R1
- Makerbase MKSTHR36
- Makerbase MKSTHR42
- MyMakers RP2040
- Neko Systems BL2040 Mini
- Newsan Archi
- nullbits Bit-C PRO
- Olimex Pico2XL
- Olimex Pico2XXL
- Olimex RP2040-Pico30
- PicoLume Transceiver
- Pimoroni PGA2040
- Pimoroni Pico Plus 2
- Pimoroni Pico Plus 2W
- Pimoroni Plasma2040
- Pimoroni Plasma2350
- Pimoroni Plasma2350W
- Pimoroni Servo2040
- Pimoroni Tiny2040
- Pimoroni Tiny2350
- Pintronix PinMax
- PCBCupid Glyph 2040
- PCBCupid Glyph Mini 2040
- RAKwireless RAK11300
- Redscorp RP2040-Eins
- Redscorp RP2040-ProMini
- Sea-Picro
- Seeed Indicator RP2040
- Seeed XIAO RP2040
- Seeed XIAO RP2040 Plus
- Seeed XIAO RP2350
- Silicognition RP2040-Shim
- Solder Party RP2040 Stamp
- Solder Party RP2350 Stamp
- Solder Party RP2350 Stamp XL
- Soldered Electronics NULA Ethernet W55RP20
- Soldered Electronics NULA RP2350
- SparkFun IoT RedBoard RP2350
- SparkFun MicroMod RP2040
- SparkFun ProMicro RP2040
- SparkFun ProMicro RP2350
- SparkFun Thing Plus RP2040
- SparkFun Thing Plus RP2350
- SparkFun XRP Controller
- uPesy RP2040 DevKit
- VCC-GND YD-RP2040
- Viyalab Mizu RP2040
- Waveshare RP2040 Zero
- Waveshare RP2040 One
- Waveshare RP2040 Plus
- Waveshare RP2040 LCD 0.96
- Waveshare RP2040 LCD 1.28
- Waveshare RP2040 LoRa
- Waveshare RP2040 Matrix
- Waveshare RP2040 PiZero
- Waveshare RP2350 Zero
- Waveshare RP2350 PiZero
- Waveshare RP2350 Plus
- Waveshare RP2350 Plus W
- Waveshare RP2350 LCD 0.96
- WIZnet W5100S-EVB-Pico
- WIZnet W5100S-EVB-Pico2
- WIZnet W5500-EVB-Pico
- WIZnet W5500-EVB-Pico2
- WIZnet W55RP20-EVB-Pico
- WIZnet W6300-EVB-Pico
- WIZnet W6300-EVB-Pico2
- WIZnet WizFi360-EVB-Pico
- 通用 RP2040(可配置闪存、IO 引脚)
- 通用 RP2350(可配置闪存、IO 引脚)
特性
- Adafruit TinyUSB Arduino(USB 鼠标、键盘、闪存驱动器、通用 HID、CDC 串口、MIDI、WebUSB 等)
- PicoW 上的蓝牙(经典和 BLE),支持键盘、鼠标、摇杆和虚拟串口
- 蓝牙经典和 BLE HID 主机模式(连接 BT 键盘、鼠标或摇杆)
- 通用 Arduino USB 串口、键盘、摇杆和鼠标模拟
- WiFi(Pico W、基于 ESP32 的 ESPHost、Atmel WINC1500)
- 以太网(有线 WizNet W6300、WizNet W6100、WizNet W5500、WizNet W5100、ENC28J60)
- HTTP 客户端和服务器(WebServer)
- SSL/TLS/HTTPS
- 空中升级(OTA)
- 文件系统(LittleFS 和 SD/SDFS)
- 多核心支持(setup1() 和 loop1())
- FreeRTOS SMP 支持
- 从菜单进行超频和降频
- digitalWrite/Read、shiftIn/Out、tone、analogWrite(PWM)/Read、温度
- 使用 DMA 和内置 ADC 的模拟立体声音频输入
- 使用 PWM 硬件的模拟立体声音频输出
- PicoW 上的蓝牙 A2DP 音频源(输出)和接收器(输入)
- 用于数据记录器的 USB 驱动器模式(SingleFileDrive、FatFSUSB)
- 外设:SPI 主/从、Wire(I2C) 主/从、双路 UART、模拟 EEPROM、I2S 音频输入/输出、舵机
- 通过 USB 串口的 printf(即调试)输出
- 透明使用 PSRAM 全局变量和堆(仅 RP2350)
- RP2350 的 ARM 或 RISC-V(Hazard3)支持
- 半主机串行和文件系统访问
- GPROF 性能分析支持
RP2040 PIO 状态机(SM)用于生成无抖动的:
- 舵机
- 音调
- I2S 输入
- I2S 输出
- 软件 UART(串口)
- 软件 SPI
通过 Arduino 开发板管理器安装
Windows 特别说明
请勿使用 Windows 商店版本的 Arduino 应用程序,因为它在检测连接的 Pico 开发板时存在问题。请使用从 https://arduino.cc 直接下载的“Windows ZIP”或普通“Windows”可执行文件(EXE),并允许其安装建议的所有设备驱动程序。否则,Pico 开发板可能无法被检测到。此外,如果尝试使用 Arduino 2.0 测试版,请先安装 1.8 正式版,以确保必要的设备驱动程序已存在。(更多详情请参见 #20。)
Linux 特别说明
通过 flatpak(通常被各种 Linux 发行版的“应用商店”使用)安装 Arduino 会导致其访问宿主机受限。这可能导致上传失败,并出现类似以下错误信息:
Scanning for RP2040 devices
...
No drive to deploy.
如果遇到此问题,您需要以其他方式安装 Arduino,或使用以下命令覆盖 flatpak 沙箱功能,然后重新启动 Arduino。
flatpak override --user --filesystem=host:ro cc.arduino.IDE2
安装
打开 Arduino IDE,进入 文件->首选项。
在弹出的对话框中,在“附加开发板管理器网址”字段中输入以下 URL:
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

点击“确定”关闭对话框。
在 IDE 中进入 工具->开发板->开发板管理器
在搜索框中输入“pico”并选择“添加”:

通过 GIT 安装
Windows 用户: 在 Windows 上通过 git 安装之前,请阅读并遵循此链接中的说明。如果未启用 Win32 长路径,并且 git 未配置为使用长路径,则在尝试克隆子模块时可能会出错。
要通过 GIT 安装(获取最新版本),在 Linux 或 Mac 下:
mkdir -p ~/Arduino/hardware/pico
git clone https://github.com/earlephilhower/arduino-pico.git ~/Arduino/hardware/pico/rp2040
cd ~/Arduino/hardware/pico/rp2040
git submodule update --init --recursive
cd tools
python3 ./get.py
对于 Windows,您需要已安装 Python,并在不同路径下进行 git 克隆:
mkdir %USERPROFILE%\Documents\Arduino\hardware\pico
git clone https://github.com/earlephilhower/arduino-pico.git %USERPROFILE%\Documents\Arduino\hardware\pico\rp2040
cd %USERPROFILE%\Documents\Arduino\hardware\pico\rp2040
git submodule update --init --recursive
cd tools
python .\get.py
上传程序
要上传您的第一个程序,您需要在将 Pico 插入电脑的同时按住 BOOTSEL 按钮。然后点击上传按钮,程序将被传输并开始运行。
首次上传后,通常无需再按住 BOOTSEL 按钮,因为 arduino-pico 核心具有自动复位支持。在 Arduino 工具->端口->串口菜单中选择适当的串口(此设置将保持不变,多次上传无需再更改)。此选择允许自动复位工具识别正确的设备进行复位。然后点击上传按钮,您的程序将上传并运行。
在某些情况下,Pico 可能会遇到硬死机,其 USB 端口将不响应自动复位请求。如果发生这种情况,只需按照初始步骤,在插入 Pico 时按住 BOOTSEL 按钮进入 ROM 引导加载程序。
上传文件系统镜像
Pico 的板载闪存文件系统 LittleFS 允许您从程序目录上传文件系统镜像供程序使用。从以下位置下载所需插件:
安装请按照以下说明操作:
有关详细使用信息,请查阅 ESP8266 仓库文档(忽略 SPIFFS 相关部分),地址为:
使用 Picoprobe/Debugprobe 上传程序
如果您已经构建了 Raspberry Pi Picoprobe,您可以使用 OpenOCD 处理程序上传,并使用 GDB 进行调试。
在 Windows 下,本地管理员用户应能自动访问 Picoprobe 端口,但在 Linux 下,必须通过 udev 告知设备并允许普通用户访问。
要在 Ubuntu(及其他使用 udev 的操作系统)上设置用户级访问 Picoprobe:
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", MODE="660", GROUP-"plugdev"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000a", MODE="660", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000f", MODE="660", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
sudo udevadm control --reload
sudo udevadm trigger -w -s usb
第一行在 /dev 中创建一个与 Picoprobe 的 USB 厂商和产品 ID 匹配的设备文件,并启用全局读写权限。第二行使 udev 加载此新规则。第三行请求内核生成“设备变更”事件,这将触发我们的新 udev 规则运行。
如果由于某种原因设备文件未出现,请手动拔下并重新插入 USB 连接后再检查。如果设备文件仍然缺失,dmesg 的输出可以揭示有用的诊断信息。
一旦 Picoprobe 权限设置正确,请在工具菜单中选择开发板“Raspberry Pi Pico (Picoprobe)”,然后正常上传。
使用 Picoprobe、OpenOCD 和 GDB 调试
已安装的工具包括一个版本的 OpenOCD(位于 pqt-openocd 目录)和 GDB(位于 pqt-gcc 目录)。它们可用于在交互窗口中运行 GDB,如 Raspberry Pi 基金会的 Pico 入门手册所述。从 git 安装目录中使用命令行 ./system/openocd/bin/openocd -f ./lib/rp2040/picoprobe_cmsis_dap.tcl 或 ./system/openocd/bin/openocd -f ./lib/rp2350/picoprobe_cmsis_dap.tcl。
许可与致谢
- Arduino IDE 和 ArduinoCore-API 由 Arduino 团队开发和维护。IDE 基于 GPL 许可。
- RP2040 GCC 工具链 基于 GPL 许可。
- Pico-SDK 由 Raspberry Pi (Trading) Ltd 开发,基于 BSD 3-Clause 许可。
- Arduino-Pico 核心文件基于 LGPL 许可。
- LittleFS 库由 ARM Limited 编写,基于 BSD 3-clause 许可 发布。
- UF2CONV.PY 由 Microsoft Corporation 开发,基于 MIT 许可。
- 网络和文件系统代码取自 ESP8266 Arduino Core,基于 LGPL 许可。
- AP 主机模式的 DHCP 服务器来自 Micropython 项目,基于 MIT 许可发布。
- FreeRTOS 版权归 Amazon.com, Inc. 或其关联公司所有,基于 MIT 许可发布。
- lwIP 版权归瑞典计算机科学研究所所有,基于 BSD 许可。
- BearSSL 库由 Thomas Pornin 编写,基于 MIT 许可 发布。
- UZLib 版权 (c) 2003 Joergen Ibsen,基于 zlib 许可发布。
- LEAmDNS 版权归多位作者所有,基于 MIT 许可发布。
- http-parser 版权归 Joyent, Inc. 及其他 Node 贡献者所有。
- WebServer 代码修改自 ESP32 WebServer,版权 (c) 2015 Ivan Grokhotkov 及其他作者。
- Xoshiro-cpp 版权 (c) 2020 Ryo Suzuki,基于 MIT 许可发布。
- FatFS 底层文件系统 代码版权 (C) 2024, ChaN,保留所有权利。
- 来自 Espressif 分支的 PSRAM TLSF 内存管理器,基于 Matthew Conte 的原始版本,版权归 Matthew Conte 所有,基于 MIT 许可。
- ESPHost 库 由其维护者基于 LGPL 许可发布。
-Earle F. Philhower, III
[email protected]