The PicoBoy (Color)

The PicoBoy is a powerful mini handheld measuring just 3×5 ㎝. It is suitable for learning programming, developing your own games or simply playing with it. All you need is a PC, the PicoBoy and a USB-C cable. As the PicoBoy based on the RP2040 SoC [54] by Raspberry Pi Ltd. and is compatible with the Raspberry Pi Pico programming model and process, there are countless other tutorials, examples and libraries on the internet to make programming easier.

The PicoBoy Color (PBC) is the further development of the popular PicoBoy handheld, now with a color display for even more gaming fun. Whether you want to learn programming, develop your own games or simply play, the PicoBoy Color offers a wide range of possibilities. Although the original PicoBoy remains a great starting point for beginners and school classes, the PicoBoy Color offers an enhanced gaming experience and new possibilities for those who want more.

The PicoBoy Color Plus (PBC+), based on the new RP2350 SoC [57] by Raspberry Pi Ltd., is a new extended and in some points optimized version of the PicoBoy Color. The computing and memory performance has been significantly increased and missing functions have been added.

Board Overview

Hardware

The PicoBoy Color Plus [13] is a special mini sized RP2350A development board.

Features and Resources

Printed Circuit Board

5V/125~250㎃ 3.0~3.3V/100~150㎃

150㎒ 16㎆ 520㎅ USB-C 2×AAA UF2

RST BOOT USER UP|DOWN|LEFT|RIGHT|ENTER

RED YELLOW GREEN RGB LCD PASSIVE 3-DOF

11 5 1 1 1 1

  • Dual core Arm Cortex-M33 and dual core Hazard3 (RV32IMAC+) RISC-V processor running up to 150㎒

  • 520㎅ on-chip SRAM

  • 16㎆ on-board QSPI flash with XIP capabilities

  • USB 1.1 controller (host/device)

  • On-board USB-C connector

  • On-board 3.3V DC-DC buck-boost converter with 250㎃ switch

  • On-board 2 AAA battery holder

  • On-board RESET button

  • On-board BOOT button

  • On-board 1 User joystick (5 keys)

  • On-board 2 User button

  • On-board 3 User LEDs

  • On-board 1 User RGB LED

  • On-board 1.69-inch 240×280 pixels LCD, 65K colorful IPS (serial)

  • On-board 1 passive magnetic speaker

  • 1 RST signal to LCD controller

  • 1 C/D signal to LCD controller

  • 1 SPI controller for LCD

  • 1 I2C controller for external sensor

  • 5 PWM channels for LEDs, LCD backlight and speaker

  • 1 ADC analog inputs

  • 12 Programmable I/O (PIO) state machines for custom peripherals

  • 1 Watchdog timer peripheral

  • 1 Temperature sensor on-chip

Design Data

PicoBoy Color Plus

Positions

PicoBoy Color Plus details

Front side:

  1. ST7789V
    1.69-inch 240×280 pixels 65K colorful IPS LCD
  2. User joystick
    UP, DOWN, LEFT, RIGHT, ENTER
  3. User keys
    momentary push buttons
  4. LED monochrome
    user LEDs for diagnostic (not power indicator)
  5. SK6805-EC14 (WS2812B)
    RGB LED
  6. Magnetic Speaker
    3.0Vo-p (2.0~4.0V) @ 4,000㎐ with ≫65㏈A
  7. Maker Port
    Qwiic / STEMMA QT compatiple connector and pinout with conversion cable to Grove connector supports I2C0 (default), UART1, GPIO/PWM
  8. Solder Pads
    supports I2C0, UART0 (default), GPIO/PWM, HSTX

Back side:

  1. RP2350A

  2. USB Type-C connector
    Supports USB1.1 hosts and slave devices
  3. Power Supply Switch
  4. RESET and BOOT button
    press it when resetting to enter download mode
  5. W25Q128JV
    16㎆ NOR-Flash
  6. STK8BA58
    3-axis MEMS acceleration sensor
  7. AAA
    2×1.5V @ 1,200㎃h battery holder
  • TX4310B (N1IF)
    150㎃ DC-DC buck-boost converter, power switch for 3.3V
  • S8050 (J3Y)
    SMD NPN Transistor 300㎽, 40V @ 500㎃, SOT-23

Data Sheets

Pinouts

