SPRADN7 January   2025 AM2612

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 Real-World Applications for USB
    2. 1.2 Acronyms Used in This Document
  5. 2AM261x USB Offering
    1. 2.1 AM261x USB Hardware
    2. 2.2 AM261x USB Software
      1. 2.2.1 Software Architecture
      2. 2.2.2 AM261x USB Application Example
      3. 2.2.3 USB DFU Bootloader
  6. 3USB Use Cases and Applications
  7. 4References

AM261x USB Software

The robust driver libraries provide seamless interaction between the microcontroller and USB peripherals, simplifying development. USB, sometimes perceived as a rather complex protocol, has been made easy to work with by TinyUSB. The TinyUSB stack is a very feature-rich open-source USB stack that is thread-safe, memory-safe with no dynamic run-time allocation of memory. With the TinyUSB stack, the developer can easily create applications using the USB classes provided in the TinyUSB stack. The TinyUSB stack already has some examples in-built inside the source code for both device and host modes. For example, the stack contains examples for HID host controller, which can be easily ported out of the stack and built in the MCU_PLUS_SDK. To support classes such as RNDIS with TCP/IP, TinyUSB stack can also be configured to work with LwIP stack.

The low-level USB driver can be divided in two parts, the system-on-chip (SoC) porting layer, which has information specific to the port on AM261x and the actual USB Device Core Driver which implements the complete USB functionality. The application developer can either directly use the driver without the involvement of the middle-ware stack (TinyUSB stack) and write applications over it, OR, the middle-ware stack can be used which eases the development process a lot.

 AM261x USB Software Block
                    Diagram Figure 2-2 AM261x USB Software Block Diagram

The TinyUSB stack supports the following classes: Audio, Video, Bluetooth, CDC, DFU, HID, MIDI, MSC, Network, USBTMC, Vendor, and so forth, but not all of these are feasible to be run on AM261x (for example, Bluetooth® class cannot be enabled due to no Bluetooth hardware on the AM261x). To enable a new class that is not supported in the SDK out-of-box, the developer just needs to:

  1. Create a tusb_config.h file, describing the size of endpoints, the class, size of Tx and Rx buffers, and so forth.
  2. Have the Device driver support all the required endpoints and transfer callback functions.
  3. Have an application built with the required USB class.
  4. Rebuild the TinyUSB stack and link it to the application.
  5. Rebuild the application.

With the steps above, the users can quickly enable different USB classes that are not a standard SDK offering.