USART Receive Block Description
This block is used to receive data via the UART, USART, or LPUART interface in STM microcontrollers. It provides the option to filter received data frames by setting a header that is used for searching data frames. Received data packets are available at the block output, excluding headers and/or terminators. To receive and return all incoming data frames along with headers and/or terminators, use the USART ReceiveAll block.

Table of Contents
Inputs
This block has no inputs.
Outputs
| Output Name | Type | Description |
|---|---|---|
| Status | uint8 | Block operating status. Returns:1 operation successful0 operation failed |
| Num rx frames | uint32 | Number of received data frames. |
| Frames length | uint32 | Length of received data frames. |
| Data | Depends on Output data type parameter | Data from received frames. It is returned excluding headers and/or terminators. |
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 |
| Hex 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. |
| Conditional Parameter Length | Header length in Hex format in bytes. This parameter is only accessible when the Hex format option is enabled. |
| Header | The header used to filter received data frames. It should be enclosed between [' and ']. |
| Output data type | Data type of the block output. |
| Fixed data length | Option to set a constant length for the output data. |
| Conditional Parameter Max data length (bytes) | Maximum output data length in bytes. This parameter is only available when the Fixed data length option is disabled. |
| Conditional Parameter Fixed data length (bytes) | Fixed output data length in bytes. This parameter is only available when the Fixed data length option is enabled. |
| Search only last frame | Enables searching only within the last received data frame. |
| Max receive frames | Maximum number of data frames that can be stored in the receive buffer before processing. |
| Enable (Terminator settings) | Enables waiting for a frame terminator. |
| Hex 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. |
| Conditional Parameter Length | Terminator length in Hex format in bytes. This parameter is only available when the Hex format option is enabled. |
| Terminator | The terminator string used to filter received data frames. It should be enclosed between [' and ']. |
| Non blocking mode | Enables the non-blocking operating mode. |
| Conditional Parameter Blocking timeout [ms] | The time limit the system waits for the block execution to complete. This parameter is only available when the Non blocking mode option is disabled. |
| Sample time [s] | Function refresh period. |

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