Skip to content

Latest commit

 

History

History

pico_w

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Bluepad32 for Pico W

Install dependencies

You need to install Pico SDK. The instructions are different for Linux/macOS and Windows.

Recommended: Use Pico SDK 2.1 or newer.

Pico SDK for Linux / macOS

Install Pico SDK: https://github.com/raspberrypi/pico-sdk

And set PICO_SDK_PATH to the correct path:

# set PICO_SDK_PATH to the correct path
export PICO_SDK_PATH=$HOME/pico-sdk/

Pico SDK for Windows

Follow these instructions

Build

And then build

mkdir build
cd build
cmake ..
make -j

If PICO_BOARD is not specified, it will use pico_w. To compile it for Pico 2 W, do:

# From the recently crated "build" folder
cmake -DPICO_BOARD=pico2_w ..
make -j

Copy build/bluepad32_picow_example_app.uf2 to Pico W.

Use this guide if you are not sure how to do it:

Debugging

In case you need to debug it using gdb, the recommended way is to get a Pico Debug Probe module, and follow the Pico Debug Probe instructions.

TL;DR: Open 3 terminals, and do:

Terminal 1

# Edit CMakeList.txt file and enable UART console, and disable USB console
vim CMakeList.txt

# Make sure you have these lines:
> pico_enable_stdio_usb(bluepad32_picow_example_app 0)
> pico_enable_stdio_uart(bluepad32_picow_example_app 1)
# Compile in debug mode
mkdir build
cd build
cmake -DPICO_BOARD=pico_w -DCMAKE_BUILD_TYPE=Debug ..
make -j
# Flash it using OpenOCD
sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c "program bluepad32_picow_example_app.elf verify reset exit"
# Open OpenOCD
sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000"

Terminal 2

arm-none-eabi-gdb bluepad32_picow_example_app.elf
> target remote :3333
> monitor reset init
> continue

Terminal 3

# macOS
tio /dev/tty.usbmodem21202

# Linux
tio /dev/ttyACM0

License