The peripherals of the RP2040 SoC [54] and RP2350 SoC [57] 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. The default assignments for the PicoBoy (Color/Plus) on-board wiring is defined below. There is only an edge connector on the PicoBoy Color Plus, otherwise not. The PicoBoy Color and Color Plus has solder pads with additional signals routed to outside of the board.

Pin Mapping

on-board:

11 5 1 1 1 1

on-board:

1 RST 1 BOOT 2 USER 1 CURSOR 1 RED 1 YELLOW 1 GREEN 1 RGB 1 LCD 1 PASSIVE 3-DOF

Default Zephyr On-Board Mapping

 

Buttons

  • ENTER : GP0 (PWM0)
  • RIGHT : GP1 (PWM1)
  • DOWN : GP2 (PWM2)
  • LEFT : GP3 (PWM3)
  • UP : GP4 (PWM4)
  • BACK : GP27 (PWM11)
  • FORWARD : GP28 (PWM12)

LEDs

  • RGB : SPI1_TX : GP11 (PWM11)
  • GREEN : GP12 PWM12
  • YELLOW : GP13 PWM13
  • RED : GP14 PWM14

Display and Speaker

  • n.c. : GP5 (PWM5)
  • n.c. : GP6 (PWM6)
  • n.c. : GP7 (PWM7)
  • LCD : GP8 (PWM8)
    on-board LCD data/cmd LCD_DC
  • LCD : GP9 (PWM9)
    on-board LCD reset LCD_RST
  • LCD : GP10 (PWM10)
    on-board LCD chip select LCD_CS
  • PASSIVE : GP15 PWM15
  • LCD SPI0_SCK : GP18 (PWM2)
    on-board LCD i/f clock LCD_CLK
  • LCD SPI0_TX : GP19 (PWM3)
    on-board LCD i/f data LCD_DIN
  • LCD GPIO26 : GP26 (PWM10)
    on-board LCD backlight LCD_BL

Sensor I/O and via Qwiic / STEMMA QT

  • I2C0_SDA : UART1_TX : GP20 (PWM4)
    on-board maker port i/f data I2C_SDA
    on-board acc. sensor i/f data ACCS_SDA
  • I2C0_SCL : UART1_RX : GP21 (PWM5)
    on-board maker port i/f clock I2C_SCL
    on-board acc. sensor i/f clock ACCS_SCL

Serial I/O via solder pads

  • UART0_TX : I2C1_SDA : GP16 (PWM0)
    on-board solder pads i/f data UART_TX
  • UART0_RX : I2C1_SCL : GP17 (PWM1)
    on-board solder pads i/f data UART_RX

GPIO and ADC

  • 3-DOF : GP22 (PWM6)
    on-board acc. sensor i/f interrupt ACCS_INT
  • n.c. : GP23 (PWM7)
  • n.c. : GP24 (PWM8)
  • n.c. : GP25 (PWM9)
  • n.c. ADC_CH3 : GP29 (PWM13)
    on-board VSYS/3 monitoring

Supported Features

Similar to the Raspberry Pi Pico the PicoBoy (Color/Plus) board configuration supports the following hardware features:

Hardware Features Supported by Zephyr

Peripheral

Kconfig option

Devicetree compatible

Zephyr API

PINCTRL

CONFIG_PINCTRL

raspberrypi,pico-pinctrl

Pin Control API

GPIO

CONFIG_GPIO

raspberrypi,pico-gpio

General-Purpose Input/Output (GPIO)

UART

CONFIG_SERIAL

Universal Asynchronous Receiver-Transmitter (UART)

UDC (USB Device Controller)

CONFIG_USB_DEVICE_STACK

raspberrypi,pico-usbd

USB device support APIs

I2C

CONFIG_I2C

raspberrypi,pico-i2c

Inter-Integrated Circuit (I2C) Bus

SPI

CONFIG_SPI

Serial Peripheral Interface (SPI) Bus

PWM

CONFIG_PWM

raspberrypi,pico-pwm

Pulse Width Modulation (PWM)

ADC

CONFIG_ADC

raspberrypi,pico-adc

Analog-to-Digital Converter (ADC)

Temperature (Sensor)

CONFIG_SENSOR

raspberrypi,pico-temp

Sensors

RTC

CONFIG_RTC

raspberrypi,pico-rtc

Real-Time Clock (RTC)

Timer (Counter)

CONFIG_COUNTER

raspberrypi,pico-timer

Counter

Watchdog Timer (WDT)

CONFIG_WATCHDOG

