Raspberry Pi Pico 2 and Pico 2W
Overview
This is a set of Bridle’s extension to the original Zephyr upstream board Raspberry Pi Pico 2 with some adaptions and improvement on Kconfig and Devicetree level.
List of extensions
Kconfig
deactivate self powered USB explicitly and set the maximum of electrical current consumption to 500㎃:
Raspberry Pi Pico 2 and Pico 2W
Kconfig.defconfigconfig CDC_ACM_SERIAL_SELF_POWERED default n depends on USB_DEVICE_STACK_NEXT && USBD_CDC_ACM_CLASS config CDC_ACM_SERIAL_MAX_POWER default 250 if BOARD_RPI_PICO2 # 500mA depends on USB_DEVICE_STACK_NEXT && USBD_CDC_ACM_CLASS
change log level only in case of use the native USB device port
raspberrypi,pico-usbdwith CDC-ACM UARTzephyr,cdc-acm-uartas Zephyr console:CONFIG_USBD_CDC_ACM_LOG_LEVEL_CHOICE:=CONFIG_USBD_CDC_ACM_LOG_LEVEL_OFFCONFIG_UDC_DRIVER_LOG_LEVEL_CHOICE:=CONFIG_UDC_DRIVER_LOG_LEVEL_ERR
Raspberry Pi Pico 2 and Pico 2W
Kconfig.defconfig# Workaround for not being able to have commas in macro arguments DT_CHOSEN_Z_CONSOLE := zephyr,console DT_COMPAT_Z_CDC_ACM_UART := zephyr,cdc-acm-uart DT_COMPAT_RPIPICO_USB := raspberrypi,pico-usbd # Macros to shorten Kconfig expressions DT_CHOSEN_CONSOLE_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_CONSOLE)) DT_CHOSEN_CONSOLE_PARENT := $(dt_node_parent,$(DT_CHOSEN_CONSOLE_NODE)) if BOARD_RPI_PICO2 && \ $(dt_chosen_enabled,$(DT_CHOSEN_Z_CONSOLE)) && \ $(dt_compat_on_bus,$(DT_COMPAT_Z_CDC_ACM_UART),usb) && \ $(dt_node_has_compat,$(DT_CHOSEN_CONSOLE_PARENT),$(DT_COMPAT_RPIPICO_USB)) # Logger cannot use itself to log choice USBD_CDC_ACM_LOG_LEVEL_CHOICE default USBD_CDC_ACM_LOG_LEVEL_OFF depends on LOG && USB_DEVICE_STACK_NEXT && USBD_CDC_ACM_CLASS endchoice # Set USB log level to error only choice USBD_LOG_LEVEL_CHOICE default USBD_LOG_LEVEL_ERR depends on LOG && USB_DEVICE_STACK_NEXT && USBD_CDC_ACM_CLASS endchoice # Set UDC driver log level to error only choice UDC_DRIVER_LOG_LEVEL_CHOICE default UDC_DRIVER_LOG_LEVEL_ERR depends on LOG && USB_DEVICE_STACK_NEXT && USBD_CDC_ACM_CLASS endchoice endif # zephyr,cdc-acm-uart
Devicetree
set default entries for
modelandcompatibleof the boards:Raspberry Pi Pico 2
rpi_pico2_rp2350a_m33.overlay/ { model = "Raspberry Pi Pico 2 @ UART Concole"; compatible = "raspberrypi,rpi-pico2", "raspberrypi,rpi-pico2-uartcons"; };
rpi_pico2_hazard3.overlay/ { model = "Raspberry Pi Pico 2 @ UART Concole"; compatible = "raspberrypi,rpi-pico2", "raspberrypi,rpi-pico2-uartcons"; };
Raspberry Pi Pico 2W
rpi_pico2_rp2350a_m33_w.overlay/ { model = "Raspberry Pi Pico 2W @ UART Concole"; compatible = "raspberrypi,rpi-pico2-w", "raspberrypi,rpi-pico2-w-uartcons"; };
add the Bridle specific edge connecor binding
raspberrypi,pico-header-r3Raspberry Pi Pico 2 and Pico 2W
rpipico_r3_connector.dtsi/ { rpipico_header: connector { compatible = "raspberrypi,pico-header-r3"; #gpio-cells = <2>; gpio-map-mask = <0xffffffff 0xffffffc0>; gpio-map-pass-thru = <0 0x3f>; gpio-map = <0 0 &gpio0 0 0>, /* GP0 */ <1 0 &gpio0 1 0>, /* GP1 */ <2 0 &gpio0 2 0>, /* GP2 */ <3 0 &gpio0 3 0>, /* GP3 */ <4 0 &gpio0 4 0>, /* GP4 */ <5 0 &gpio0 5 0>, /* GP5 */ <6 0 &gpio0 6 0>, /* GP6 */ <7 0 &gpio0 7 0>, /* GP7 */ <8 0 &gpio0 8 0>, /* GP8 */ <9 0 &gpio0 9 0>, /* GP9 */ <10 0 &gpio0 10 0>, /* GP10 */ <11 0 &gpio0 11 0>, /* GP11 */ <12 0 &gpio0 12 0>, /* GP12 */ <13 0 &gpio0 13 0>, /* GP13 */ <14 0 &gpio0 14 0>, /* GP14 */ <15 0 &gpio0 15 0>, /* GP15 */ <16 0 &gpio0 16 0>, /* GP16 */ <17 0 &gpio0 17 0>, /* GP17 */ <18 0 &gpio0 18 0>, /* GP18 */ <19 0 &gpio0 19 0>, /* GP19 */ <20 0 &gpio0 20 0>, /* GP20 */ <21 0 &gpio0 21 0>, /* GP21 */ <22 0 &gpio0 22 0>, /* GP22 */ <23 0 &gpio0 26 0>, /* ADC0 / GP26 */ <24 0 &gpio0 27 0>, /* ADC1 / GP27 */ <25 0 &gpio0 28 0>; /* ADC2 / GP28 */ }; };
add the Bridle specific interface labels:
rpipico_serial: &pico_serial {};rpipico_spi: &pico_spi {};rpipico_spi0: &pico_spi0 {};rpipico_spi1: &pico_spi1 {};rpipico_i2c: &pico_i2c {};rpipico_i2c0: &pico_i2c0 {};rpipico_i2c1: &pico_i2c1 {};
enable the RP2350 SoC reset controller bindet as
raspberrypi,pico-resetRaspberry Pi Pico 2 and Pico 2W
rpipico_r3.dtsi&reset { status = "okay"; };
prepare the RP2350 SoC SPI1 controller bindet as
raspberrypi,pico-spiwith defaultraspberrypi,pico-pinctrlandclock-frequency = <DT_FREQ_M(8)>;properties, but explicitly set this to disabled statusRaspberry Pi Pico 2 and Pico 2W
rpipico_r3-spi1.dtsi&spi1 { status = "disabled"; pinctrl-0 = <&spi1_default>; pinctrl-names = "default"; clock-frequency = <DT_FREQ_M(8)>; };
rpipico_r3-pinctrl.dtsi&pinctrl { spi1_default: spi1_default { group1 { pinmux = <SPI1_CSN_P9>, <SPI1_SCK_P10>, <SPI1_TX_P11>; }; group2 { pinmux = <SPI1_RX_P12>; input-enable; }; }; };