Skip to Content
Block descriptionsUSB CDCUSB CDC Add To Tx

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.



USB CDC Add To Tx block

Table of Contents

Inputs

Input NameTypeDescription
Input lengthuint32Optional input
The length of the data payload to be sent. The visibility of this port depends on the Enable input length parameter.
DataautoThe data payload to be transmitted.

Outputs

Output NameTypeDescription
Statusuint8The operational status of the process for adding data to the transmit buffer. Returns:
1 – process completed successfully
0 – process failed

Block Parameters

ParameterDescription
USB typeThe target USB peripheral module type:
USB_FS – Full Speed
USB_HS – High Speed
Transmit modeThe data transmission format. The Binary_vector mode is selected by default.
Frame repeatThe 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 typeThe data type assigned to the input port. The auto mode is selected by default.
Enable input lengthControls the conditional visibility of the Input length input port.
Enable Header/TerminatorEnables or disables the utilization of data packet framing headers and terminators.
Hex header/terminator formatConditional 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.
HeaderConditional 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 lengthConditional Parameter
The total length of the custom header payload. This field is accessible only when the Hex header/terminator format option is enabled.
TerminatorConditional 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 lengthConditional 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.


Block parameters for USB CDC Add To Tx

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