raspberrypi,pico-watchdog

Watchdog

Flash

CONFIG_FLASH

raspberrypi,pico-flash-controller (!)

Flash and Flash map

PIO

CONFIG_PIO_RPI_PICO

raspberrypi,pico-pio

N/A

UART (PIO)

CONFIG_SERIAL

raspberrypi,pico-uart-pio

Universal Asynchronous Receiver-Transmitter (UART)

SPI (PIO)

CONFIG_SPI

raspberrypi,pico-spi-pio

Serial Peripheral Interface (SPI) Bus

DMA

CONFIG_DMA

raspberrypi,pico-dma

Direct Memory Access (DMA)

HWINFO

CONFIG_HWINFO

N/A

Hardware Information

VREG

CONFIG_REGULATOR

raspberrypi,core-supply-regulator (!)

Regulators

RESET

CONFIG_RESET

raspberrypi,pico-reset

Reset Controller

CLOCK

CONFIG_CLOCK_CONTROL

Clock Control

NVIC

N/A

Nested Vector Interrupts Controller

SYSTICK

N/A

arm,v8m-systick

(!) POWMAN with VREG and QMI (Flash) on RP2350 not yet supported by Zephyr.

See section Peripherals RP2350 in upstream issue: https://github.com/zephyrproject-rtos/zephyr/issues/53810

Other hardware features are not currently supported by Zephyr. The default configuration can be found in the following Kconfig file:

Board Configurations

The PicoBoy boards can be configured only for the following single use cases.

west build -b picoboy_color_plus/rp2350a/m33

Use the native USB device port with CDC-ACM as Zephyr console and for the shell.

Connections and IOs

The PicoBoy [9] and PicoBoy Color [11] and PicoBoy Color Plus [14] website has detailed information about board connections. Download the different datasheets there or as linked above on the positions for more details.

System Clock

The RP2040 [54] MCU is configured to use the 12㎒ external crystal with the on-chip PLL generating the 125㎒ system clock. The RP2350 [57] MCU is configured to use the 12㎒ external crystal with the on-chip PLL generating the 150㎒ system clock. The internal AHB and APB units are set up in the same way as the upstream Raspberry Pi Pico C/C++ SDK [2] libraries.

GPIO (PWM) Ports

The RP2040 [54] MCU has 1 GPIO cell which covers all I/O pads and 8 PWM function unit each with 2 channels beside a dedicated Timer unit. The RP2350 [57] MCU has 1 GPIO cell which covers all I/O pads and 12 PWM function unit each with 2 channels beside a dedicated Timer unit. On the PicoBoy, only 4 PWM channels are available on the three user LEDs and the passive magnetic speaker. On the PicoBoy Color and PicoBoy Color Plus, only 5 PWM channels are available on the LCD backlight, the three user LEDs and the passive magnetic speaker.

ADC/TS Ports

The RP2040 [54] and RP2350 [57] MCU has 1 ADC with 4 channels and an additional fifth channel for the on-chip temperature sensor (TS). The ADC channels 0-3 are no available for any on-board function on the PicoBoy and PicoBoy Color and may be completely unusable, but they ar all configured. On the PicoBoy Color Plus ADC channel 3 will be used for internal on-board voltage monitoring.

SPI Port

The RP2040 [54] and RP2350 [57] MCU has 2 SPIs. The serial bus SPI0 is connect to the on-board OLED display or LCD over GP19 (MOSI), GP16 (MISO), GP18 (SCK), and GP17 (CSn), but only MOSI and SCK is used for write-only communication. The display chip-select signal will driven as simple GPIO by GP10 and the display itself does not provide any data out signal (MISO). SPI1 is not available in any default setup.

On the PicoBoy Color Plus the serial bus SPI1 will be used internaly to drive the on-board RGB LED over a one-wire digital signal on GP11 (MOSI).

I2C Port

The RP2040 [54] and RP2350 [57] MCU has 2 I2Cs. On the PicoBoy and PicoBoy Color Plus, serial bus I2C0 is connect to the on-board acceleration sensor over GP20 (I2C0_SDA), GP21 (I2C0_SCL). I2C1 is not available in any default setup.

PicoBoy Color I2C Port

The PicoBoy Color has no on-board acceleration sensor, but the serial bus I2C0 is connect to the on-board solder pads. The I2C port cannot be used at the same time as the UART port. Both share the required lines on GP20 and GP21.

