The core layer of μC/USB-Device needs an RTOS for three purposes:
- Signal the completion of synchronous transfers.
- Manage core events.
- Manage debug events (optional).
Core Events Management
For proper operation, the core layer needs an OS task that will manage the core events. For more information on the purpose of this task or on what a core event is, refer to the Task Model page. The core events must be queued in a data structure and be processed by the core. This allows the core to process the events in a task context instead of in an ISR context, as most of the events will be raised by the device driver’s ISR. The core task also needs to be informed when a new event is queued. describes the core events management within the RTOS port.
Debug Events Management
The core layer of μC/USB-Device offers an optional feature to do tracing and debugging. For more information on this feature, see the Debug and Trace page. This feature requires an OS task. For more information on the purpose of this task or on debug events, refer to the Task Model page. The behavior of this task is similar to the core task described in the Core Events Management section. The difference is that the RTOS port does not need to manage the queue, as it is handled within the core layer. The RTOS port only needs to provide a signal that will inform of a debug event insertion.
Synchronous Transfer Completion Signals
The core layer needs a way to signal the application about the synchronous transfer completion. The core will need one signal per endpoint. The RTOS resources usually used for this signal is a semaphore. describes a synchronous transfer completion notification.