Skip to content
/ rpxPrj Public

scripts to setup,start,debug an RP2040 or RP2350 series embedded project with Invoke orchestration

Notifications You must be signed in to change notification settings

raynayx/rpxPrj

Repository files navigation

Raspberry Pi RP2040 and RP2350 series project setup scripts

About

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.

Prerequisites

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-sdk and point the CMakeLists.txt file to it.
  • When using JLink, install JLink server
    • When using openOCD, install openocd server
  • (optional) Install Invoke, inside a Python environment(recommended) or globally.

Linux or Windows Subsystem for Linux(WSL2)

If you're on WSL2, run the following inside WSL2.

Creating a new project

Run the following in the bash terminal to create a new project:

source path/to/rpxPrj/create_prj.sh path/to/new/project/name

Setting up the project

Run the following inside the newly created project directory to setup the project directory structure:

source ./setup_env.sh

An example is shown here:

rpxprjSetup.mp4

VS Code Dev Container

  • Be sure to setup Docker as required for your platform.
  • Install the dev container by Microsoft or the Remote dev pack extensions in VS Code.
  • After the project has been setup, launch it inside VS Code
  • VS Code will recognize the .devcontainer directory and prompt you to build it.
  • Be sure to point the dockerfile key in the devcontainer.json file to the location of the RPX Dockerfile on 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

Building the project

To build the project, run the following Invoke commands defined in the tasks.py file in the root of the project directory:

invoke build

Flashing the project

To 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 flash

You 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.

Visual debugging with VS Code(Cortex Debug extension)

  • Click on the Run and Debug button
  • Click on the Start Debugging button or press F5
  • Shown here:
    visual.debug.cortex.mp4

About

scripts to setup,start,debug an RP2040 or RP2350 series embedded project with Invoke orchestration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published