The I2C port on solder pads is enabled by default.

PicoBoy Color Plus I2C Port

The PicoBoy Color Plus also provides the I2C0 serial bus with the same pin assignment for external sensors via a Maker Port as a Qwiic / STEMMA QT connector. On the solder pads, however, the I2C0 is optionally accessible with GP16 (SDA) and GP17 (SCL).

The I2C port on solder pads is disabled by default.

Serial Port

The RP2040 [54] and RP2350 [57] MCU has 2 UARTs. On the PicoBoy, neither UART0 nor UART1 are available in any of the default setups. When ever a Zephyr serial console will be needed, the USB port have to be used.

PicoBoy Color UART Port

On the PicoBoy Color, the serial port UART1 is connect to the on-board solder pads over GP20 (UART1_TX), GP21 (UART1_RX). UART0 is not available in any default setup. The UART port cannot be used at the same time as the I2C port. Both share the required lines on GP20 and GP21.

The UART port on solder pads is disabled by default.

PicoBoy Color Plus UART Port

On the PicoBoy Color Plus, the serial port UART0 is connect to the on-board solder pads over GP16 (UART0_TX), GP17 (UART0_RX). UART1 would be optional available on the Maker Port (Qwiic / STEMMA QT connector). The UART port cannot be used at the same time as the I2C port on the solder pads. Both share the required lines on GP16 and GP17.

The UART port on solder pads is enabled by default.

USB Device Port

The RP2040 [54] and RP2350 [57] MCU has a (native) USB device port that can be used to communicate with a host PC. See the USB device support sample applications for more, such as the USB CDC-ACM sample which sets up a virtual serial port that echos characters back to the host PC. The PicoBoy, PicoBoy Color and PicoBoy Color Plus provide the Zephyr console per default on the USB port as CDC ACM:

USB device idVendor=2e8a, idProduct=000a, bcdDevice= 4.01
USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: PicoBoy Color Plus (CDC ACM)
Manufacturer: JSED (Raspberry Pi)
SerialNumber: B163A72F0CF0C97A

Programmable I/O (PIO)

The RP2040 SoC [54] comes with two and RP2350 [57] with three PIO periherals. These are simple co-processors that are designed for I/O operations. The PIOs run a custom instruction set, generated from a custom assembly language. PIO programs are assembled using pioasm, a tool provided by Raspberry Pi. Further information can be found in the Raspberry Pi Pico C/C++ SDK [2] document, section with title “Using PIOASM, the PIO Assembler”.

Zephyr does not (currently) assemble PIO programs. Rather, they should be manually assembled and embedded in source code. An example of how this is done can be found at drivers/serial/uart_rpi_pico_pio.c or drivers/spi/spi_rpi_pico_pio.c.

Programming and Debugging

Flashing

The PicoBoy can only be flashed with a UF2 file. There is no SWD connector.

Using UF2

By default, building an app for the PicoBoy or PicoBoy Color board will generate a build/zephyr/zephyr.uf2 file. If the board is powered on with the BOOTSEL button pressed, it will appear on the host as a mass storage device:

USB device idVendor=2e8a, idProduct=000f, bcdDevice= 1.00
USB device strings: Mfr=1, Product=2, SerialNumber=0
Product: RP2350 Boot
Manufacturer: Raspberry Pi
SerialNumber: E9DB4B801D503140

The UF2 file should be drag-and-dropped or copied on command line to the device, which will then flash the PicoBoy, PicoBoy Color or PicoBoy Color Plus board.

RP2040 Boot-ROM

Each RP2040 SoC [54] ships the UF2 compatible [1] bootloader pico-bootrom-rp2040 [4], a native support in silicon. The full source for the RP2040 bootrom at pico-bootrom-rp2040 [4] includes versions 1, 2 and 3 of the bootrom, which correspond to the B0, B1 and B2 silicon revisions, respectively.

Note that every time you build a program for the RP2040, the Pico SDK selects an appropriate second stage bootloader based on what kind of external QSPI Flash type the board configuration you are building for was giving. There are several versions of boot2 [3] for different flash chips, and each one is exactly 256 bytes of code which is put right at the start of the eventual program binary. On Zephyr the boot2 versions are part of the Raspberry Pi Pico HAL [7] module. Possible selections:

CONFIG_RP2_FLASH_AT25SF128A:

boot2_at25sf128a.S [60]

CONFIG_RP2_FLASH_GENERIC_03H:

