Cytron Maker Nano RP2040

The RP2040 SoC [50] by Raspberry Pi Ltd. is a small sized and low-cost 32-bit dual ARM Cortex-M0+ microcontroller and predestined for versatile board designs. The Cytron Maker RP2040 board series based on this microcontroller offers a wide range with different scaling factors, in size, features and interfaces for communication, input and output.

Board Overview

Hardware

The Maker Nano RP2040 [20] is a nano sized RP2040 development board. The edge pin layout is compatible to the original Arduino Nano with ATmega328P processor but comes with significantly more on-board flash memory, with an on-board piezo buzzer, many LEDs for digital signal diagnostics, two WS2812 Neopixel RGB LEDs and two maker ports compatible with Sparkfun’s Qwiic and Adafruit’s STEMMA QT modules. By using the included conversion cables, maker ports are compatible with Seeed Studio’s Grove System [23] modules too. Main differences compared to the original Arduino Nano:

  • The IO voltage is only 3.3V and it’s not 5V compatible.

  • There are only four ADC inputs (A0 - A3) instead of eight (A0 - A7).

Features and Resources

Printed Circuit Board

5V/430㎃ 3.3V/500㎃ 5V/3.3V(OUT)

133㎒ 2㎆ 264㎅ USB-B UF2 SWD

RST BOOT USER BLUE RGB PIEZO

22 16 3 2 1 1

  • Dual core Arm Cortex-M0+ processor running up to 133㎒

  • 264㎅ on-chip SRAM

  • 2㎆ on-board QSPI flash with XIP capabilities

  • USB 1.1 controller (host/device)

  • On-board USB-B micro connector

  • On-board 5V LDO regulator with 100㎃

  • On-board 3.3V LDO regulator with 500㎃

  • On-board RESET button

  • On-board BOOT button

  • On-board USER button

  • On-board 1 Piezo buzzer

  • On-board 2 RGB LED (strip)

  • On-board 13 LED

  • 22 GPIO pins via edge pinout and 4 of them via 2 Qwiic/Grove connectors

  • 1 UART peripherals via edge pinout and in parallel via 1 Qwiic/Grove connector

  • 1 I2C controller via edge pinout and in parallel via 1 Qwiic/Grove connector

  • 1 I2C controller via edge pinout

  • 1 SPI controller via edge pinout

  • 16 PWM channels via edge pinout and 4 of them via 2 Qwiic/Grove connectors

  • 4 ADC analog inputs via edge pinout and 2 of them via 1 Qwiic/Grove connector

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

  • 1 Watchdog timer peripheral

  • 1 Temperature sensor on-chip

Design Data

Maker Nano RP2040

Positions

Maker Nano RP2040 details
  1. USB Type-B connector
    Supports USB1.1 hosts and slave devices
  2. WS2812B
    RGB LEDs
  3. LED monochrome
    user LEDs for diagnostic (not power indicator)
  4. BOOT button
    press it when resetting to enter download mode
  5. RESET button

  6. USER button

  7. 78L05
    100㎃ positive fixed 5V linear regulator
  8. RT9080-33
    600㎃ low dropout, low noise, ultra-fast LDO
  9. RP2040

  1. W25Q16JV
    2㎆ NOR-Flash
  2. Piezo Buzzer
    3.6Vo-p (2.5~4.5V) @ 2.730㎑ with 80~87㏈
  3. Maker Port 0
    Qwiic / STEMMA QT compatiple connector and pinout with conversion cable to Grove connector supports UART0 (default), I2C0, GPIO/PWM
  4. Maker Port 1
    Qwiic / STEMMA QT compatiple connector and pinout with conversion cable to Grove connector supports I2C1 (default), ADC0 & ADC1, GPIO/PWM
  5. Pinout
    compatible with Arduino Nano (A4-A7 missing), A1-A7 optional usable for UART0, I2C0 / I2C1, or SPI0

Data Sheets

Flash partitions

QSPI NOR-Flash

bootrom

code_partition

storage_partition

primary 2㎆

256B

1㎆ - 256B

1㎆

Pinouts

The peripherals of the RP2040 SoC [50] 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 board is defined below.

External pin mapping on the Maker Nano RP2040 is identical to the original Raspberry Pi Pico board, but note that there are only analog channels A0 - A3 connected to an ADC and the analog channels A4 - A7 are simple digital signal lines. Also all IO voltage levels are limited to 3.3V only.

Pin Mapping

Pinout

on-edge(1-30):

4 10 2 2 1 1

on-board:

1 RST 1 BOOT 1 USER 13 BLUE 2 RGB 1 PIEZO

