HAL UART loopback
This example demonstrates the usage of the UART HAL APIs for communication in a loopback configuration. The application performs the following operations:
Configures two UART instances - one for transmission and one for reception
Demonstrates how to transmit data using polling mode
Demonstrates how to receive data using interrupt mode
Verifies the received data matches the transmitted data
The example implements a simple “Hello World!” string transmission and reception to validate the UART functionality.
Example Usage
Build and Load the example to your device
The example initializes both UART instances at 9600 bps
It transmits “Hello World !” using polling mode from the TX instance
It receives the string using interrupt mode on the RX instance
The application verifies the received data matches the transmitted data
If successful, “All Test Passed.” will be displayed on the console
Key features demonstrated:
UART HAL initialization and configuration
Polling-based transmission
Interrupt-based reception
Proper callback handling for interrupt operations
Error detection and status checking
External Connections
Currently the example uses SPGSS Level Internal loopback between unicomms
UC2 is configured as the Receiver
UC1 is configured as the Transmitter
SPG0 provides the loopback connection between these instances