boot2_generic_03h.S [61]

CONFIG_RP2_FLASH_IS25LP080:

boot2_is25lp080.S [62]

CONFIG_RP2_FLASH_W25Q080:

boot2_w25q080.S [63]

CONFIG_RP2_FLASH_W25X10CL:

boot2_w25x10cl.S [64]

The PicoBoy and PicoBoy Color board set this option to CONFIG_RP2_FLASH_W25Q080. Further information can be found in the RP2040 Datasheet [55], sections with title “Bootrom” and “Processor Controlled Boot Sequence” or Brian Starkey’s Blog article Pico serial bootloader [6]

RP2350 Boot-ROM

Each RP2350 SoC [57] ships the UF2 compatible [1] bootloader pico-bootrom-rp2350 [5], a native support in silicon. The full source for the RP2350 bootrom at pico-bootrom-rp2350 [5] includes version 3 of the bootrom, which correspond to the A2 silicon revisions, respectively.

Debugging

The PicoBoy, PicoBoy Color or PicoBoy Color Plus does not provide any SWD connector, thus debugging software is not possible.

Basic Samples

LED Blinky and Fade

Red User LED Blinky by GPIO

See also Zephyr sample: Blinky.

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/basic/blinky
west flash -d build/picoboy

Red User LED Blinky by PWM

See also Zephyr sample: PWM Blinky.

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/basic/blinky_pwm
west flash -d build/picoboy

All User LED Fade by PWM

See also Zephyr sample: Fade LED.

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/basic/fade_led
west flash -d build/picoboy

Red User LED On/Off by GPIO Button (left side user button BACK)

See also Zephyr sample: Button.

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/basic/button
west flash -d build/picoboy
PicoBoy Color Plus SK6805 LED Test Pattern

SK6805 (WS2812) LED Test Pattern by SPI

See also Zephyr sample: LED strip.

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/drivers/led/led_strip -- -DCONFIG_SAMPLE_LED_UPDATE_DELAY=500
west flash -d build/picoboy

Hello Shell on USB-CDC/ACM Console

Hello Shell

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy bridle/samples/helloshell
west flash -d build/picoboy

Simple test execution on target

(text in bold is a command input)

uart:~$ hello -h
hello - say hello
uart:~$ hello
Hello from shell.
uart:~$ hwinfo devid
Length: 8
ID: 0xb163a72f0cf0c97a

uart:~$ kernel version
Zephyr version 4.1.99

uart:~$ bridle version
Bridle version 4.1.99

uart:~$ bridle version long
Bridle version 4.1.99.0

uart:~$ bridle info
Zephyr: 4.1.99
Bridle: 4.1.99
uart:~$ device list
devices:
- clock-controller@40010000 (READY)
  DT node labels: clocks
- reset-controller@40020000 (READY)
  DT node labels: reset
- cdc_acm_console_uart (READY)
  DT node labels: cdc_acm_console_uart
- uart@40070000 (READY)
  DT node labels: uart0 rpipico_serial pico_serial
- watchdog@400d8000 (READY)
  DT node labels: wdt0
- timer@400b8000 (READY)
  DT node labels: timer1
- timer@400b0000 (READY)
  DT node labels: timer0
- dma@50000000 (READY)
  DT node labels: dma
- gpio@40028000 (READY)
  DT node labels: gpio0
- adc@400a0000 (READY)
  DT node labels: adc
- i2c@40090000 (READY)
  DT node labels: i2c0 grove_i2c rpipico_i2c0 rpipico_i2c pico_i2c0 pico_i2c
- pwm@400a8000 (READY)
  DT node labels: pwm grove_pwm_d20 grove_pwm_d21
- lcd_backlight_en (READY)
  DT node labels: lcd_backlight_en
- pwm_leds (READY)
  DT node labels: pwm_leds
- dietemp (READY)
  DT node labels: die_temp
- stk8ba58@18 (READY)
  DT node labels: stk8ba58
uart:~$ history
[  0] history
[  1] device list
[  2] bridle info
[  3] bridle version long
[  4] bridle version
[  5] kernel version
[  6] hwinfo devid
[  7] hello
[  8] hello -h

More Samples

3-Axis accelerometer data on USB-CDC/ACM Console

The samples are prepared for the on-board 3-DOF accelerometer connected to the I2C0 bus on the PicoBoy and PicoBoy Color Plus.

