Difference between revisions of "BeagleBoard/GSoC/2022 Proposal/PRU-based USB stack"

From eLinux.org
Jump to: navigation, search
(Timeline)
(PRU-USB Device)
Line 110: Line 110:
 
IN and OUT state machine for endpoints<br>
 
IN and OUT state machine for endpoints<br>
 
Endpoint configuration<br>
 
Endpoint configuration<br>
 +
 +
'''USB Class Driver'''<br>
 +
P.S.: If I can complete the USB core for Host/Device on time will look into implement USB Class.<br>
 +
<br>
 +
This is a layer containing functions that are class specific for the application.<br>
 +
Class Driver will be supported is :-<br>
 +
* Audio [https://www.usb.org/sites/default/files/audio10.pdf Class Definition]
 +
* HID [https://www.usb.org/sites/default/files/hid1_11.pdf Class Definition]
 +
* MIDI [https://www.usb.org/sites/default/files/midi10.pdf Class Definition]
  
 
==Timeline==
 
==Timeline==

Revision as of 19:48, 11 April 2022


Proposal Template

About Student: Seak Jian De
Mentors: Jason Kridner, giuliomoro
Code: [N/A]
Wiki: https://elinux.org/index.php?title=BeagleBoard/GSoC/2022_Proposal/PRU-based_USB_stack
GSoC: PRU-based USB stack

Status

This project is currently just a proposal.

Proposal

Completed all the requirements listed on the ideas page. the code for the cross-compilation task can be found here submitted through the pull request #158.

About you

IRC: Jian De
Github: https://github.com/Fred-JD
School: Universiti Teknologi Malaysia
Course: 3rd Year Electronics Engineering
Country: Malaysia
Language: English, Mandarin, Malay
Typical work hours: 4PM - 11PM UTC +8
Previous GSoC participation: First year apply gsoc.

About your project

Project Name

PRU-based USB stack

Description

It should be possible to write a USB stack for PRU. The PRU-controlled USB interface should be able to work either as device or a host. The goal would be to minimize the latency for USB peripherals, specifically audio, HID and MIDI devices used for musical instruments, to integrate into the Bela.io software environment.

Introduction

USB Concept

Transfer Types[1]

  • Control Transfers
  • Bulk Transfers
  • Interrupt Transfers
  • Isochronous Transfers

USB Protocol[2]
Descriptors

Each device contains Descriptors which contain information about the device.

Interfaces

USB devices publish their endpoints as part of an Interface.

Endpoints

USB pipes are opened to Endpoints. Devices publish Endpoint descriptors to enable clients to query what endpoint are available and what characteristics they have. Endpoint descriptors contain information about the I/O direction (IN which is from the device to the host or OUT which is from the host to the device), the transfer type (Control, Bulk, Interrupt, or Isochronous) and the maximum supported packet size.

Pipes

Communication between the host and a USB device is performed through Pipes.

Method of Implementation

PRU-USB Host

The above picture is a visualization of the PRU USB Host stack.

USB Host Core Layer
This layer containing functions to manage USB peripherals and the USB bus. This layer interface between USB Host Controller (OHCI/EHCI).
The functions in this layer are:

  • USB Task
  • Initialize USB host stack and Host Controller Hardware
  • Config Descriptor
  • Host send setup request
  • Event Managements
  • Handle Host event and executes enumeration
  • Host Standard Request
  • Send Control Request
  • Set Device Configuration
  • Get Device Configuration
  • Get Descriptor
  • Get Device Status
  • Clear Endpoint Stall
  • Set Interface Alt Setting
  • Get Interface Alt Setting
  • Get Device Descriptor

USB Class Driver
P.S.: If I can complete the USB core for Host/Device on time will look into implement USB Class.

This is a layer containing functions that are class specific for the application.
Class Driver will be supported is :-

The design concept is inspired from:
LUFA (USB stack for AVR) [3]
RTUSB-32 [4]

PRU-USB Device

USB Device Core

  • USB Task
  • Initialize USB host stack and Host Controller Hardware
  • Config Descriptor
  • Host send setup request
  • Event Managements
  • Handle Host event and executes enumeration
  • Device Standard Request
  • Set Address
  • Set Configuration
  • Get Configuration
  • Get Descriptor
  • Get Status
  • Clear Set Feature

USB Device Control Handling [5]
IN and OUT state machine for endpoints
Endpoint configuration

USB Class Driver
P.S.: If I can complete the USB core for Host/Device on time will look into implement USB Class.

This is a layer containing functions that are class specific for the application.
Class Driver will be supported is :-

Timeline

Provide a development timeline with a milestone each of the 11 weeks and any pre-work. (A realistic timeline is critical to our selection process.)

Date Status Details
Presubmission
  • Understand USB Host/Device function
  • Research how RTOS implement USB stack
  • Try to make a simple USB device stack on Arduino Board (HID) using joystick
May 20th - June 12th Community Bonding
  • Research how RTOS implement USB stack
  • Required hardware will be available to me, and I will start test to read USB using PRU.
  • Start going through the PRU documentation.
June 13th Milestone #1
  • Introduction Video
  • Work on USB host initialize connect USB by mapping OHCI/EHCI.
June 20th Milestone #2
  • Work on USB Host core
  • Control Request (Endpoint0)
  • Descriptor Request
  • Interface
June 27th Milestone #3
  • Work on USB Host core
  • Endpoint (IN/OUT)
  • Control Request
  • Host Event
July 4th Milestone #4
  • Work on USB Host core
  • USB protocol (Token Packet, Data Packet, Status Packet)
  • Check functionality of USB Host Core.
July 11th Milestone #5
  • Work on USB device core
  • USB Vendor and Product identifiers
July 18th Milestone #6
  • Work on USB device core
  • USB device controller drivers
July 25th Milestone #7
  • Work on USB device core
  • USB device Configuration
August 1st Milestone #8
  • Work on USB device core
  • USB device Interface
  • USB device Endpoint
August 8th Milestone #9
  • Documentation for PRU-USB for host and device
  • Test USB core functionality
August 15th Milestone #10
  • Work on USB device
  • USB device Interface
  • USB device Endpoint
August 22nd Milestone #11

If the USB core API function well will move on working with MIDI class function.

August 29th Milestone #12
  • Submit final work product and final mentor evaluation
  • Complete YouTube video
Sep. 5th Milestone #13
  • Completion of GSoC

Experience and approach

In 5-15 sentences, convince us you will be able to successfully complete your project in the timeline you have described.

  • In my first year of University I have passed the 3 month junior training program by ROBOCON UTM which include basic programming, basic electronics and basic Mechanisms.
* I have built a line following robot with dsPIC30f4011 microcontroller. Solder and design my own hardware with the PIC microcontroller. Understand about GPIO, PWM, UART, ADC/DAC. I have experience in C programming and know how circuit connection with breadboard. photo.
* I have build a custom PCB to control robotic pneumatic valve with Altium designer. photo
  • I have build a flutter mobile app which read and display sensor value from Bluetooth module with Maker Uno (similar with Arduino Uno). Then store the value on AWS with MQTT protocol.\
  • I have build Footfall Counter with openCV github
  • In order to successfully to complete the projects, I will start it early which start to work with the technology before official code period so I have extra time for debug and testing.

Contingency

What will you do if you get stuck on your project and your mentor isn’t around?

Benefit

Misc

Completed all the requirements listed on the ideas page. the code for the cross-compilation task can be found here submitted through the pull request #158.

Suggestions

Is there anything else we should have asked you?

Reference