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

From eLinux.org
Jump to: navigation, search
(Description)
(USB Host Controller)
Line 62: Line 62:
 
==Method of Implementation==
 
==Method of Implementation==
 
=== USB Host Controller ===
 
=== USB Host Controller ===
 +
The USB Host Controller Driver is the layer between the USB Host Controller Hardware and the USB Host Core. This layer handles hardware specific interfaces.<br>
 +
 
==== Enumeration ====
 
==== Enumeration ====
 
The host enumerate the device by issuing control transfers containing standard USB requests to the device. All USB devices must support control transfers, standard requests, and endpoint zero.<br>
 
The host enumerate the device by issuing control transfers containing standard USB requests to the device. All USB devices must support control transfers, standard requests, and endpoint zero.<br>

Revision as of 01:19, 16 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

Why develop PRU-Based USB stack?
As we know, Linux wasn’t designed as a real-time operating system that can guarantee a rate of data transfer with a peripheral. With multi-tasking, multiple programs run at the same time, and the OS grants a portion of the valuable time to each thread. Different threads can have different priorities. RPU is a solution of this which BeagleBoard device can be beneficial of minimize the latency for USB peripherals.

Features

  • Implement USB Host Controller for PRU
  • Implement USB Host Core for PRU
  • Support USB class driver for (MIDI, HID, AUDIO)
  • Providing detailed Documentation for USB Host API

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

USB Host Controller

The USB Host Controller Driver is the layer between the USB Host Controller Hardware and the USB Host Core. This layer handles hardware specific interfaces.

Enumeration

The host enumerate the device by issuing control transfers containing standard USB requests to the device. All USB devices must support control transfers, standard requests, and endpoint zero.

Descriptors

USB descriptors are the data structures that enable the host to learn about a device. Each descriptor contains information about the device as a whole or an element of the device.

Types of descriptor:-

  • Device Descriptors
  • Configuration Descriptors
  • Interface Descriptors
  • Endpoint Descriptors
  • String Descriptors

USB Host Core

Elements of a Control Transfer

  • Setup Stage
  • Data Stage
  • Status Stage

Error Handling

Standard Requests

  • Get Status
  • Clear Feature
  • Set Feature
  • Set Address
  • Get Descriptor
  • Set Descriptor
  • Get Configuration
  • Set Configuration
  • Get Interface
  • Set Interface
  • Synch Frame
  • Set SEL
  • Set Isochronous Delay

USB Host Device Class

USB defines class code information that is used to identify a device’s functionality and to nominally load a device driver based on that functionality.

Base Class Descriptor Usage Description
01h Interface Audio
03h Interface HID

Audio (MIDI)

Device Class Definition for MIDI

HID

Device Class Definition for HID

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