feat: add Seeed XIAO RP2040 Plus board support (#3428)
feat: add Seeed XIAO RP2040 Plus board support
fix: assign Wire1 to i2c0 with GPIO20/21 for independent I2C bus
Wire0 and Wire1 were both using i2c1 hardware, meaning they could not operate simultaneously. Move Wire1 to i2c0 on GPIO20 (SDA) and GPIO21 (SCL) so both I2C buses are independent.
Co-Authored-By: Claude noreply@anthropic.com
Co-authored-by: Claude noreply@anthropic.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Arduino-Pico
Raspberry Pi Pico Arduino core, for all RP2040 and RP2350 boards
This is a port of Arduino to the RP2040 (Raspberry Pi Pico processor) and RP2350 (Raspberry Pi Pico 2 processor). It uses the bare Raspberry Pi Pico SDK and a custom GCC 14.3/Newlib 4.5 toolchain and supports ARM and RISC-V cores.
Documentation
See https://arduino-pico.readthedocs.io/en/latest/ along with the examples for more detailed usage information.
Contributing
Read the Contributing Guide for more information on submitting pull requests and porting libraries or sketches to this core.
Supported Boards
Features
The RP2040 PIO state machines (SMs) are used to generate jitter-free:
Installing via Arduino Boards Manager
Windows-specific Notes
Please do not use the Windows Store version of the actual Arduino application because it has issues detecting attached Pico boards. Use the “Windows ZIP” or plain “Windows” executable (EXE) download direct from https://arduino.cc. and allow it to install any device drivers it suggests. Otherwise the Pico board may not be detected. Also, if trying out the 2.0 beta Arduino please install the release 1.8 version beforehand to ensure needed device drivers are present. (See #20 for more details.)
Linux-specific Notes
Installing Arduino using flatpak (often used by “App Stores” in various Linux distributions) will mean it has restricted access to the host. This might cause uploads to fail with error messages such as the following:
If you encounter this, you will need to either install Arduino in a different manner, or override the flatpak sandboxing feature using the following command, then restarting Arduino.
Installation
Open up the Arduino IDE and go to File->Preferences.
In the dialog that pops up, enter the following URL in the “Additional Boards Manager URLs” field:
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
Hit OK to close the dialog.
Go to Tools->Boards->Board Manager in the IDE
Type “pico” in the search box and select “Add”:
Installing via GIT
Windows Users: Before installing via
giton Windows, please read and follow the directions in this link. If Win32 long paths are not enabled, andgitnot configured to use them then there may be errors when attempting to clone the submodules.To install via GIT (for latest and greatest versions) under Linux or Mac:
For Windows, you need have Python already installed and git clone in a different path:
Uploading Sketches
To upload your first sketch, you will need to hold the BOOTSEL button down while plugging in the Pico to your computer. Then hit the upload button and the sketch should be transferred and start to run.
After the first upload, this should not be necessary as the
arduino-picocore has auto-reset support. Select the appropriate serial port shown in the Arduino Tools->Port->Serial Port menu once (this setting will stick and does not need to be touched for multiple uploads). This selection allows the auto-reset tool to identify the proper device to reset. Them hit the upload button and your sketch should upload and run.In some cases the Pico will encounter a hard hang and its USB port will not respond to the auto-reset request. Should this happen, just follow the initial procedure of holding the BOOTSEL button down while plugging in the Pico to enter the ROM bootloader.
Uploading Filesystem Images
The onboard flash filesystem for the Pico, LittleFS, lets you upload a filesystem image from the sketch directory for your sketch to use. Download the needed plugin from
To install, follow the directions in
For detailed usage information, please check the ESP8266 repo documentation (ignore SPIFFS related notes) available at
Uploading Sketches with Picoprobe/Debugprobe
If you have built a Raspberry Pi Picoprobe, you can use OpenOCD to handle your sketch uploads and for debugging with GDB.
Under Windows a local admin user should be able to access the Picoprobe port automatically, but under Linux
udevmust be told about the device and to allow normal users access.To set up user-level access to Picoprobes on Ubuntu (and other OSes which use
udev):The first line creates a device file in
/devmatching the USB vendor and product ID of the Picoprobe, and it enables global read+write permissions. The second line causesudevto load this new rule. The third line requests the kernel generate “device change” events that will cause our newudevrule to run.If for some reason the device file does not appear, manually unplug and re-plug the USB connection and check again. The output from
dmesgcan reveal useful diagnostics if the device file remains absent.Once Picoprobe permissions are set up properly, then select the board “Raspberry Pi Pico (Picoprobe)” in the Tools menu and upload as normal.
Debugging with Picoprobe, OpenOCD, and GDB
The installed tools include a version of OpenOCD (in the pqt-openocd directory) and GDB (in the pqt-gcc directory). These may be used to run GDB in an interactive window as documented in the Pico Getting Started manuals from the Raspberry Pi Foundation. Use the command line
./system/openocd/bin/openocd -f ./lib/rp2040/picoprobe_cmsis_dap.tclor./system/openocd/bin/openocd -f ./lib/rp2350/picoprobe_cmsis_dap.tclfrom thegitinstallation directory.Licensing and Credits
-Earle F. Philhower, III
earlephilhower@yahoo.com