pb-sensors.dtsi
 1/ {
 2	aliases {
 3		accel0 = &stk8ba58;
 4	};
 5};
 6
 7&i2c0 {
 8	status = "okay";	/* default sensor/io */
 9
10	/* Accelerometer with STK8BA58 sensor. */
11	stk8ba58: stk8ba58@18 {
12		compatible = "sensortek,stk8ba58";
13		status = "okay";
14
15		reg = <0x18>;
16
17		power-mode = <STK8BA58_DT_LOW_POWER_25ms>;
18		odr = <STK8BA58_DT_ODR_250Hz>;
19		range = <2>;
20	};
21};
pb-sensors.dtsi
1#include "pb-sensors.dtsi"
2
3&stk8ba58 {
4	/* GP22 as INT1 from STK8BA58 accelerometer sensor. */
5	irq-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
6};

Chip-specific

Get 3-axis accelerometer data from an STK8BA58 sensor (polling & trigger mode) using the Sensors API. See also Bridle sample STK8BA58 3-Axis Accelerometer Sample.

See section Building on picoboy_color_plus in the Bridle sample documentation.

Polling Mode

Get 3-axis accelerometer data from the on-board sensor (polling mode) using the Sensors API. See also Zephyr sample Generic 3-Axis accelerometer polling.

Invoke west build and west flash:

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/sensor/accel_polling
west flash -d build/picoboy

Simple test execution on target

***** delaying boot 4000ms (per build configuration) *****
*** Booting Zephyr OS build v4.1.99 (delayed boot 4000ms) ***
     stk8ba58@18 [m/s^2]:    (   -1.451188,     4.930195,    -9.110771)
     stk8ba58@18 [m/s^2]:    (   -1.451188,     4.930195,    -9.110771)
     stk8ba58@18 [m/s^2]:    (   -1.345472,     4.459280,    -9.399086)
     stk8ba58@18 [m/s^2]:    (   -1.316640,     4.468890,    -9.379865)
     stk8ba58@18 [m/s^2]:    (   -1.316640,     4.468890,    -9.379865)

Trigger Mode

Get 3-axis accelerometer data from the on-board sensor (trigger mode) using the Sensors API. See also Zephyr sample Accelerometer trigger.

Invoke west build and west flash:

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/sensor/accel_trig
west flash -d build/picoboy

Simple test execution on target

***** delaying boot 4000ms (per build configuration) *****
*** Booting Zephyr OS build v4.1.99 (delayed boot 4000ms) ***
     stk8ba58@18 [m/s^2]:    (   -1.777945,     4.238238,    -9.427917)
     stk8ba58@18 [m/s^2]:    (   -1.739503,     4.151743,    -9.562465)
     stk8ba58@18 [m/s^2]:    (   -1.816387,     4.170964,    -9.514412)
     stk8ba58@18 [m/s^2]:    (   -1.845219,     4.276680,    -9.427917)
     stk8ba58@18 [m/s^2]:    (   -1.864440,     4.084469,    -9.370254)

Sounds from the speaker on USB-CDC/ACM Console

The sample is prepared for the on-board PWM_SPEAKER connected to the PWM channel at GP15 / PWM15 (PWM7CHB).

The PWM period is 880 ㎐, twice the concert pitch frequency of 440 ㎐.

pb-speaker.dtsi
 1/ {
 2	aliases {
 3		pwm-buzzer0 = &pwm_speaker0;
 4	};
 5
 6	pwm_buzzers {
 7		compatible = "pwm-buzzers";
 8		status = "okay";
 9
10		pwm_speaker0: pwm_speaker0 {
11			pwms = <&pwm 15 PWM_HZ(880) PWM_POLARITY_NORMAL>;
12			label = "User PWM_SPEAKER";
13		};
14	};
15};
16
17&pwm {
18	status = "okay";
19	divider-int-7 = <255>;
20};

Speaker Test

PicoBoy Color Plus Speaker Test

Invoke west build and west flash:

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy bridle/samples/buzzer
west flash -d build/picoboy

Simple test execution on target

  1. play a beep

  2. play a folk song

  3. play a chrismas song

uart:~$ buzzer beep
uart:~$ buzzer play folksong
uart:~$ buzzer play xmastime

Input dump on USB-CDC/ACM Console

Print the input events related to the five on-board joystick keys using the Input subsystem API. That are:

