Open Source TinyUSB Stack Gets Tri-FIFO Support Courtesy of Sean Cross

Ported from ValentyUSB, the new USB device includes support for up to 16 IN and 16 OUT endpoints without excessive resource usage.

Gareth Halfacree
4 years ago β€’ HW101

The TinyUSB open source cross-platform USB stack, designed specifically for embedded devices, is set to gain a new feature in a future release: support for the eptri tri-FIFO USB device, offering 16 IN and 16 OUT endpoints without consuming excessive resources.

Supported on a range of microcontrollers, the TinyUSB stack aims to offer memory- and thread-safe USB control on resource-constrained devices without using dynamic allocation. The stack is set to get a shiny new function in its next release, courtesy of a pull request from Sean Cross to add support for a tri-FIFO device mode: eptri.

"[eptri] is a three-FIFO USB device. It presents one FIFO each for IN, OUT, and SETUP data. This allows for up to 16 IN and 16 OUT endpoints without sacrificing many USB resources," Cross explains in the device's documentation, originally written for its implementation in the bootloader for the Fomu ultra-compact FPGA development board as part of the ValentyUSB core. "USB supports four types of transfers: control, bulk, interrupt, and isochronous. This device does not yet support isochronous transfers, however it supports the other types of transfers. It contains special logic for handing control transfers, including the handshake that is required.

"Interrupt and bulk transfers are similar from an implementation standpoint – they differ only in terms of how often they are transmitted. These transfers can be made to any endpoint, and may even be interleaved. However, due to the nature of TriEndpointInterface any attempt by the host to interleave transfers will result in a `NAK`, and the host will retry later when the buffer is empty."

Cross submitted a pull request to the TinyUSB project just two days ago, and it has since been tweaked and passed all checks. The pull request, which can be viewed on GitHub, has been accepted for merging, but it is not yet clear when it will be merged and form part of a TinyUSB release.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles