This repo contains resources and scripts to create a project directory for building firmware for the RP2040 and RP2350 series MCUs.
You can use the RPX docker image where the prerequisites listed below are already set up for you. In that case, go here.
If you're setting up the environment by hand, be sure to check the following prerequisites:
- Install arm-none-eabi toolchain,cmake, ninja, git
- Install the
pico-sdkand point theCMakeLists.txtfile to it. - When using JLink, install JLink server
- When using openOCD, install openocd server
- (optional) Install Invoke, inside a Python environment(recommended) or globally.
If you're on WSL2, run the following inside WSL2.
Run the following in the bash terminal to create a new project:
source path/to/rpxPrj/create_prj.sh path/to/new/project/nameRun the following inside the newly created project directory to setup the project directory structure:
source ./setup_env.shAn example is shown here:
rpxprjSetup.mp4
- Be sure to setup Docker as required for your platform.
- Install the
dev container by Microsoftor theRemote dev packextensions in VS Code. - After the project has been setup, launch it inside VS Code
- VS Code will recognize the
.devcontainerdirectory and prompt you to build it. - Be sure to point the
dockerfilekey in thedevcontainer.jsonfile to the location of the RPXDockerfileon your computer. - The dev container extension will build the image, and open your project in the reloaded the VS Code window.
This is shown below:
rpxDevContainer.mp4
To build the project, run the following Invoke commands defined in the tasks.py file in the root of the project directory:
invoke buildTo flash the built firmware, make sure your programmer in this case, Segger JLink is connected and passed through to the docker container. Then run:
invoke flashYou can use inv instead of invoke. The defined tasks that depend on each other are run when required.
You can therefore run inv flash without running inv build first. Invoke will run it automagically.
- Click on the
Run and Debugbutton - Click on the
Start Debuggingbutton or pressF5 - Shown here:
visual.debug.cortex.mp4