PicoBoy Color Plus (PBC+)
The PicoBoy Color Plus (PBC+), based on the new RP2350 SoC [41] 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 [12] 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
Design Data
|
|
Positions
Data Sheets
Flash partitions
QSPI NOR-Flash |
code_partition |
storage_partition |
|---|---|---|
primary 16㎆ |
1㎆ |
15㎆ |
secondary N/A |
– |
– |
Pinouts
The peripherals of the RP2350 SoC [41] 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 on-board wiring is defined below. There is an additional edge connector and there are solder pads with additional signals routed to outside of the board.
Pin Mapping |
Default Zephyr On-Board Mapping
Buttons
LEDs
Display and Speaker
Sensor I/O and via Qwiic / STEMMA QT
Serial I/O via solder pads
GPIO and ADC
Devicetree compatible |
Supported Features
Similar to the Raspberry Pi Pico the board configuration supports the following hardware features:
Peripheral |
Kconfig option |
Devicetree compatible |
Zephyr API |
|---|---|---|---|
PINCTRL |
|||
GPIO |
|||
UART |
|||
UDC (USB Device Controller) |
|||
I2C |
|||
SPI |
|||
PWM |
|||
ADC |
|||
Temperature (Sensor) |
|||
Timer (Counter) |
|||
Watchdog Timer (WDT) |
|||
Flash |
|||
PIO |
N/A |
||
UART (PIO) |
|||
SPI (PIO) |
|||
WS2812 (PIO) |
|
N/A |
|
DMA |
|||
HWINFO |
N/A |
||
VREG |
|||
RESET |
|||
CLOCK |
|||
NVIC |
N/A |
Nested Vector Interrupts Controller |
|
SYSTICK |
N/A |
|
Other hardware features are not currently supported by Zephyr. The default configuration can be found in the following Kconfig file:
boards/jsed/picoboy_color_plus/picoboy_color_plus_rp2350a_hazard3_0_defconfig
boards/jsed/picoboy_color_plus/picoboy_color_plus_rp2350a_m33_0_defconfig
Board Configurations
The board can be configured only for the following different use cases.
west build -b picoboy_color_plus/rp2350a/hazard3_0
Use the native USB device port with CDC-ACM as Zephyr console and for the shell. Running on Hazard3/RISC-V core. EXPERIMENTAL
west build -b picoboy_color_plus/rp2350a/m33_0
Use the native USB device port with CDC-ACM as Zephyr console and for the shell. Running on Cortex-M33 core.
Connections and IOs
The PicoBoy Color Plus [13] 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 RP2350 [41] 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 [10] libraries.
GPIO (PWM) Ports
The RP2350 [41] 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. Only 5 PWM channels are available, for the LCD backlight, the three user LEDs and the passive magnetic speaker.
ADC/TS Ports
The RP2350 [41] MCU has 1 ADC with 4 channels and an additional fifth channel for the on-chip temperature sensor (TS). The ADC channels 0-2 are not available for any on-board function on and may be completely unusable. ADC channel 3 will be used for internal on-board voltage monitoring.
The external voltage reference ADC_VREF is directly connected to the 3.3V power supply.
SPI Port
The RP2350 [41] MCU has 2 SPIs. The serial bus SPI0 is connect to the on-board 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).
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 RP2350 [41] MCU has 2 I2Cs. The 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.
The board 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 RP2350 [41] MCU has 2 UARTs.
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 RP2350 [41] MCU has a (native) USB device port that can be used to communicate with a host PC. See the USB sample applications for more, such as the USB CDC ACM UART sample sample which sets up a virtual serial port that echos characters back to the host PC. The board provides the Zephyr console per default on the USB port as CDC ACM:
USB device idVendor=2e8a, idProduct=000a, bcdDevice= 4.05 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 RP2350 SoC [41] comes with three PIO periherals. These are two 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 [10] 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 board can only be flashed with a UF2 file. There is no SWD connector.
Using UF2
By default, building an application for the 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 board.
RP2350 Boot-ROM
Each RP2350 SoC [41] ships the UF2 compatible [6] bootloader pico-bootrom-rp2350 [11], a native support in silicon. The full source for the RP2350 bootrom at pico-bootrom-rp2350 [11] includes versions A2, A3 and A4 of the bootrom, which correspond to the same silicon revisions, respectively.
Note that every time you build a program for the RP2350, the Pico SDK selects and creates an appropriate image definition and/or partition table block with attributes and precedes it in the firmware. Further information can be found in the RP2350 Datasheet [42], sections with title “Bootrom” and “Processor Controlled Boot Sequence”.
Debugging
The board 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.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/basic/blinky west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/basic/blinky west flash -d build/picoboy_color_plus
Red User LED Blinky by PWM
See also Zephyr sample: PWM Blinky.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/basic/blinky_pwm west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/basic/blinky_pwm west flash -d build/picoboy_color_plus
All User LED Fade by PWM
See also Zephyr sample: Fade LED.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/basic/fade_led west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/basic/fade_led west flash -d build/picoboy_color_plus
Red User LED On/Off by GPIO Button
See also Zephyr sample: Button.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/basic/button west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/basic/button west flash -d build/picoboy_color_plus
SK6805 (WS2812) LED Test Pattern by SPI
See also Zephyr sample: LED strip.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/drivers/led/led_strip -- -DCONFIG_SAMPLE_LED_UPDATE_DELAY=500 west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/drivers/led/led_strip -- -DCONFIG_SAMPLE_LED_UPDATE_DELAY=500 west flash -d build/picoboy_color_plus
Hello Shell on USB-CDC/ACM Console
Hello Shell
See also Bridle sample: Hello Shell.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus bridle/samples/helloshell west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus bridle/samples/helloshell west flash -d build/picoboy_color_plus
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.5.0-rc1
uart:~$ bridle version
Bridle version 4.4.99
uart:~$ bridle version long
Bridle version 4.4.99.0
uart:~$ bridle info
Zephyr: 4.5.0-rc1
Bridle: 4.4.99
On Hazard3 RISC-V (RV32IMAC+)
uart:~$ device list
devices:
- clock-controller@40010000 (READY)
DT node labels: clocks
- reset-controller@40020000 (READY)
DT node labels: reset
- interrupt-controller (READY)
DT node labels: intc
- cdc_acm_console_uart (READY)
DT node labels: cdc_acm_console_uart
- timer@400b8000 (READY)
DT node labels: timer1
- timer@400b0000 (READY)
DT node labels: timer0
- uart@40070000 (READY)
DT node labels: uart0
- watchdog@400d8000 (READY)
DT node labels: wdt0
- dma@50000000 (READY)
DT node labels: dma
- gpio-port@0 (READY)
DT node labels: gpio0 gpio0_lo
- usbd@50110000 (READY)
DT node labels: usbd zephyr_udc0
- adc@400a0000 (READY)
DT node labels: adc
- flash-controller@400d0000 (READY)
DT node labels: qmi
- i2c@40090000 (READY)
DT node labels: i2c0 zephyr_i2c stemma_i2c qwiic_i2c grove_i2c
- pwm@400a8000 (READY)
DT node labels: pwm grove_pwm_d20 grove_pwm_d21
- vreg@40100000 (READY)
DT node labels: vreg
- spi@40088000 (READY)
DT node labels: spi1
- spi@40080000 (READY)
DT node labels: spi0
- lcd-backlight-en (READY)
DT node labels: lcd_backlight_en
- pwm-leds (READY)
DT node labels: pwm_leds
- sk6805@0 (READY)
DT node labels: sk6805 led_strip
- dietemp (READY)
DT node labels: die_temp
- stk8ba58@18 (READY)
DT node labels: stk8ba58
On ARM Cortex-M33
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
- timer@400b8000 (READY)
DT node labels: timer1
- timer@400b0000 (READY)
DT node labels: timer0
- uart@40070000 (READY)
DT node labels: uart0
- watchdog@400d8000 (READY)
DT node labels: wdt0
- dma@50000000 (READY)
DT node labels: dma
- gpio-port@0 (READY)
DT node labels: gpio0 gpio0_lo
- usbd@50110000 (READY)
DT node labels: usbd zephyr_udc0
- adc@400a0000 (READY)
DT node labels: adc
- flash-controller@400d0000 (READY)
DT node labels: qmi
- i2c@40090000 (READY)
DT node labels: i2c0 zephyr_i2c stemma_i2c qwiic_i2c grove_i2c
- pwm@400a8000 (READY)
DT node labels: pwm grove_pwm_d20 grove_pwm_d21
- vreg@40100000 (READY)
DT node labels: vreg
- spi@40088000 (READY)
DT node labels: spi1
- spi@40080000 (READY)
DT node labels: spi0
- lcd-backlight-en (READY)
DT node labels: lcd_backlight_en
- pwm-leds (READY)
DT node labels: pwm_leds
- sk6805@0 (READY)
DT node labels: sk6805 led_strip
- 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
Operate with the on-chip voltage regulator unit:
uart:~$ regulator vlist vreg
0.550000 V
0.600000 V
0.650000 V
0.700000 V
0.750000 V
0.800000 V
0.850000 V
0.900000 V
0.950000 V
1.000000 V
1.050000 V
1.100000 V
1.150000 V
1.200000 V
1.250000 V
1.300000 V
1.350000 V
1.400000 V
1.500000 V
1.600000 V
1.650000 V
1.700000 V
1.800000 V
1.900000 V
2.000000 V
2.350000 V
2.500000 V
2.650000 V
2.800000 V
3.000000 V
3.150000 V
3.300000 V
uart:~$ regulator vget vreg
1.100000 V
Operate with the on-board LCD backlight switch as voltage regulator:
uart:~$ regulator vlist lcd-backlight-en
3.300000 V
0 uV
uart:~$ regulator vget lcd-backlight-en
3.300000 V
The off/on sequence:
uart:~$ regulator vset lcd-backlight-en 0V
uart:~$ regulator vset lcd-backlight-en 3300mV
Operate with the RGB digital LED strip 1 RGB at SPI1_TX:
uart:~$ led_strip get_length led_strip
sk6805@0 has 1 pixel(s)
Sett all LEDs to RED:
uart:~$ led_strip fill led_strip 070000 1
Sett all LEDs to YELLOW:
uart:~$ led_strip fill led_strip 070700 1
Sett all LEDs to GREEN:
uart:~$ led_strip fill led_strip 000700 1
Sett all LEDs to CYAN:
uart:~$ led_strip fill led_strip 000707 1
Sett all LEDs to BLUE:
uart:~$ led_strip fill led_strip 000007 1
Sett all LEDs to MAGENTA:
uart:~$ led_strip fill led_strip 070007 1
Sett all LEDs to WHITE (all on):
uart:~$ led_strip fill led_strip 070707 1
Sett all LEDs to BLACK (all off):
uart:~$ led_strip fill led_strip 000000 1
Note
PWM LED conflicts with GPIO!
Operations with the red user LED in PWM mode will fail when ever the corresponding GPIO line 14 was configured as digital output. This condition is irreversible at runtime within the shell and requires a system reset.
Operate with the red user LED PWM_LED at GP14 / PWM14 (PWM7CHA):
uart:~$ led on pwm-leds 0
pwm-leds: turning on LED 0
uart:~$ led set_brightness pwm-leds 0 10
pwm-leds: setting LED 0 brightness to 10
uart:~$ led set_brightness pwm-leds 0 50
pwm-leds: setting LED 0 brightness to 50
uart:~$ led set_brightness pwm-leds 0 100
pwm-leds: setting LED 0 brightness to 100
uart:~$ led off pwm-leds 0
pwm-leds: turning off LED 0
uart:~$ led blink pwm-leds 0 50 50
pwm-leds: blinking LED 0 with 50 ms on and 50 ms off
uart:~$ led off pwm-leds 0
pwm-leds: turning off LED 0
Note
PWM conflicts with GPIO!
Operations with the red user LED in PWM mode will fail when ever the corresponding GPIO line 14 was configured as digital output. This condition is irreversible at runtime within the shell and requires a system reset.
Operate with the red user LED PWM_LED at GP14 / PWM14 (PWM7CHA):
uart:~$ pwm usec pwm 14 20000 20000
uart:~$ pwm usec pwm 14 20000 19000
uart:~$ pwm usec pwm 14 20000 18000
uart:~$ pwm usec pwm 14 20000 17000
uart:~$ pwm usec pwm 14 20000 16000
uart:~$ pwm usec pwm 14 20000 15000
uart:~$ pwm usec pwm 14 20000 10000
uart:~$ pwm usec pwm 14 20000 5000
uart:~$ pwm usec pwm 14 20000 2500
uart:~$ pwm usec pwm 14 20000 500
uart:~$ pwm usec pwm 14 20000 0
Operate with the PASSIVE magnetic speaker at GP15 / PWM15 (PWM7CHB):
concert pitch: 440 ㎐
Piezo middle frequency: 1,000 ㎑
Piezo resonance: 4,000 ㎑
Piezo high frequency: 10,000 ㎑
uart:~$ pwm usec pwm 15 2273 1136
uart:~$ pwm usec pwm 15 2000 1000
uart:~$ pwm usec pwm 15 250 125
uart:~$ pwm usec pwm 15 100 50
Operate with the red user LED LED at GP14:
uart:~$ gpio get gpio0 LED_RED
0
uart:~$ gpio conf gpio0 LED_RED oh0
uart:~$ gpio set gpio0 LED_RED 1
uart:~$ gpio set gpio0 LED_RED 0
uart:~$ gpio blink gpio0 LED_RED
Hit any key to exit
Operate with the user joystick center button ENTER at GP0:
uart:~$ gpio get gpio0 JOY_ENTER
0
uart:~$ gpio conf gpio0 JOY_ENTER iul
uart:~$ gpio get gpio0 JOY_ENTER
0
uart:~$ gpio get gpio0 JOY_ENTER
1
uart:~$ gpio get gpio0 JOY_ENTER
0
Get an overview of aviliable signale names:
uart:~$ gpio info gpio0
ngpios: 30
Reserved pin mask: 0xC38008E0
Reserved Pin Line Name
0 JOY_ENTER
1 JOY_RIGHT
2 JOY_DOWN
3 JOY_LEFT
4 JOY_UP
* 5
* 6
* 7
8 LCD_DC
9 LCD_RST
10 LCD_CSN_SW
* 11
12 LED_GREEN
13 LED_YELLOW
14 LED_RED
15 SPEAKER
16 LCD_SDI0
17 LCD_CSN0_HW
18 LCD_SCK0
19 LCD_SDO0
20 SENS_SDA0_TX1
21 SENS_SCL0_RX1
22 ACCEL_IRQ
* 23
* 24
* 25
26 LCD_BL
27 BTN_BACK
28 BTN_FORWARD
29 VSYS_ADC3
Operate with the channels:
on-board voltage monitor on channel ADC_CH3
on-chip temperature sensor on channel ADC_CH4
uart:~$ adc adc@400a0000 resolution 12
uart:~$ adc adc@400a0000 print
adc@400a0000:
Gain: 1
Reference: INTERNAL
Acquisition Time: 0
Channel ID: 0
Differential: 0
Resolution: 12
uart:~$ adc adc@400a0000 read 3
read: 1940
uart:~$ adc adc@400a0000 read 4
read: 749
Operate with the two on-chip timer units:
uart:~$ timer oneshot timer0 0 1000000
timer0: Alarm triggered
uart:~$ timer oneshot timer1 0 1000000
timer1: Alarm triggered
Erase, Write and Verify
uart:~$ flash read qmi 0xe0000 0x40
000E0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |........ ........|
000E0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |........ ........|
000E0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |........ ........|
000E0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |........ ........|
uart:~$ flash test qmi 0xe0000 0x1000 2
Erase OK.
Write OK.
Verified OK.
Erase OK.
Write OK.
Verified OK.
Erase-Write-Verify test done.
uart:~$ flash read qmi 0xe0000 0x40
000E0000: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f |........ ........|
000E0010: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f |........ ........|
000E0020: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f | !"#$%&' ()*+,-./|
000E0030: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f |01234567 89:;<=>?|
uart:~$ flash page_info 0xe0000
Page for address 0xe0000:
start offset: 0xe0000
size: 4096
index: 224
uart:~$ flash erase qmi 0xe0000 0x1000
Erase success.
uart:~$ flash read qmi 0xe0000 0x40
000E0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |........ ........|
000E0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |........ ........|
000E0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |........ ........|
000E0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |........ ........|
The PicoBoy Color Plus has the on-board acceleration sensor connected on I2C0. For this example the Grove Temperature and Barometer Sensor – BMP280 [15] was also connected to I2C0 via the Qwiic / STEMMA QT connector (Maker Port).
uart:~$ i2c scan zephyr_i2c
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77
2 devices found on zephyr_i2c
The I2C address 0x18 is a Sensortek STK8BA58 [31] 3D Acceleration Sensor
and their Chip-ID can read from register 0x0. The Chip-ID must be
0x87:
uart:~$ i2c read_byte zephyr_i2c 18 0
Output: 0x87
The I2C address 0x77 is a Bosch BMP280 [30] Air Pressure Sensor and their
Chip-ID can read from register 0xd0. The Chip-ID must be 0x58:
uart:~$ i2c read_byte zephyr_i2c 77 d0
Output: 0x58
uart:~$ sensor info
device name: stk8ba58@18, vendor: Sensortek Technology Corporation, model: stk8ba58, friendly name: on-board accelerometer
device name: dietemp, vendor: Raspberry Pi Foundation, model: pico-temp, friendly name: RP2350 chip temperature
on-chip temperature sensor
uart:~$ sensor get dietemp
channel type=12(die_temp) index=0 shift=6 num_samples=1 value=14554473307ns (31.067401)
on-board 3-axis accelerometer
Default attributes for all three axis:
range,
full_scale: 2g = 19.613300 ㎨ODR,
sampling_frequency: 250 ㎐sleep,
configuration: 25 ㎳ (low-power mode)
uart:~$ sensor attr_get stk8ba58@18 accel_xyz full_scale
stk8ba58@18(channel=accel_xyz, attr=full_scale) value=19.613300 value=0.000000 value=0.000000
uart:~$ sensor attr_get stk8ba58@18 accel_xyz sampling_frequency
stk8ba58@18(channel=accel_xyz, attr=sampling_frequency) value=250.000000 value=0.000000 value=0.000000
uart:~$ sensor attr_get stk8ba58@18 accel_xyz configuration
stk8ba58@18(channel=accel_xyz, attr=configuration) value=25.000000 value=0.000000 value=0.000000
uart:~$ sensor get stk8ba58@18
channel type=0(accel_x) index=0 shift=4 num_samples=1 value=61368586658ns (-1.345472)
channel type=1(accel_y) index=0 shift=4 num_samples=1 value=61368586658ns (3.651995)
channel type=2(accel_z) index=0 shift=4 num_samples=1 value=61368586658ns (-9.812338)
channel type=3(accel_xyz) index=0 shift=4 num_samples=1 value=61368586658ns, (-1.345472, 3.651995, -9.812338)
uart:~$ sensor trig stk8ba58@18 on data_ready
Enabled trigger idx=1 data_ready on device stk8ba58@18
[00:03:39.519,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_x, num_samples=138, data=-1.085779
[00:03:39.519,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_y, num_samples=138, data=4.899622
[00:03:39.519,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_z, num_samples=138, data=-9.081102
[00:03:44.566,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_x, num_samples=138, data=-1.096364
[00:03:44.566,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_y, num_samples=138, data=4.910068
[00:03:44.566,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_z, num_samples=138, data=-9.079361
[00:03:49.613,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_x, num_samples=138, data=-1.088982
[00:03:49.613,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_y, num_samples=138, data=4.913968
[00:03:49.613,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_z, num_samples=138, data=-9.078735
[00:03:54.661,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_x, num_samples=138, data=-1.087241
[00:03:54.661,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_y, num_samples=138, data=4.902616
[00:03:54.661,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_z, num_samples=138, data=-9.084933
[00:03:59.708,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_x, num_samples=138, data=-1.090932
[00:03:59.708,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_y, num_samples=138, data=4.900109
[00:03:59.709,000] <inf> sensor_shell: sensor=stk8ba58, chan=accel_z, num_samples=138, data=-9.085768
uart:~$ sensor trig stk8ba58@18 off data_ready
Disabled trigger idx=1 data_ready on device stk8ba58@18
[00:05:48.412,000] <wrn> STK8BA58: stk8ba58: no handler
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.
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 and also the console output in section Building on picoboy_color_plus of 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:
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/sensor/accel_polling west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/sensor/accel_polling west flash -d build/picoboy_color_plus
Simple test execution on target
*** Booting Zephyr OS build v4.5.0-rc1…***
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:
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/sensor/accel_trig west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/sensor/accel_trig west flash -d build/picoboy_color_plus
Simple test execution on target
*** Booting Zephyr OS build v4.5.0-rc1… ***
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 ㎐.
Speaker Test
Invoke west build and west flash:
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus bridle/samples/buzzer west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus bridle/samples/buzzer west flash -d build/picoboy_color_plus
Simple test execution on target
play a beep
play a folk song
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:
zephyr,code = <INPUT_KEY_BACK>;zephyr,code = <INPUT_KEY_FORWARD>;zephyr,code = <INPUT_KEY_UP>;zephyr,code = <INPUT_KEY_DOWN>;zephyr,code = <INPUT_KEY_LEFT>;zephyr,code = <INPUT_KEY_RIGHT>;zephyr,code = <INPUT_KEY_ENTER>;Joystick Test
See also Zephyr sample: Input dump.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/subsys/input/input_dump west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/subsys/input/input_dump west flash -d build/picoboy_color_plus
Simple logging output on target
Display Test and Demonstration
The following samples work with the chosen display. That is:
chosen { zephyr,display = &lcd_panel; };lcd_panel: &st7789v_240x280 {};Devicetree compatible
zephyr,lvgl-button-inputwith devicetree relationlvgl_buttons: lvgl-buttons { input = <&gpio_keys>; };FORWARD :input-codes = <INPUT_KEY_FORWARD>;:coordinates = <120 140>;(center of LCD)zephyr,lvgl-keypad-inputwith devicetree relationlvgl_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
Draw some basic rectangles onto the display using the Display driver API. See also Zephyr sample: Display.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/drivers/display west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/drivers/display west flash -d build/picoboy_color_plus
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.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p -d build/picoboy_color_plus zephyr/samples/subsys/display/lvgl west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p -d build/picoboy_color_plus zephyr/samples/subsys/display/lvgl west flash -d build/picoboy_color_plus
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: memory [-c]
-c dump chunk information
uart:~$ lvgl stats memory
Heap at 0x20001838 contains 2047 units in 11 buckets
bucket# min units total largest largest
threshold chunks (units) (bytes)
-----------------------------------------------------------
0 1 1 1 8
1 2 3 3 24
9 512 1 950 7600
7644 free bytes, 8136 allocated bytes, overhead = 600 bytes (3.7%)
On ARM Cortex-M33
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
- timer@400b8000 (READY)
DT node labels: timer1
- timer@400b0000 (READY)
DT node labels: timer0
- uart@40070000 (READY)
DT node labels: uart0
- watchdog@400d8000 (READY)
DT node labels: wdt0
- dma@50000000 (READY)
DT node labels: dma
- gpio-port@0 (READY)
DT node labels: gpio0 gpio0_lo
- usbd@50110000 (READY)
DT node labels: usbd zephyr_udc0
- 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-240x280@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
On Hazard3 RISC-V (RV32IMAC+)
uart:~$ device list
devices:
- clock-controller@40010000 (READY)
DT node labels: clocks
- reset-controller@40020000 (READY)
DT node labels: reset
- interrupt-controller (READY)
DT node labels: intc
- cdc_acm_console_uart (READY)
DT node labels: cdc_acm_console_uart
- timer@400b8000 (READY)
DT node labels: timer1
- timer@400b0000 (READY)
DT node labels: timer0
- uart@40070000 (READY)
DT node labels: uart0
- watchdog@400d8000 (READY)
DT node labels: wdt0
- dma@50000000 (READY)
DT node labels: dma
- gpio-port@0 (READY)
DT node labels: gpio0 gpio0_lo
- usbd@50110000 (READY)
DT node labels: usbd zephyr_udc0
- 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-240x280@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
See also Bridle sample: Hello Shell.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p --shield "grove_sens_bmp280" -d build/picoboy_color_plus bridle/samples/helloshell west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p --shield "grove_sens_bmp280" -d build/picoboy_color_plus bridle/samples/helloshell west flash -d build/picoboy_color_plus
Simple test execution on target
(text in bold is a command input)
Devices
Only an excerpt from the full list:
uart:~$ device list devices: … … … - bmp280@77 (READY) - dietemp (READY) DT node labels: die_temp - stk8ba58@18 (READY) DT node labels: stk8ba58Sensor access from Zephyr Shell
uart:~$ sensor info device name: bmp280@77, vendor: Bosch Sensortec GmbH, model: bme280, friendly name: Grove TP Sensor V1.0 (BME280) device name: stk8ba58@18, vendor: Sensortek Technology Corporation, model: stk8ba58, friendly name: on-board accelerometer device name: dietemp, vendor: Raspberry Pi Foundation, model: pico-temp, friendly name: RP2350 chip temperatureuart:~$ sensor get bmp280@77 channel type=13(ambient_temp) index=0 shift=16 num_samples=1 value=88094851080ns (24.069976) channel type=14(press) index=0 shift=23 num_samples=1 value=88094851080ns (100.218750) channel type=16(humidity) index=0 shift=21 num_samples=1 value=88094851080ns (0.000000)
BME280 humidity and pressure sensor
See also Zephyr sample: BME280 humidity and pressure sensor.
On Hazard3 RISC-V (RV32IMAC+)
west build -b picoboy_color_plus/rp2350a/hazard3_0 -p --shield "grove_sens_bmp280" -d build/picoboy_color_plus zephyr/samples/sensor/bme280 west flash -d build/picoboy_color_plusOn ARM Cortex-M33
west build -b picoboy_color_plus/rp2350a/m33_0 -p --shield "grove_sens_bmp280" -d build/picoboy_color_plus zephyr/samples/sensor/bme280 west flash -d build/picoboy_color_plus
Sample Output
[00:00:00.003,000] <dbg> BME280: bme280_chip_init: ID OK (BMP280)
[00:00:00.008,000] <dbg> BME280: bme280_chip_init: "bmp280@77" OK
[00:00:00.009,000] <dbg> STK8BA58.stk8ba58_init: stk8ba58@18: chip id 0x87
[00:00:00.009,000] <dbg> STK8BA58.stk8ba58_trigger_init: stk8ba58@18: int on gpio-port@0.22
[00:00:00.009,000] <dbg> STK8BA58.stk8ba58_init: stk8ba58@18: pm: 7, odr: 5
[00:00:00.009,000] <dbg> STK8BA58.stk8ba58_set_pm: stk8ba58@18: set pm to low-power, sleep 25ms
[00:00:00.009,000] <dbg> STK8BA58.stk8ba58_set_odr: stk8ba58@18: set odr to 250 Hz, bw to 125 Hz
[00:00:00.009,000] <dbg> STK8BA58.stk8ba58_init: stk8ba58@18: range is 2
[00:00:00.010,000] <dbg> STK8BA58.stk8ba58_set_range: stk8ba58@18: set range to 2g, gain to *float* mg/LSB
*** Booting Zephyr OS build v4.5.0-rc1…***
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
… … …