BACK : zephyr,code = <INPUT_KEY_BACK>;
FORWARD : zephyr,code = <INPUT_KEY_FORWARD>;
UP : zephyr,code = <INPUT_KEY_UP>;
DOWN : zephyr,code = <INPUT_KEY_DOWN>;
LEFT : zephyr,code = <INPUT_KEY_LEFT>;
RIGHT : zephyr,code = <INPUT_KEY_RIGHT>;
ENTER : zephyr,code = <INPUT_KEY_ENTER>;

See also Zephyr sample: Input dump.

Joystick Test

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/subsys/input/input_dump
west flash -d build/picoboy

Simple logging output on target

***** delaying boot 4000ms (per build configuration) *****
W: BUS RESET
W: BUS RESET
*** Booting Zephyr OS build v4.1.99 (delayed boot 4000ms) ***
Input sample started
I: input event: dev=gpio_keys        SYN type= 1 code=158 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=158 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=159 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=159 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=103 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=103 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=108 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=108 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=105 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=105 value=0
I: input event: dev=gpio_keys        SYN type= 1 code=106 value=1
I: input event: dev=gpio_keys        SYN type= 1 code=106 value=0
I: input event: dev=gpio_keys        SYN type= 1 code= 28 value=1
I: input event: dev=gpio_keys        SYN type= 1 code= 28 value=0

Display Test and Demonstration

The following samples work with the chosen display. That is:

LCD : chosen { zephyr,display = &lcd_panel; };
ST7789V : lcd_panel: &st7789v_240x280 {};

Devicetree compatible

  • zephyr,lvgl-button-input with devicetree relation lvgl_buttons: lvgl-buttons { input = <&gpio_keys>; };

    FORWARD : input-codes = <INPUT_KEY_FORWARD>; : coordinates = <120 140>; (center of LCD)
  • zephyr,lvgl-keypad-input with devicetree relation lvgl_keypad: lvgl-keypad { input = <&gpio_keys>; };

    UP : input-codes = <INPUT_KEY_UP>; : lvgl-codes = <LV_KEY_UP>;
    DOWN : input-codes = <INPUT_KEY_DOWN>; : lvgl-codes = <LV_KEY_DOWN>;
    LEFT : input-codes = <INPUT_KEY_LEFT>; : lvgl-codes = <LV_KEY_LEFT>;
    RIGHT : input-codes = <INPUT_KEY_RIGHT>; : lvgl-codes = <LV_KEY_RIGHT>;
    ENTER : input-codes = <INPUT_KEY_ENTER>; : lvgl-codes = <LV_KEY_ENTER>;

LCD Orientation and Bit Order Test

PicoBoy Color Plus Display Test

Draw some basic rectangles onto the display using the Display driver API. See also Zephyr sample: Display.

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/drivers/display
west flash -d build/picoboy

LVGL Basic Sample

Displays “Hello World!” in the center of the screen and a counter at the bottom which increments every second using the LVGL module on top of the Display driver API. See also Zephyr sample: LVGL basic sample.

west build -b picoboy_color_plus/rp2350a/m33 -p -d build/picoboy zephyr/samples/subsys/display/lvgl
west flash -d build/picoboy

This sample comes with a Shell command line access to the LVGL backend on the console, here configured for a USB console:

Simple test execution on target

uart:~$ lvgl
lvgl - LVGL shell commands
Subcommands:
  stats   : Show LVGL statistics
  monkey  : LVGL monkey testing

uart:~$ lvgl stats
stats - Show LVGL statistics
Subcommands:
  memory  : Show LVGL memory statistics
            Usage: lvgl stats memory [-c]
            -c  dump chunk information

uart:~$ lvgl stats memory
Heap at 0x20001530 contains 2047 units in 11 buckets

  bucket#    min units        total      largest      largest
             threshold       chunks      (units)      (bytes)
  -----------------------------------------------------------
        1            2            1            2           12
        9          512            1         1012         8092

8104 free bytes, 7700 allocated bytes, overhead = 576 bytes (3.5%)
uart:~$ device list
devices:
- clock-controller@40010000 (READY)
  DT node labels: clocks
- reset-controller@40020000 (READY)
  DT node labels: reset
- cdc_acm_console_uart (READY)
  DT node labels: cdc_acm_console_uart
- uart@40070000 (READY)
  DT node labels: uart0 rpipico_serial pico_serial
- watchdog@400d8000 (READY)
  DT node labels: wdt0
