1.. zephyr:board:: rp2040_zero 2 3Overview 4******** 5 6RP2040-Zero, A Low-Cost, High-Performance Pico-Like MCU Board Based On Raspberry Pi Microcontroller RP2040. 7 8Hardware 9******** 10- RP2040 microcontroller chip designed by Raspberry Pi in the United Kingdom. 11- Dual-core Arm Cortex M0+ processor, flexible clock running up to 133 MHz. 12- 264KB of SRAM, and 2MB of on-board Flash memory. 13- USB-C connector, keeps it up to date, easier to use. 14- The castellated module allows soldering direct to carrier boards. 15- USB 1.1 with device and host support. 16- Low-power sleep and dormant modes. 17- Drag-and-drop programming using mass storage over USB. 18- 29 × multi-function GPIO pins (20× via edge pinout, others via solder points). 19- 2 × SPI, 2 × I2C, 2 × UART, 4 × 12-bit ADC, 16 × controllable PWM channels. 20- Accurate clock and timer on-chip. 21- Temperature sensor. 22- Accelerated floating-point libraries on-chip. 23- 8 × Programmable I/O (PIO) state machines for custom peripheral support. 24 25Supported Features 26================== 27 28The ``rp2040_zero`` board target supports the following hardware features: 29 30.. list-table:: 31 :header-rows: 1 32 33 * - Peripheral 34 - Kconfig option 35 - Devicetree compatible 36 * - NVIC 37 - N/A 38 - :dtcompatible:`arm,v6m-nvic` 39 * - UART 40 - :kconfig:option:`CONFIG_SERIAL` 41 - :dtcompatible:`raspberrypi,pico-uart` 42 * - GPIO 43 - :kconfig:option:`CONFIG_GPIO` 44 - :dtcompatible:`raspberrypi,pico-gpio` 45 * - ADC 46 - :kconfig:option:`CONFIG_ADC` 47 - :dtcompatible:`raspberrypi,pico-adc` 48 * - I2C 49 - :kconfig:option:`CONFIG_I2C` 50 - :dtcompatible:`snps,designware-i2c` 51 * - SPI 52 - :kconfig:option:`CONFIG_SPI` 53 - :dtcompatible:`raspberrypi,pico-spi` 54 * - USB Device 55 - :kconfig:option:`CONFIG_USB_DEVICE_STACK` 56 - :dtcompatible:`raspberrypi,pico-usbd` 57 * - HWINFO 58 - :kconfig:option:`CONFIG_HWINFO` 59 - N/A 60 * - Watchdog Timer (WDT) 61 - :kconfig:option:`CONFIG_WATCHDOG` 62 - :dtcompatible:`raspberrypi,pico-watchdog` 63 * - PWM 64 - :kconfig:option:`CONFIG_PWM` 65 - :dtcompatible:`raspberrypi,pico-pwm` 66 * - Flash 67 - :kconfig:option:`CONFIG_FLASH` 68 - :dtcompatible:`raspberrypi,pico-flash` 69 * - Clock controller 70 - :kconfig:option:`CONFIG_CLOCK_CONTROL` 71 - :dtcompatible:`raspberrypi,pico-clock-controller` 72 * - UART (PIO) 73 - :kconfig:option:`CONFIG_SERIAL` 74 - :dtcompatible:`raspberrypi,pico-uart-pio` 75 * - SPI (PIO) 76 - :kconfig:option:`CONFIG_SPI` 77 - :dtcompatible:`raspberrypi,pico-spi-pio` 78 79Pin Mapping 80=========== 81 82The peripherals of the RP2040 SoC can be routed to various pins on the board. The configuration of these routes can be modified through DTS. Please refer to the datasheet to see the possible routings for each peripheral. 83 84Default Zephyr Peripheral Mapping: 85---------------------------------- 86 87.. rst-class:: rst-columns 88 89- UART0_TX : P0 90- UART0_RX : P1 91- I2C0_SDA : P4 92- I2C0_SCL : P5 93- I2C1_SDA : P6 94- I2C1_SCL : P7 95- ADC_CH0 : P26 96- ADC_CH1 : P27 97- ADC_CH2 : P28 98- ADC_CH3 : P29 99 100Programming and Debugging 101************************* 102 103Flashing 104======== 105 106Using UF2 107--------- 108 109Here is an example of building the sample for driving the built-in RGB led. 110 111.. zephyr-app-commands:: 112 :zephyr-app: samples/drivers/led/led_strip 113 :board: rp2040_zero 114 :goals: build 115 :compact: 116 117You must flash the RP2040-Zero with an UF2 file. One option is to use West (Zephyr’s meta-tool). To enter the UF2 flashing mode just keep the ``BOOT`` button pressed while you connect the USB port, it will appear on the host as a mass storage device. In alternative with the board already connected via USB you can keep the ``RESET`` button pressed, press and release ``BOOT``, release ``RESET``. At this point you can flash the image file by running: 118 119.. code-block:: bash 120 121 west flash 122 123In alternative you can locate the generated file at ``build/zephyr/zephyr.uf2 file`` and simply drag-and-drop to the device after entreing the UF2 flashing mode. 124 125References 126********** 127 128- `Official Documentation`_ 129- `WS2812 datasheet`_ 130 131.. _Official Documentation: https://www.waveshare.com/wiki/RP2040-Zero 132.. _WS2812 datasheet: https://cdn-shop.adafruit.com/datasheets/WS2812.pdf 133