USB CDC Add To Tx Block Description
This block enables adding data to the USB transmission buffer in CDC (Communication Device Class) mode within STM microcontrollers.

Table of Contents
- Inputs
- Outputs
- Block Parameters
- CubeMX Configuration for a Given MCU Model
- Comments and Troubleshooting
- See Also
Inputs
| Input Name | Type | Description |
|---|---|---|
| Input length | uint32 | Optional input The length of the data payload to be sent. The visibility of this port depends on the Enable input length parameter. |
| Data | auto | The data payload to be transmitted. |
Outputs
| Output Name | Type | Description |
|---|---|---|
| Status | uint8 | The operational status of the process for adding data to the transmit buffer. Returns:1 – process completed successfully0 – process failed |
Block Parameters
| Parameter | Description |
|---|---|
| USB type | The target USB peripheral module type:USB_FS – Full SpeedUSB_HS – High Speed |
| Transmit mode | The data transmission format. The Binary_vector mode is selected by default. |
| Frame repeat | The number of iterations to resend the exact same frame. This setting allows automatic frame repetition for a specified count without re-triggering the block execution. |
| Input data type | The data type assigned to the input port. The auto mode is selected by default. |
| Enable input length | Controls the conditional visibility of the Input length input port. |
| Enable Header/Terminator | Enables or disables the utilization of data packet framing headers and terminators. |
| Hex header/terminator format | Conditional Parameter Specifies whether the header/terminator values are interpreted in hexadecimal format. This field is accessible only when the Enable Header/Terminator option is enabled. |
| Header | Conditional Parameter The header sequence prepended to the transmitted data. This field is accessible only when the Enable Header/Terminator option is enabled. When Hex header/terminator format is activated, the entered string will be interpreted as raw hexadecimal bytes. |
| Header length | Conditional Parameter The total length of the custom header payload. This field is accessible only when the Hex header/terminator format option is enabled. |
| Terminator | Conditional Parameter The terminator sequence appended to the transmitted data. This field is accessible only when the Enable Header/Terminator option is enabled. When Hex header/terminator format is activated, the entered string will be interpreted as raw hexadecimal bytes. |
| Terminator length | Conditional Parameter The total length of the custom terminator payload. This field is accessible only when the Hex header/terminator format option is enabled. |
| Timeout [ms] | The maximum duration the peripheral driver waits for the transmission buffer to clear before aborting the buffer write operation. |

CubeMX Configuration for a Given MCU Model
The required hardware peripheral setup is detailed in the dedicated CubeMX Configuration for a Given MCU Model subpage.
See Also
Last updated on