Default Zephyr Peripheral Mapping (Arduino Nano R3)

 

  • 1 UART0_TX : GP0 (PWM0)
  • 2 UART0_RX : GP1 (PWM1)
  • 3 RUN (RESET)
  • 4 GND
  • 5 (UART0_CTS) : GP2 (PWM2)
  • 6 (UART0_RTS) : GP3 (PWM3)
  • 7 PIO/PWM : GP4 (PWM4)
  • 8 PIO/PWM : GP5 PWM5
  • 9 PIO/PWM : GP6 (PWM6)
  • 10 PIO/PWM : GP7 PWM7
  • 11 PIO/PWM : GP8 PWM8
  • 12 PIO/PWM : GP9 PWM9
  • 13 SPI0_CSN : GP17 (PWM1)
  • 14 SPI0_TX : GP19 (PWM3)
  • 15 SPI0_RX : GP16 (PWM0)
  • 16 SPI0_SCK : GP18 (PWM2)
  • 17 3V3(OUT)
  • 18
  • 19 I2C1_SDA : GP26 (PWM10)
  • 20 I2C1_SCL : GP27 (PWM11)
  • 21 ADC_CH2 : GP28 (PWM12)
  • 22 ADC_CH3 : GP29 (PWM13)
  • 23 I2C0_SDA : GP12 (PWM12)
  • 24 I2C0_SCL : GP13 (PWM13)
  • 25 PIO/PWM : GP14 (PWM14)
  • 26 PIO/PWM : GP15 (PWM15)
  • 27 5V(OUT)
  • 28 RUN (RESET)
  • 29 GND
  • 30 VBUS/VSYS

Default Zephyr Peripheral Mapping (Maker Port 0)

  • 1 UART0_RX : GP1 (PWM1)
  • 2 UART0_TX : GP0 (PWM0)
  • 3 3V3(OUT)
  • 4 GND

Default Zephyr Peripheral Mapping (Maker Port 1)

  • 1 I2C1_SCL : GP27 (PWM11)
  • 2 I2C1_SDA : GP26 (PWM10)
  • 3 3V3(OUT)
  • 4 GND

 

Default Zephyr On-Board Mapping

 

  • nc BLUE : GP9 PWM9
  • nc n.c. : GP10 (PWM10)
  • nc RGB : SPI1_TX : GP11
  • nc USER : GP20 (PWM4)
  • nc n.c. : GP21 (PWM5)
  • nc PIEZO : GP22 PWM6
  • nc n.c. : GP23 (PWM7)
  • nc n.c. : GP24 (PWM8)
  • nc n.c. : GP25 (PWM9)
  • nc 3V3 : ADC_VREF

Devicetree compatible

Maker Nano RP2040 edge pinout

Supported Features

Similar to the Raspberry Pi Pico the 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_NEXT

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

arm,v6m-nvic

Nested Vector Interrupts Controller

SYSTICK

N/A

arm,armv6m-systick

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

Board Configurations

The board can be configured for the following different use cases.

west build -b cytron_maker_nano_rp2040

Use the serial port UART0 on edge header as Zephyr console and for the shell.

west build -b cytron_maker_nano_rp2040 -S usb-console

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

Connections and IOs

The Cytron Marktplace [19] has detailed information about board connections. Download the different schematics or datasheets as linked above per board for more details. The pinout diagrams can also be found there.

Laced Grove Signal Interface

The board offers the option of connecting hardware modules via a variety of Grove connectors. These are provided by a specific interface for general signal mapping, the Laced Grove Signal Interface.

Following mappings are well known:

  • grove_gpios: GPIO mapping

  • grove_pwms: PWM mapping

In addition to the Arduino Nano header, there are also 2 Grove connectors (Qwiic/STEMMA QT).

This is the GPIO signal line mapping from the Arduino Nano R3 [13] header bindet with arduino-nano-header to the set of Grove connectors provided as Laced Grove Signal Interface.

This list must not be stable!

phandle index to shield –>

Signal : Meaning

cytron_maker_nano_rp2040

<&grove_gpios 0 …>

D0: UART-RX (GP1:UART0/LED)

<&grove_d1_header 0 …>
↳ <&arduino_nano_header 0 …>
↳ <&gpio0 1 …>

<&grove_gpios 1 …>

D1: UART-TX (GP0:UART0/LED)

<&grove_d1_header 1 …>
↳ <&arduino_nano_header 1 …>
↳ <&gpio0 0 …>

<&grove_gpios 2 …>

D2: DIO2 (GP2:LED)

not wired

<&grove_gpios 3 …>

