Giter Site home page Giter Site logo

cc3501-rp2040-labs's Introduction

Starter code for CC3501 labs

This is intended as a starting point for CC3501 students to build their own code for labs. The repository contains:

  1. Preconfigured CMakeLists.txt that supports building embedded code for the target as well as native Windows code for a test harness.
  2. Very minimal example for how to interact with WS2812 addressable LEDs (plus minimal example of native mock for testing purposes).

Code organisation

Path Description
src Main program source code
src/main.cpp Main program entry point
src/drivers Hardware drivers
src/drivers/WS2812/ Low level driver for WS2812 using PIO
src/drivers/logging/ Example basic log driver
tests Code to support the native build for testing
tests/mocks/ Mock implementations of Pico SDK to enable native build

Setup instructions

Pico toolchain

Download and install the official RP2040 toolchain.

Visual Studio Build Tools

For building the native Windows app for local debugging, install Build Tools for Visual Studio 2022.

Visual Studio Code

You must run VS Code from the shortcut in the Raspberry Pico folder (which sets up the environment variables for you).

Building for the embedded hardware

To build and debug on the embedded hardware, select a GCC cross-compiling kit from the list as the bottom of the VS Code window. You will also need to choose Cortex Debug as the launch target from the list at the bottom of the VS Code window.

Building a native Windows app

To build and debug natively, select the Visual Studio Build Tools as the CMake kit. You will also need to choose (Windows) Launch as the launch target from the list at the bottom of the VS Code window.

The native Windows build allows you to test algorithms, math, etc in an easier development environment. Later, you will also be able to set up automated unit tests to validate parts of your code.

Build instructions for both platforms

The first time you build, you may need to manually trigger it. Use the CMake extension (left side of the VS Code window) to configure and then build the project. Make sure that the binaries are being produced.

The first time that you debug, you may need to use the Run and Debug panel (left side of the VS Code Window) to choose the launch target. These should be either Cortex Debug or (Windows) Launch.

When switching kits, or on the first time, it is helpful to manually set the configuration. This is the Debug or Release build, chosen using the toolbar at the bottom of the window, between the launch config and the compiler kit.

Credits

  • The src/drivers/WS2812/WS2812.pio file is an example for the RP2040 provided by the Raspberry Pi foundation, used under the terms of the BSD license.

cc3501-rp2040-labs's People

Contributors

bronsonp avatar

Watchers

 avatar LauranceP avatar  avatar

Forkers

lachlanarboit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.