- dma@50000000 (READY)
  DT node labels: dma
- gpio@40028000 (READY)
  DT node labels: gpio0
- pwm@400a8000 (READY)
  DT node labels: pwm grove_pwm_d20 grove_pwm_d21
- spi@40088000 (READY)
  DT node labels: spi1
- spi@40080000 (READY)
  DT node labels: spi0
- lcd_backlight_en (READY)
  DT node labels: lcd_backlight_en
- mipi_dbi_spi0 (READY)
  DT node labels: mipi_dbi_spi0
- st7789v@0 (READY)
  DT node labels: st7789v_240x280 lcd_panel
- gpio_keys (READY)
  DT node labels: gpio_keys
- lvgl-buttons (READY)
  DT node labels: lvgl_buttons
- lvgl-keypad (READY)
  DT node labels: lvgl_keypad

Grove Module Samples

The following examples require the Qwiic / STEMMA QT connection (Maker Port) and can therefore only be built and executed for and on the PicoBoy Color Plus.

Sensor access to Grove BMP280 (Qwiic signals as I2C)

Hello Shell

west build -b picoboy_color_plus/rp2350a/m33 -p --shield "grove_sens_bmp280" -d build/picoboy bridle/samples/helloshell
west flash -d build/picoboy

Simple test execution on target

(text in bold is a command input)

BME280 humidity and pressure sensor

See also Zephyr sample: BME280 humidity and pressure sensor

west build -b picoboy_color_plus/rp2350a/m33 -p --shield "grove_sens_bmp280" -d build/picoboy zephyr/samples/sensor/bme280
west flash -d build/picoboy

Sample Output

[00:00:00.001,000] <dbg> BME280: bme280_chip_init: ID OK (BMP280)
[00:00:00.006,000] <dbg> BME280: bme280_chip_init: "bmp280@77" OK
***** delaying boot 4000ms (per build configuration) *****
[00:00:00.294,000] <wrn> udc_rpi: BUS RESET
[00:00:00.395,000] <wrn> udc_rpi: BUS RESET
*** Booting Zephyr OS build v4.1.99 (delayed boot 4000ms) ***
Found device "bmp280@77", getting sensor data
temp: 23.879974; press: 100.648437; humidity: 1196032.0
temp: 23.889984; press: 100.648437; humidity: 1196032.0
temp: 23.899993; press: 100.648437; humidity: 1196032.0
temp: 23.909973; press: 100.648437; humidity: 1196032.0
temp: 23.919982; press: 100.648437; humidity: 1196032.0
temp: 23.929992; press: 100.648437; humidity: 1196032.0
temp: 23.949981; press: 100.652343; humidity: 1196032.0
temp: 23.989990; press: 100.652343; humidity: 1196032.0
temp: 23.969970; press: 100.656250; humidity: 1196032.0
… … …

LED Blinky and Fade with Grove LED Button (Qwiic signals as GPIO)

Grove LED Blinky by GPIO

See also Grove LED Shields in Bridle and Zephyr sample: Blinky.

west build -b picoboy_color_plus/rp2350a/m33 -p --shield "grove_btn_d20 grove_led_d21 grove_pwm_led_d21 x_grove_testbed" -d build/picoboy zephyr/samples/basic/blinky
west flash -d build/picoboy

Grove LED Blinky by PWM

See also Grove LED Shields in Bridle and Zephyr sample: PWM Blinky.

west build -b picoboy_color_plus/rp2350a/m33 -p --shield "grove_btn_d20 grove_led_d21 grove_pwm_led_d21 x_grove_testbed" -d build/picoboy zephyr/samples/basic/blinky_pwm
west flash -d build/picoboy

Grove and the two other User LED Fade by PWM

See also Grove LED Shields in Bridle and Zephyr sample: Fade LED.

west build -b picoboy_color_plus/rp2350a/m33 -p --shield "grove_btn_d20 grove_led_d21 grove_pwm_led_d21 x_grove_testbed" -d build/picoboy zephyr/samples/basic/fade_led
west flash -d build/picoboy

Grove LED On/Off by Grove Button

See also Grove LED Shields and Grove Button Shields in Bridle and Zephyr sample: Button.

west build -b picoboy_color_plus/rp2350a/m33 -p --shield "grove_btn_d20 grove_led_d21 grove_pwm_led_d21 x_grove_testbed" -d build/picoboy zephyr/samples/basic/button
west flash -d build/picoboy

References