RP2040-GEEK
| ||
Overview
Introduction
RP2040-GEEK is a geeks development board designed by Waveshare, onboard USB-A interface, 1.14-inch LCD screen, TF card slot, and other peripherals. It provides different firmware for SWD port, UART port, and I2C port.
Features
- RP2040 microcontroller chip designed by Raspberry Pi in the United Kingdom.
- Dual-core ARM Cortex M0+ processor, with a high operating frequency of up to 133MHz and flexible clock.
- Built-in 264KB of SRAM and 4MB of onboard Flash.
- Onboard 1.14-inch 240×135 pixel 65K color IPS LCD display.
- Onboard 3PIN SWD port for connecting the debugged target board.
- Standard CMSIS-DAP interface can be used to debug most ARM-based microcontrollers.
- Works with OpenOCD and other tools supporting CMSIS-DAP.
- Adopts the Raspberry Pi 3PIN Debug Connector Specification.
- Onboard 3PIN UART interface for USB serial adapter functionality
- Onboard 4PIN I2C port for the testing target board.
- Equipped with plastic case and cables.
- Open-source firmware, more convenient to upgrade.
Dimensions
Pico Getting Started
Firmware Download
Introduction
MicroPython Series
Install Thonny IDE
In order to facilitate the development of Pico/Pico2 boards using MicroPython on a computer, it is recommended to download the Thonny IDE
- Download Thonny IDE and follow the steps to install, the installation packages are all Windows versions, please refer to Thonny's official website for other versions
- After installation, the language and motherboard environment need to be configured for the first use. Since we are using Pico/Pico2, pay attention to selecting the Raspberry Pi option for the motherboard environment
- Configure MicroPython environment and choose Pico/Pico2 port
- Connect Pico/Pico2 to your computer first, and in the lower right corner of Thonny left-click on the configuration environment option --> select Configture interpreter
- In the pop-up window, select MicroPython (Raspberry Pi Pico), and choose the corresponding port
Flash Firmware
- Click OK to return to the Thonny main interface, download the corresponding firmware library and burn it to the device, and then click the Stop button to display the current environment in the Shell window
- Note: Flashing the Pico2 firmware provided by Micropython may cause the device to be unrecognized, please use the firmware below or in the package
- How to download the firmware library for Pico/Pico2 in windows: After holding down the BOOT button and connecting to the computer, release the BOOT button, a removable disk will appear on the computer, copy the firmware library into it
- How to download the firmware library for RP2040/RP2350 in windows: After connecting to the computer, press the BOOT key and the RESET key at the same time, release the RESET key first and then release the BOOT key, a removable disk will appear on the computer, copy the firmware library into it (you can also use the Pico/Pico2 method)
MicroPython Series
【MicroPython】 machine.Pin class function details
【MicroPython】machine.PWM class function details
【MicroPython】machine.ADC class function details
【MicroPython】machine.UART class function details
【MicroPython】machine.I2C class function details
【MicroPython】machine.SPI class function details
【MicroPython】rp2.StateMachine class function details
C/C++ Series
For C/C++, it is recommended to use Pico VS Code for development. This is a Microsoft Visual Studio Code extension designed to make it easier for you to create, develop, and debug projects for the Raspberry Pi Pico series development boards. No matter if you are a beginner or an experienced professional, this tool can assist you in developing Pico with confidence and ease. Here's how to install and use the extension.
- Official website tutorial: https://www.raspberrypi.com/news/pico-vscode-extension/
- This tutorial is suitable for Raspberry Pi Pico, Pico2 and the RP2040 and RP2350 series development boards developed by Waveshare
- The development environment defaults to Windows11. For other environments, please refer to the official tutorial for installation
Install VSCode
-
First, click to download pico-vscode package, unzip and open the package, double-click to install VSCode
Note: If vscode is installed, check if the version is v1.87.0 or later
Install Extension
-
Click Extensions and select Install from VSIX
-
Select the package with the vsix suffix and click Install
-
Then vscode will automatically install raspberry-pi-pico and its dependency extensions, you can click Refresh to check the installation progress
-
The text in the right lower corner shows that the installation is complete. Close VSCode
Configure Extension
-
Open directory C:\Users\username and copy the entire .pico-sdk to that directory
-
The copy is completed
-
Open vscode and configure the paths for the Raspberry Pi Pico extensions
The configuration is as follows:Cmake Path: ${HOME}/.pico-sdk/cmake/v3.28.6/bin/cmake.exe Git Path: ${HOME}/.pico-sdk/git/cmd/git.exe Ninja Path: ${HOME}/.pico-sdk/ninja/v1.12.1/ninja.exe Python3 Path: ${HOME}/.pico-sdk/python/3.12.1/python.exe
New Project
-
The configuration is complete, create a new project, enter the project name, select the path, and click Create to create the project
To test the official example, you can click on the Example next to the project name to select
-
The project is created successfully
-
Select the SDK version
-
Select Yes for advanced configuration
-
Choose the cross-compilation chain, 13.2.Rel1 is applicable for ARM cores, RISCV.13.3 is applicable for RISCV cores. You can select either based on your requirements
-
Select Default for CMake version (the path configured earlier)
-
Select Default for Ninjaversion
-
Select the development board
-
Click Complie to compile
-
The uf2 format file is successfully compiled
Import Project
- The Cmake file of the imported project cannot have Chinese (including comments), otherwise the import may fail
-
To import your own project, you need to add a line of code to the Cmake file to switch between pico and pico2 normally, otherwise even if pico2 is selected, the compiled firmware will still be suitable for pico
set(PICO_BOARD pico CACHE STRING "Board type")
Update Extension
-
The extension version in the offline package is 0.15.2, and you can also choose to update to the latest version after the installation is complete
Arduino IDE Series
Install Arduino IDE
-
First, go to Arduino official website to download the installation package of the Arduino IDE.
-
Here, you can select Just Download.
-
Once the download is complete, click Install.
Notice: During the installation process, it will prompt you to install the driver, just click Install
Arduino IDE Interface
-
After the first installation, when you open the Arduino IDE, it will be in English. You can switch to other languages in File --> Preferences, or continue using the English interface.
-
In the Language field, select the language you want to switch to, and click OK.
Install Arduino-Pico Core in the Arduino IDE
-
Open the Arduino IDE, click on the file in the top left corner, and select Preferences
-
Add the following link to the attached board manager URL, and then click OK
https://github.com/earlephilhower/arduino-pico/releases/download/4.0.2/package_rp2040_index.json
Note: If you already have an ESP32 board URL, you can use a comma to separate the URLs as follows:https://dl.espressif.com/dl/package_esp32_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/4.0.2/package_rp2040_index.json
-
Click Tools > Development Board > Board Manager > Search pico, as my computer has already been installed, it shows that it is installed
Upload Demo at the First Time
-
Press and hold the BOOTSET button on the Pico board, connect the pico to the USB port of the computer via the Micro USB cable, and release the button after the computer recognizes a removable hard disk (RPI-RP2).
- Download the program and open D1-LED.ino under the arduino\PWM\D1-LED path
-
Click Tools --> Port, remember the existing COM, do not click this COM (the COM displayed is different on different computers, remember the COM on your own computer)
-
Connect the driver board to the computer using a USB cable. Then, go to Tools > Port. For the first connection, select uf2 Board. After uploading, when you connect again, an additional COM port will appear
-
Click Tools > Development Board > Raspberry Pi Pico > Raspberry Pi Pico or Raspberry Pi Pico 2
- After setting it up, click the right arrow to upload the program
- If issues arise during this period, and if you need to reinstall or update the Arduino IDE version, it is necessary to uninstall the Arduino IDE completely. After uninstalling the software, you need to manually delete all contents within the C:\Users\[name]\AppData\Local\Arduino15 folder (you need to show hidden files to see this folder). Then, proceed with a fresh installation.
Open Source Demos
MircoPython video demo (github)
MicroPython firmware/Blink demos (C)
Raspberry Pi official C/C++ demo (github)
Raspberry Pi official micropython demo (github)
Arduino official C/C++ demo (github)
Sample Demo
C/C++ Demo
01-LCD
- It takes 2.5s to display a picture on the LCD.
- The example for LCD displaying the GUI.
02-picoprobe
- This demo is based on the open-sourced picoprobe demo.
- Run the picoprobe demo on the RP2040-GEEK, and it will analog a USB TO SWD and USB TO UART device.
- Use UART as the tool for USB to UART for communication with the device.
- Use the SWD interface as the debug tool for openocd to debug most of the arm chips.
- For more information on how to use picoprobe, please refer to the following "picoprobe Tutorial".
03-FATFS
- This demo is based on no-OS-FatFS-SD-SPI-RPi-Pico.
- This demo repeatedly attempts to mount an SD card and read its root directory, with the option to get its runtime information using a USB serial port.
- Note that the SD card file format is FAT32.
Micropython Demo
01-LCD
How to Use
1. Upload all py and BMP files to RP2040-GEEK via thonny.
Demo Effect
- LCD displays the GUI, and then bmp picture after a few seconds.
02-SD
How to Use
- Upload all the py files to the RP2040-GEEK via thonny, and reset.
Demo Effect
- After RP2040-GEEK resets, it will automatically mount the SD card to the sd file according to the "boot.py" demo.
- Double-click the SD file folder and you can see the file stored on the SD card.
PicoProbe Tutorial
Install OpenOCD
Linux (and Raspberry Pi)
Download the dependency library
sudo apt install automake autoconf build-essential texinfo libtool libftdi-dev libusb-1.0-0-dev
Get and compile
git clone https://github.com/raspberrypi/openocd.git cd openocd ./bootstrap ./configure make -j4 sudo make install
Windows
- Because OpenOCD self-compilation is complicated in the Windows environment, it is recommended to use the compiled version
- Click this link to download
- Unzip and store in a shorter directory, such as directly in the C drive
Add environment variables
- Click on the Start menu and search for "Environment Variables"
- Click on "Edit the System Environment Variables"
- Double-click the "Path" variable to enter the editing interface
- Add a new path
- ①Create a new variable address
- ②Enter the address where the OpenOCD is stored
- ③Click OK to save
- Click "OK" to save your changes
- Restart the computer
Install GDB
Linux (and Raspberry Pi)
- Install gdb-multiarch
sudo apt install gdb-multiarch
Windows
- If you have the pico-sdk environment installed correctly, skip this step, as GDB is already included in the Arm GNU Toolchain
- If you do not have pico-sdk installed, it is recommended to use the official pico installer to install it
sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c "program blink.elf verify reset exit"
Flash and Debug with Pico Debug Probe
Flash Demo
- Pico Debug Probe allows you to load binary files via the SWD port and OpenOCD
- Every time you push a new binary file to Pico, you do not need to unplug and then hold down the BOOTSEL button
- Using RP2350 as an example, the flashing command is
sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c "program {your elf file name}.elf verify reset exit”
Debug Demo
Open OpenOCD Server
- You can use openocd in server mode and connect it to GDB, providing you with breakpoints and "correct" debugging
- Using RP2350 as an example again, enter the following Linux command
sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000"
- In Windows PowerShell, enter the following command
Starting to listen to the 3333 interface of this machine at this time indicates that the OpenOCD server has been successfully turned on
- Using RP2350 as an example again, enter the following Linux command
Use GDB Command Line
- This demo is built based on the pico-sdk environment, and the pico-example is compiled
- Open PowerShell and go to the corresponding build folder, here the blink demo is used as an example
- Open GBD and enter the following command
- If it is Windows, the input command is
arm-none-eabi-gdb blink.elf
- If it is Linux, the input command is
gdb blink.elf
- If it is Windows, the input command is
- Enter the following commands in sequence
target remote localhost:3333 load continue
After successful execution, you can see pico executing blink, the led flickers
Debug with VSCode
- Make sure that Open OpenOCD Server and Use GDB Command Line are working properly
- Make sure that the Pico compilation environment is set up properly
- Make sure you have the following plugins installed on your VSCode
- Cortex-Debug
- Cmake-tools
- C/C++
- First open the OpenOCD server
- Open the pico-examples folder with VSC and start the blink demo
- Use the shortcut key F1 and enter the following command
open 'launch.json'
- Once opened, put the following in it
- If it is Windows, then enter
{ "version": "0.2.0", "configurations": [ { "name": "Pico Debug", "type":"cortex-debug", "cwd": "${workspaceRoot}", "executable": "${command:cmake.launchTargetPath}", "request": "launch", "servertype": "external", // This may need to be arm-none-eabi-gdb depending on your system "gdbPath" : "gdb", // Connect to an already running OpenOCD instance "gdbTarget": "localhost:3333", "svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd", "runToMain": true, // Work around for stopping at main on restart "postRestartCommands": [ "break main", "continue" ] } ] }
- If it is Linux, then enter
{ "version": "0.2.0", "configurations": [ { "name": "Pico Debug", "type":"cortex-debug", "cwd": "${workspaceRoot}", "executable": "${command:cmake.launchTargetPath}", "request": "launch", "servertype": "external", // This may need to be arm-none-eabi-gdb depending on your system "gdbPath" : "arm-none-eabi-gdb", // Connect to an already running OpenOCD instance "gdbTarget": "localhost:3333", "svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd", "runToMain": true, // Work around for stopping at main on restart "postRestartCommands": [ "break main", "continue" ] } ] }
- The difference between the two is that the gdb called is different
- Enter the Run & Debug interface with shortcut keys Ctrl+Shift+D
- ①Select Pico Debug as the debugger
- ②Select CMake as debug mode
- ③Start debugging button, shortcut key F5
- ④Select blink as debugging object
- Click the debug button to enter the debugging mode, and the shortcut key is F5
- The debugging toolbar appears
- ①Restart your device
- ②Continue to run the program
- ③Single-step execution
- ④Enter function running
- ⑤Exit function running
- ⑥Stop debugging
- Click to continue running the program, using the shortcut key F5, you will see the pico running the blink program
Flash and Debug with Pico VSCode (recommended)
- Please install the Pico VSCode plugin before use
- After installing the Pico VSCode plugin, no additional environment setup is required. You can follow the steps below to flash and debug the program.
Import Project
-
When creating or importing a project, select SWD debugging
- ①Select project directory
- ②Select SWD debugging
- ③Import the project
- ①Select project directory
Flash Demo
-
Flash the demo
- ①Select product model
- ②Select SDK version
- ③Enter the Pico VSCode plugin page
- ④Click SWD to flash the demo
- ①Select product model
Debug Demo
-
Debug the demo
- ①Click Debug Project
- ②Select SDK version
- ③Enter the Pico VSCode plugin page
- ④Use SWD to flash the demo
- ①Click Debug Project
-
Debugging interface
- ①Restart your device
- ②Continue to run the demo
- ③Single-step execution
- ④Enter function running
- ⑤Exit function running
- ⑥Restart debugging
- ⑦Stop debugging
- ⑧Serial port monitor
- ⑨Variable window
- ⑩Monitoring window
- ①Restart your device
-
Breakpoint debugging
- ①You can add or delete breakpoints before clicking the line number
- ②Breakpoints can be added or removed at any time during debugging
- ①You can add or delete breakpoints before clicking the line number
Resource
Document
Demo
Official Resources
Raspberry Pi Official Datasheet
- Get Started With Pico Manual
- Pico C SDK User Manual
- Pico Python SDK User Manual
- RP2040 Datasheet
- Pico2 Debugging Manual
Raspberry Pi Open-source Demo
- Raspberry Pi Official C/C++ demo (github)
- Raspberry Pi micropython demo (github)
- picoprobe source code (github)
Development Softwares
- Zimo221.7z
- Image2Lcd.7z
- Font Library Tutorial
- Image Extraction Tutorial
- Thonny Python IDE (Windows V3.3.3)
FAQ
RP2040-GEEK LCD controller is ST7789VW.
{{{5}}}
Support
Technical Support
If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)