Git Product home page Git Product logo

mch2022-firmware-rp2040's Introduction

MCH2022 badge RP2040 firmware

This firmware implements a co-processor firmware which makes the RP2040 function as both a dual USB to serial converter and an I2C slave device which allows the ESP32 to read button states and control things like the FPGA control signals and the SAO GPIOs.

SDK version

This firmware has been tested to work when built using pico-sdk version 1.3.1 and 1.5.1

How to build

  1. Set up the Pico SDK and try to compile an example to check whether it's set up correctly
  2. Run make build to build the firmware, make flash to flash or make to build & flash

If you're getting compilation errors, make sure you have the newest version of all toolchain components and run make clean before retrying.

License information

The included bootloader is based on RP2040 serial bootloader by Brian Starkey, licensed under BSD-3-Clause license.

The I2C peripheral function is based on pico_i2c_slave by Valentin Milea, MIT license.

The NEC infrared transmitter library is rpi-pico-nec-ir-transmit-pio by mjcross, licensed under BSD-3-Clause license.

The USB descriptor is based on the example from the tinyusb library by Ha Thach licensed under MIT license.

The makefile has been provided by Jana Marie Hemsing under MIT license.

The other parts of the firmware are original work by Renze Nicolai (Nicolai Electronics) licensed under MIT license.

Debugging

You need the Raspberry Pi supplied version of openocd and a Raspberry Pi Pico flashed with the Picoprobe firmware hooked up to the SWD interface of the badge for this to work.

Running OpenOCD

openocd -f interface/picoprobe.cfg -f target/rp2040.cfg -s tcl

Running GDB

arm-none-eabi-gdb build/rp2040_firmware.elf

Connecting GDB to OpenOCD

(on the GDB prompt)

target extended-remote :3333

Loading firmware, resetting the RP2040 and starting the firmware

load
monitor reset init
continue

mch2022-firmware-rp2040's People

Contributors

jana-marie avatar pwuts avatar renzenicolai avatar smunaut avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mch2022-firmware-rp2040's Issues

USB CDC sends corrupted data in specifc circumstances

In uart_task.c we use tud_cdc_n_read to read from the USB_CDC_ESP32. This function returns a length and places data into a buffer.

When connecting a terminal program (tested with screen) the tud_cdc_n_read returns garbage data, specifically some data that has previously been sent by the ESP32 to the RP2040, so it's data that was in the transmit buffer of the CDC interface. The tud_cdc_n_read actively writes to our buffer so this appears to be an SDK bug.

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.