D3: DIO3/PWM3 (GP3:PWM1CHB/LED)

not wired

<&grove_gpios 4 …>

D4: DIO4 (GP4:LED)

not wired

<&grove_gpios 5 …>

D5: DIO5/PWM5 (GP5:PWM2CHB/LED)

not wired

<&grove_gpios 6 …>

D6: DIO6/PWM6 (GP6:PWM3CHA/LED)

not wired

<&grove_gpios 7 …>

D7: DIO7 (GP7:LED)

not wired

<&grove_gpios 8 …>

D8: DIO8 (GP8:LED)

not wired

<&grove_gpios 9 …>

D9: DIO9/PWM9 (GP9:PWM4CHB/LED/BL)

not wired

<&grove_gpios 10 …>

D10: SPI-CS (GP17:SPI0/PWM0CHB/LED)

not wired

<&grove_gpios 11 …>

D11: SPI-COPI (GP19:SPI0/PWM1CHB/LED)

not wired

<&grove_gpios 12 …>

D12: SPI-CIPO (GP16:SPI0/LED)

not wired

<&grove_gpios 13 …>

D13: SPI-CLK (GP18:SPI0/LED)

not wired

<&grove_gpios 14 …>

A0/D14: I2C-SDA (GP26:I2C1)

<&grove_d27_header 1 …>,
↳ <&arduino_header 14 …>
↳ <&gpio0 26 …>

<&grove_gpios 15 …>

A1/D15: I2C-SCL (GP27:I2C1)

<&grove_d27_header 0 …>
↳ <&arduino_header 15 …>
↳ <&gpio0 27 …>

<&grove_gpios 16 …>

A2/D16: ADC2 (GP28:ADC)

not wired

<&grove_gpios 17 …>

A3/D17: ADC3 (GP29:ADC)

not wired

<&grove_gpios 18 …>

A4/D18: I2C-SDA (GP12:I2C0)

not wired

<&grove_gpios 19 …>

A5/D19: I2C-SCL (GP13:I2C0)

not wired

<&grove_gpios 20 …>

A6: ADC6 (GP14)

not wired, digital only

<&grove_gpios 21 …>

A7: ADC7 (GP15)

not wired, digital only

<&grove_gpios 22 …>

<&grove_gpios 23 …>

<&grove_gpios 24 …>

<&grove_gpios 25 …>

<&grove_gpios 26 …>

<&grove_gpios 27 …>

<&grove_gpios 28 …>

<&grove_gpios 29 …>

<&grove_gpios 30 …>

<&grove_gpios 31 …>

System Clock

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

GPIO (PWM) Ports

The RP2040 [50] 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. Almost all 16 PWM channels are available on the edge connectors, although some channels are occupied by special signals if their function is enabled. The PWM3 channel A will be used for the on-board Piezo buzzer.

ADC/TS Ports

The RP2040 [50] 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 available on the Arduino Nano header, channel 0-1 also on one of the two Qwiic / STEMMA QT compatiple connectors, but this is not the default pin operation.

The external voltage reference ADC_VREF is directly connected to the 3.3V power supply.

SPI Port

The RP2040 [50] MCU has 2 SPIs. The serial bus SPI0 is connect to external devices over GP19 (MOSI), GP16 (MISO), GP18 (SCK), and GP17 (CSn) on the Arduino Nano header. SPI1 is not available in any default setup.

I2C Port

The RP2040 [50] MCU has 2 I2Cs. The serial bus I2C0 and I2C1 are connect to external devices over GP12 (I2C0_SDA), GP13 (I2C0_SCL), GP26 (I2C1_SDA), and GP27 (I2C1_SCL) on the Arduino Nano header.

Serial Port

The RP2040 [50] MCU has 2 UARTs. One of the UARTs (UART0) is connected to external devices over GP0 (TX) and GP1 (RX) on the Arduino Nano header and is the Zephyr console.

USB Device Port

The RP2040 [50] 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. As an alternative to the default Zephyr console on serial port the Bridle USB Console Snippet (usb-console) can be used to enable CDC ACM and switch the console to USB:

USB device idVendor=2e8a, idProduct=000a, bcdDevice= 4.05
USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: Maker Nano RP2040 (CDC ACM)
Manufacturer: Cytron (Raspberry Pi)
SerialNumber: BF002B12140C620C

To integrate specific USB device functions that do not follow a USB standard class, the following alternate identifier numbers are available for the various Cytron RP2040 and RP2350 boards according to the Raspberry Pi USB product ID list [12]:

RP2040

0x1000:

Maker Nano RP2040

0x100F:

Maker Pi RP2040

0x1071:

