Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Examples for the BSP raspberrypi-rp2xxx

Demos

Demos are divided into two categories:

  • Those that can be compiled for/run on both RP2040 (Pico 1) and RP2350 (Pico 2) with no code changes
  • Those that are ONLY for a specific chip, RP2040 or RP2350 due to a unique feature present on one but not the other
  • Note that since the wireless boards (Pico 1 W and Pico 2 W) require the LED to be driven in a slightly different manner, these are included in a separate section alongside some wireless specific tests

Currently many demos are marked as "RP2040 only" simply because HAL functionality hasn't been ported to the RP2350 given it's a very new chip. Most examples will eventually be able to run on either chip with no changes due to their peripherals being extremely similar. All demos that run on the the Pico board can also be run on the RP2040-Plus without modification.

Chip Agnostic

RP2040 Only

  • adc on the Pico board
    This example takes periodic samples of the temperature sensor and prints it to the UART using the stdlib logging facility.
  • blinky core1 on the Pico board
    Blinks the LED on the board using the second CPU.
  • flash program on the Pico board
    Writes and reads data into the flash.
  • i2c bus scan on the Pico board
    Prints all I²C devices on UART0 (Pin 0,1) attached to I²C on SCL=GPIO4, SDA=GPIO5.
  • pwm on the Pico board
    Slowly blinks the LED on the Pico with a smooth blinking using PWM.
  • random on the Pico board
    Showcases how to use the internal random generator.
  • spi host on the Pico board
    Showcases how to use the SPI host controller.
  • squarewave on the Pico board
    Showcases how to use the PIO to emit a basic square wave.
  • uart on the Pico board
    Showcases how to use the UART together with std.log.
  • usb hid on the Pico board
    A really basic example how to implement a USB HID device. You can use the Python 3 script scripts/hid_test.py to test the HID device.
  • ws2812 on the Pico board
    Showcases how to control one WS2812 LED attached to GPIO23.
  • tiles on the RP2040-Matrix board
    Showcases how to control the LED matrix on the development board to do a simple color flipper effect.

RP2350 Only

None for now! But an HSTX or other new feature example could go here in the future.

CYW43

Flashing

You can flash all examples using either your file browser by dragging the example .uf2 file from zig-out/firmware/ to the directory.

Or you can use picotool to flash a uf2 file:

[user@host] raspberrypi-rp2040/ $ picotool load -x zig-out/firmware/${file}.uf2
Loading into Flash: [==============================]  100%

The device was rebooted to start the application.
[user@host] raspberrypi-rp2040/ $