1.. zephyr:board:: adafruit_kb2040
2
3Overview
4********
5
6The Adafruit KB2040 is a small, low-cost, versatile board from
7Adafruit. It is equipped with an RP2040 SoC, an on-board RGB Neopixel,
8a USB connector, and a STEMMA QT connector. The USB bootloader allows
9it to be flashed without any adapter, in a drag-and-drop manner.
10
11Hardware
12********
13- Dual core Arm Cortex-M0+ processor running up to 133MHz
14- 264KB on-chip SRAM
15- 8MB on-board QSPI flash with XIP capabilities
16- 18 GPIO pins
17- 4 Analog inputs
18- 1 UART peripherals
19- 1 SPI controllers
20- 2 I2C controllers (one via STEMMA QT connector)
21- 16 PWM channels
22- USB 1.1 controller (host/device)
23- 8 Programmable I/O (PIO) for custom peripherals
24- On-board RGB LED
25- 1 Watchdog timer peripheral
26
27Supported Features
28==================
29
30The adafruit_kb2040 board configuration supports the following
31hardware features:
32
33.. list-table::
34   :header-rows: 1
35
36   * - Peripheral
37     - Kconfig option
38     - Devicetree compatible
39   * - NVIC
40     - N/A
41     - :dtcompatible:`arm,v6m-nvic`
42   * - UART
43     - :kconfig:option:`CONFIG_SERIAL`
44     - :dtcompatible:`raspberrypi,pico-uart`
45   * - GPIO
46     - :kconfig:option:`CONFIG_GPIO`
47     - :dtcompatible:`raspberrypi,pico-gpio`
48   * - ADC
49     - :kconfig:option:`CONFIG_ADC`
50     - :dtcompatible:`raspberrypi,pico-adc`
51   * - I2C
52     - :kconfig:option:`CONFIG_I2C`
53     - :dtcompatible:`snps,designware-i2c`
54   * - SPI
55     - :kconfig:option:`CONFIG_SPI`
56     - :dtcompatible:`raspberrypi,pico-spi`
57   * - USB Device
58     - :kconfig:option:`CONFIG_USB_DEVICE_STACK`
59     - :dtcompatible:`raspberrypi,pico-usbd`
60   * - HWINFO
61     - :kconfig:option:`CONFIG_HWINFO`
62     - N/A
63   * - Watchdog Timer (WDT)
64     - :kconfig:option:`CONFIG_WATCHDOG`
65     - :dtcompatible:`raspberrypi,pico-watchdog`
66   * - PWM
67     - :kconfig:option:`CONFIG_PWM`
68     - :dtcompatible:`raspberrypi,pico-pwm`
69   * - Flash
70     - :kconfig:option:`CONFIG_FLASH`
71     - :dtcompatible:`raspberrypi,pico-flash`
72   * - Clock controller
73     - :kconfig:option:`CONFIG_CLOCK_CONTROL`
74     - :dtcompatible:`raspberrypi,pico-clock-controller`
75   * - UART (PIO)
76     - :kconfig:option:`CONFIG_SERIAL`
77     - :dtcompatible:`raspberrypi,pico-uart-pio`
78
79Pin Mapping
80===========
81
82The peripherals of the RP2040 SoC can be routed to various pins on the board.
83The configuration of these routes can be modified through DTS. Please refer to
84the datasheet to see the possible routings for each peripheral.
85
86Default Zephyr Peripheral Mapping:
87----------------------------------
88
89.. rst-class:: rst-columns
90
91- UART0_TX : P0
92- UART0_RX : P1
93- I2C1_SDA : P2
94- I2C1_SCL : P3
95- SPI0_RX : P20
96- SPI0_SCK : P18
97- SPI0_TX : P19
98
99Programming and Debugging
100*************************
101
102Flashing
103========
104
105Using UF2
106---------
107
108Since it doesn't expose the SWD pins, you must flash the Adafruit KB2040 with
109a UF2 file. By default, building an app for this board will generate a
110:file:`build/zephyr/zephyr.uf2` file. If the KB2040 is powered on with the ``BOOTSEL``
111button pressed, it will appear on the host as a mass storage device. The
112UF2 file should be drag-and-dropped to the device, which will flash the KB2040.
113
114.. target-notes::
115
116.. _Getting Started with Raspberry Pi Pico:
117  https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf
118
119.. _Primary Guide\: Adafruit KB2040:
120  https://learn.adafruit.com/adafruit-kb2040
121