Maker UNO RP2040

0x1074:

EDU PICO

0x107E:

EDU PICO

0x1093:

IRIV IO Controller

0x109C:

SUMO:BIT Expansion Board

RP2350

0x1096:

MOTION 2350 Pro

 

Programmable I/O (PIO)

The RP2040 SoC [50] comes with two 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 [14] 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=0003, bcdDevice= 1.00
USB device strings: Mfr=1, Product=2, SerialNumber=0
Product: RP2 Boot
Manufacturer: Raspberry Pi
SerialNumber: E0C9125B0D9B

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

RP2040 Boot-ROM

Each RP2040 SoC [50] ships the UF2 compatible [6] bootloader pico-bootrom-rp2040 [16], a native support in silicon. The full source for the RP2040 bootrom at pico-bootrom-rp2040 [16] includes versions B0, B1 and B2 of the bootrom, which correspond to the same 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 [15] 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 [18] module. Possible selections:

CONFIG_RP2_FLASH_AT25SF128A:

boot2_at25sf128a.S [53]

CONFIG_RP2_FLASH_GENERIC_03H:

boot2_generic_03h.S [54]

CONFIG_RP2_FLASH_IS25LP080:

boot2_is25lp080.S [55]

CONFIG_RP2_FLASH_W25Q080:

boot2_w25q080.S [56]

CONFIG_RP2_FLASH_W25X10CL:

boot2_w25x10cl.S [57]

The board set this option to CONFIG_RP2_FLASH_W25Q080.

Further information can be found in the RP2040 Datasheet [51], sections with title “Bootrom” and “Processor Controlled Boot Sequence” or Brian Starkey’s Blog article Pico serial bootloader [17]

Debugging

The board does not provide any SWD connector, thus debugging software is not possible.

Basic Samples

LED Blinky and Fade

Blue User LED Blinky by GPIO

See also Zephyr sample: Blinky.

west build -b cytron_maker_nano_rp2040/rp2040 -p -d build/cytron_maker_nano_rp2040 zephyr/samples/basic/blinky
west flash -d build/cytron_maker_nano_rp2040

Blue User LED Blinky by PWM

See also Zephyr sample: PWM Blinky.

west build -b cytron_maker_nano_rp2040/rp2040 -p -d build/cytron_maker_nano_rp2040 zephyr/samples/basic/blinky_pwm
west flash -d build/cytron_maker_nano_rp2040

Blue User LED Fade by PWM

See also Zephyr sample: Fade LED.

west build -b cytron_maker_nano_rp2040/rp2040 -p -d build/cytron_maker_nano_rp2040 zephyr/samples/basic/fade_led
west flash -d build/cytron_maker_nano_rp2040

Blue User LED On/Off by GPIO Button

See also Zephyr sample: Button.

west build -b cytron_maker_nano_rp2040/rp2040 -p -d build/cytron_maker_nano_rp2040 zephyr/samples/basic/button
west flash -d build/cytron_maker_nano_rp2040
Maker Nano RP2040 WS2812 LED Test Pattern

WS2812 LED Test Pattern by SPI

See also Zephyr sample: LED strip.

west build -b cytron_maker_nano_rp2040/rp2040 -p -d build/cytron_maker_nano_rp2040 zephyr/samples/drivers/led/led_strip -- -DCONFIG_SAMPLE_LED_UPDATE_DELAY=500
west flash -d build/cytron_maker_nano_rp2040

Hello Shell with USB-CDC/ACM Console

Hello Shell

See also Bridle sample: Hello Shell.

west build -b cytron_maker_nano_rp2040/rp2040 -p -S "usb-console" -d build/cytron_maker_nano_rp2040 bridle/samples/helloshell
west flash -d build/cytron_maker_nano_rp2040

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: 0xe4629c9593563629

uart:~$ kernel version
Zephyr version 4.5.0

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
Bridle: 4.4.99
uart:~$ device list
devices:
- clock-controller@40008000 (READY)
  DT node labels: clocks
- reset-controller@4000c000 (READY)
  DT node labels: reset
- snippet_cdc_acm_console_uart (READY)
  DT node labels: snippet_cdc_acm_console_uart
- timer@40054000 (READY)
  DT node labels: timer
- uart@40034000 (READY)
  DT node labels: uart0 arduino_nano_serial grove_serial
- watchdog@40058000 (READY)
  DT node labels: wdt0
- dma@50000000 (READY)
  DT node labels: dma
- gpio-port@0 (READY)
  DT node labels: gpio0
- usbd@50110000 (READY)
  DT node labels: usbd zephyr_udc0
