You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TinyUSB is funded by: Adafruit. Purchasing products from them helps to support this project.
7
10
8
11
.. figure:: docs/assets/adafruit_logo.svg
9
12
:alt:Adafruit Logo
13
+
:align:left
10
14
:target:https://www.adafruit.com
11
15
12
-
TinyUSB Project
13
-
===============
16
+
.. raw:: html
17
+
18
+
<divclass="clear-both"></div>
19
+
20
+
Overview
21
+
--------
14
22
15
23
.. figure:: docs/assets/logo.svg
16
24
:alt:TinyUSB
25
+
:align:left
26
+
27
+
.. raw:: html
28
+
29
+
<divclass="clear-both"></div>
30
+
31
+
TinyUSB is an open-source cross-platform USB Host/Device stack for embedded systems. It’s designed for memory safety
32
+
(no dynamic allocation) and thread safety (all interrupts deferred to non-ISR task functions). The stack emphasizes portability,
33
+
small footprint, and real-time performance across 50+ MCU families.
17
34
18
-
TinyUSB is an open-source cross-platform USB Host/Device stack for embedded system, designed to be memory-safe with no dynamic allocation and thread-safe with all interrupt events are deferred then handled in the non-ISR task function. Check out the online `documentation <https://docs.tinyusb.org/>`__ for more details.
35
+
Key Features
36
+
------------
37
+
38
+
* **Thread-safe:** USB interrupts deferred to task context
39
+
* **Memory-safe:** No dynamic allocation, all buffers static
40
+
* **Portable:** Supports 50+ MCU families
41
+
* **Comprehensive:** Includes CDC, HID, MSC, Audio, and Host support
42
+
* **RTOS-friendly:** Works with bare metal, FreeRTOS, RT-Thread, and Mynewt
19
43
20
44
.. figure:: docs/assets/stack.svg
21
45
:width:500px
46
+
:align:left
22
47
:alt:stackup
23
48
49
+
.. raw:: html
50
+
51
+
<divclass="clear-both"></div>
52
+
24
53
::
25
54
26
55
.
@@ -36,7 +65,7 @@ TinyUSB is an open-source cross-platform USB Host/Device stack for embedded syst
36
65
37
66
38
67
Getting started
39
-
===============
68
+
---------------
40
69
41
70
See the `online documentation <https://docs.tinyusb.org>`_ for information about using TinyUSB and how it is implemented.
42
71
@@ -49,7 +78,7 @@ For bugs and feature requests, please `raise an issue <https://github.com/hathac
49
78
See `Porting`_ guide for adding support for new MCUs and boards.
50
79
51
80
Device Stack
52
-
============
81
+
------------
53
82
54
83
Supports multiple device configurations by dynamically changing USB descriptors, low power functions such like suspend, resume, and remote wakeup. The following device classes are supported:
55
84
@@ -70,7 +99,7 @@ Supports multiple device configurations by dynamically changing USB descriptors,
70
99
If you have a special requirement, ``usbd_app_driver_get_cb()`` can be used to write your own class driver without modifying the stack. Here is how the RPi team added their reset interface `raspberrypi/pico-sdk#197 <https://github.com/raspberrypi/pico-sdk/pull/197>`_
71
100
72
101
Host Stack
73
-
==========
102
+
----------
74
103
75
104
- Human Interface Device (HID): Keyboard, Mouse, Generic
76
105
- Mass Storage Class (MSC)
@@ -81,14 +110,14 @@ Host Stack
81
110
Similar to the Device Stack, if you have a special requirement, ``usbh_app_driver_get_cb()`` can be used to write your own class driver without modifying the stack.
82
111
83
112
Power Delivery Stack
84
-
====================
113
+
--------------------
85
114
86
115
- Power Delivery 3.0 (PD3.0) with USB Type-C support (WIP)
87
116
- Super early stage, only for testing purpose
88
117
- Only support STM32 G4
89
118
90
119
OS Abstraction layer
91
-
====================
120
+
--------------------
92
121
93
122
TinyUSB is completely thread-safe by pushing all Interrupt Service Request (ISR) events into a central queue, then processing them later in the non-ISR context task function. It also uses semaphore/mutex to access shared resources such as Communication Device Class (CDC) FIFO. Therefore the stack needs to use some of the OS's basic APIs. Following OSes are already supported out of the box.
94
123
@@ -98,7 +127,7 @@ TinyUSB is completely thread-safe by pushing all Interrupt Service Request (ISR)
98
127
- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its `own repo <https://github.com/hathach/mynewt-tinyusb-example>`_
Copy file name to clipboardExpand all lines: docs/faq.rst
+1-31Lines changed: 1 addition & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ General Questions
7
7
8
8
**Q: What microcontrollers does TinyUSB support?**
9
9
10
-
TinyUSB supports 30+ MCU families including STM32, RP2040, NXP (iMXRT, Kinetis, LPC), Microchip SAM, Nordic nRF5x, ESP32, and many others. See :doc:`reference/boards` for the complete list.
10
+
TinyUSB supports 50+ MCU families including STM32, RP2040, NXP (iMXRT, Kinetis, LPC), Microchip SAM, Nordic nRF5x, ESP32, and many others. See :doc:`reference/boards` for the complete list.
11
11
12
12
**Q: Can I use TinyUSB in commercial projects?**
13
13
@@ -178,33 +178,3 @@ ESP32-S3 has specific USB implementation challenges:
178
178
- Check power supply requirements for host mode
179
179
- Some features may be limited compared to other MCUs
180
180
- Use ESP32-S3 specific examples and documentation
181
-
182
-
STM32CubeIDE Integration
183
-
========================
184
-
185
-
**Q: How do I integrate TinyUSB with STM32CubeIDE?**
186
-
187
-
1. In STM32CubeMX, enable USB_OTG_FS/HS under Connectivity, set to "Device_Only" mode
188
-
2. Enable the USB global interrupt in NVIC Settings
189
-
3. Add ``tusb.h`` include and call ``tusb_init()`` in main.c
190
-
4. Call ``tud_task()`` in your main loop
191
-
5. In the generated ``stm32xxx_it.c``, modify the USB IRQ handler to call ``tud_int_handler(0)``
192
-
6. Create ``tusb_config.h`` and ``usb_descriptors.c`` files
193
-
194
-
**Q: STM32CubeIDE generated code conflicts with TinyUSB**
195
-
196
-
Don't use STM32's built-in USB middleware (USB Device Library) when using TinyUSB. Disable USB code generation in STM32CubeMX and let TinyUSB handle all USB functionality.
197
-
198
-
**Q: STM32 USB interrupt handler setup**
199
-
200
-
Replace the generated USB interrupt handler with a call to TinyUSB:
201
-
202
-
.. code-block:: c
203
-
204
-
void OTG_FS_IRQHandler(void) {
205
-
tud_int_handler(0);
206
-
}
207
-
208
-
**Q: Which STM32 families work best with TinyUSB?**
209
-
210
-
STM32F4, F7, and H7 families have the most mature TinyUSB support. STM32F0, F1, F3, L4 families are also supported but may have more limitations. Check the supported boards list for your specific variant.
0 commit comments