USART AddToTransmitBuffer Block Description
This block is used to append data to the USART/UART transmit buffer in STM microcontrollers. To actually transmit the data accumulated in the buffer, you must use the USART Transmit block. There is an option to select between UART, USART, or LPUART interfaces.
Splitting this functionality into two separate blocks – one for adding data to the buffer and another for transmitting it – stems from how DMA transmission operates in non-blocking mode. In this mode, sending data can take longer than a single execution period of the function loop. Attempting to restart a transmission before the previous one completes would yield an error indicating that the DMA controller is busy. Utilizing two blocks allows you to first gather all required data into the buffer and then transmit it in a single operation.

Table of Contents
Inputs
| Input Name | Type | Description |
|---|---|---|
| Input length | uint32 | Optional input The amount of data to be transmitted. This input is optional and depends on the Enable input length parameter. |
| Data | auto | The actual data to be transmitted. |
Outputs
| Output Name | Type | Description |
|---|---|---|
| Status | uint8 | Transmission status. Returns:1 transmission successful0 transmission failed |
Block Parameters
| Parameter | Description |
|---|---|
| USART/UART module number | Number of the USART/UART module. |
| Type | Peripheral interface type:UART/USART - UART or USART interfaceLPUART - LPUART interface |
| Number of transmissions | Number of times the data transmission is repeated. |
| Enable input length | Enables the Input length port. |
| Conditional Parameter Input length | Fixed length of data to transmit in bytes. This parameter is only accessible when the Enable input length option is disabled. |
| Enable Header | Enables adding a fixed header to the data frame. |
| Hex header format | Determines how the header is interpreted. When enabled, the header is treated as a sequence of hexadecimal (hex) values; when disabled, it is treated as an ASCII character string. |
| Header | Allows setting a fixed header for the data frame. It should be enclosed between [' and ']. |
| Enable Terminator | Enables adding a fixed terminator to the data frame. |
| Hex terminator format | Determines how the terminator is interpreted. When enabled, the terminator is treated as a sequence of hexadecimal (hex) values; when disabled, it is treated as an ASCII character string. |
| Terminator | The terminator string used to filter received data frames. It should be enclosed between [' and ']. |
| Timeout [ms] | The time limit the system waits for the block execution to complete. |

CubeMX Configuration for a Given MCU Model
The interface configuration instructions are located on the subpage CubeMX Configuration for a Given MCU Model.