- adc@4004c000 (READY)
  DT node labels: adc
- flash-controller@18000000 (READY)
  DT node labels: ssi
- i2c@40048000 (READY)
  DT node labels: i2c1 zephyr_i2c stemma_i2c qwiic_i2c grove_i2c
- i2c@40044000 (READY)
  DT node labels: i2c0 arduino_nano_i2c
- pwm@40050000 (READY)
  DT node labels: pwm grove_pwm_d0 grove_pwm_d1 grove_pwm_d14 grove_pwm_d15
- vreg@40064000 (READY)
  DT node labels: vreg
- rtc@4005c000 (READY)
  DT node labels: rtc
- spi@40040000 (READY)
  DT node labels: spi1
- spi@4003c000 (READY)
  DT node labels: spi0 arduino_nano_spi
- pwm-leds (READY)
  DT node labels: pwm_leds
- ws2812@0 (READY)
  DT node labels: ws2812 led_strip
- dietemp (READY)
  DT node labels: die_temp
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

Input dump with USB-CDC/ACM Console

Prints all input events as defined by the shields Devicetree. See also Zephyr sample: Input dump.

Print the input events related to the one on-board user button using the Input subsystem API. That are:

BTN1 : zephyr,code = <INPUT_KEY_0>;

Devicetree compatible

  • zephyr,lvgl-keypad-input with devicetree relation lvgl_keypad: lvgl-keypad { input = <&gpio_keys>; };

    BTN1 : input-codes = <INPUT_KEY_0>; : lvgl-codes = <LV_KEY_ENTER>;

Button Input Dump

west build -b cytron_maker_nano_rp2040/rp2040 -p -S "usb-console" -d build/cytron_maker_nano_rp2040 zephyr/samples/subsys/input/input_dump
west flash -d build/cytron_maker_nano_rp2040

Simple logging output on target

*** Booting Zephyr OS build v4.5.0…***
Input sample started
I: input event: dev=gpio-keys        SYN type= 1 code= 11 value=1
I: input event: dev=gpio-keys        SYN type= 1 code= 11 value=0

Sounds from the speaker with USB-CDC/ACM Console

Maker Nano RP2040 Piezo Buzzer Test

Piezo Buzzer Test

The sample is prepared for the on-board PWM_BUZZER connected to the PWM channel at GP22 / PWM6 (PWM3CHA).

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

Invoke west build and west flash:

west build -b cytron_maker_nano_rp2040/rp2040 -p -S "usb-console" -d build/cytron_maker_nano_rp2040 bridle/samples/buzzer
west flash -d build/cytron_maker_nano_rp2040

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

Display Test and Demonstration

This samples and test applications are only applicable together with the Waveshare 2.4 LCD shield. This LCD module have to connected by free wiring.

Connect the Waveshare 2.4 LCD module by free wiring to the Arduino Nano header. Following module’s pin assignments for Arduino Nano R3.

Pin

Maker Nano RP2040

Pin

Waveshare 2.4 LCD

17

3V3(OUT)

1

VCC

29

GND

2

GND

14

SPI0_TX : D11

3

DIN COPI

ILI9341 Serial Data Input

16

SPI0_SCK : D13

4

CLK SCK

ILI9341 Serial Clock Input

13

SPI0_CSN : D10

5

CS CSN

ILI9341 Chip Select Input

10

GP7 : D7

6

DC DC

ILI9341 Data/Command

11

GP8 : D8

7

RST RST

ILI9341 Reset

12

GP9 PWM9 : D9

8

BL BL BL

LCD Backlight

LCD Orientation and Bit Order Test

See also Zephyr sample: Display.

west build -b cytron_maker_nano_rp2040/rp2040 -p -S "usb-console" --shield "waveshare_2_4_lcd" -d build/cytron_maker_nano_rp2040 zephyr/samples/drivers/display
west flash -d build/cytron_maker_nano_rp2040

LVGL Basic Sample

See also Zephyr sample: LVGL basic sample.

west build -b cytron_maker_nano_rp2040/rp2040 -p -S "usb-console" --shield "waveshare_2_4_lcd" -d build/cytron_maker_nano_rp2040 zephyr/samples/subsys/display/lvgl
west flash -d build/cytron_maker_nano_rp2040

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 0x200015a0 contains 2047 units in 11 buckets

  bucket#    min units        total      largest      largest
             threshold       chunks      (units)      (bytes)
  -----------------------------------------------------------
        0            1            2            1            8
        1            2            3            3           24
       10         1024            1         1046         8368

8416 free bytes, 7396 allocated bytes, overhead = 568 bytes (3.5%)

References