/Raspberry-Pico-SDK-USB

Raspberry Pico SDK USB Stack

Primary LanguageCBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Raspberry Pico Native SDK-based Device USB stack

This repo is now archived as of 25th August 2024, and no further development will take place on it.

New SDK2 version available here

Proof-of-Concept development to help understand USB device stack operation in a Pico SDK/Hardware context.

8th February Update : debug/logging and other improvements.

10th February Update : add USB info to status startup screen.

14th February Update : fix strings defect and add language id.

The 'stack' 1 is written in C, and is derived from the low-level device example supported by the Raspberry Pico documentation set.

Extensive debug/log reporting via UART0 has been provided in lieu of an external hardware USB protocol analyser.

Synchronous (blocking) and Asynchronous (interrupt-driven) transmission functions are provided.

Multipacket transfers are currently supported in Pico-to-Host direction only.

No attempt to optimise memory usage, code size, style or performance has been made at this stage.

The repository may be extensively modified or made unavailable at any time without notice.

Some unresolved issues (possibly related to stack usage ?) remain in the endpoint handler.

Usage

The example provided simulates a continually-running joystick.

Once compiled, the uf2 image can be uploaded as normal and the Pico attached to a host machine.

Debug Probe / Picoprobe or other UART interface device required to view debug messages.

Pico should then enumerate as a Human Interface Device / Joystick game controller and send continuous axis movement and button activity to the host.

Windows Game Controllers

Windows Game Controllers

On a Windows machine, type joy.cpl into the search box to display the game controller properties.

Control Panel Joystick

The properties windows should update continually at a nominal rate of 3Hz.

Pico pre-built .uf2 binary

Pre-Built .uf2 available here

Pico Debug Output

Pico Debug Output

debug

Testing

Testing has been performed with a Windows 10 22H2 Host and a Pico Chip B2, ROM V3 device only.

Acknowledgements

Raspberry Pico Forum Thread

This repository is currently associated with the following Raspberry Pico forum thread :-

Footnotes

  1. The 'stack' is more of a 'controller' at this stage of development. There are no published APIs or documentation available.