The USART Server is an application used by the CMSIS-Driver Validation suite to test the physical operation of the USART driver.
It is available for the STMicroelectronics STM32F429I-DISC1 board and as a template for any board with available Board Layer and configured CMSIS compliant USART driver.
- Note
- STM32F429I-DISC1 was selected because its USART driver is stable and supports all required features.
-
For running on the STM32F429I-DISC1 board, see Running on STM32F429I-DISC1 board.
-
For running on other hardware, see Running on specific hardware.
Features
- Read version information
- Read capabilities information
- Set and read data buffer contents
- Read last send/receive/transfer counts
- Send, receive, and transfer (synchronous mode) operations
- Generate break signal and read break status
- Control and read modem lines
Operation
The Server waits for a command from the USART Client (Driver Validation), executes it, and then waits for the next command. Some commands include additional input/output data phases.
Configuration
Communication settings are defined in USART_Server_Config.h file.
USART_Server_Config.h configuration file in Configuration Wizard view mode
Configuration settings
- Driver_USART# - selects the USART driver instance used by the Server.
- Communication settings:
- Mode - defines the mode used for command exchange (must match DUT setup).
- Fixed parameters used for command exchange:
- Baudrate: 115200
- Data Bits: 8
- Parity: None
- Stop Bits: 1
- Flow Control: None
Commands
Commands are human-readable (ASCII) for easier analysis with a USART bus analyzer.
- GET VER - get Server version
- GET CAP - get Server capabilities (auto-detected upon reception)
- SET BUF - initialize Rx/Tx buffer content
- GET BUF - retrieve Rx/Tx buffer content
- SET COM - specify transfer configuration for the next XFER
- XFER - trigger a transfer
- GET CNT - retrieve number of items transferred in the last transfer
- SET BRK - generate break signal
- GET BRK - read break signal status
- SET MDM - activate modem lines
- GET MDM - read modem line status
- Note
- For detailed command descriptions, see README.md in project root.
Example capture: validating the Send function in Asynchronous mode:
Running on STM32F429I-DISC1 board
Using the Arm CMSIS Solution VS Code extension, create a new solution from example:
- In the CMSIS extension, click Create a New Solution.
- Select an STM32F429I-DISC1 board as a Target Board.
- Under Templates, Reference Applications, and Examples, select USART Server (CMSIS-Driver Validation USART Server application for STM32F429I-DISC1 board).
- Choose Solution Base Folder and click Create.
- Build and run the USART Server application on the STM32F429I-DISC1 board.
USART1 pinout (STM32F429I-DISC1):
| USART function | Pin |
| Tx | PA9 |
| Rx | PA10 |
| CLK (sync) | PA8 |
| CTS | PA11 |
| RTS | PA12 |
| DCD test pin | PA13 |
| RI test pin | PA14 |
- Note
- IMPORTANT: Connect ground between the USART Server and the Device (Driver) Under Test to ensure a common reference potential.
-
For synchronous testing, this hardware supports only synchronous Master mode, therefore it can only be used to test synchronous Slave mode of the Driver Under Test.
-
The STM32F429I-DISC1 USART Server for build-type: Debug displays command execution on an on-board LCD.
Running on specific hardware
Using the Arm CMSIS Solution VS Code extension, create a new solution from template:
- In the CMSIS extension, click Create a New Solution.
- Select the Target Board.
- Under Templates, Reference Applications, and Examples, select USART Server (CMSIS-Driver Validation USART Server application).
- Choose Solution Base Folder, click Create.
- Select the board layer that provides an USART Driver, click OK.
- If the board's USART is not routed to ARDUINO (or a different peripheral is required) , open USART_Server_Config.h, Open Preview and edit Driver_USART# to the required instance.
- Build and run the USART Server application on your hardware.
- Note
- IMPORTANT: The target board's USART CMSIS-Driver must be fully CMSIS compliant!
-
The USART Server for build-type: Debug displays command execution on an STDOUT channel (typically Virtual COM Port via Debug adapter).
Troubleshooting
- Server not responding
- Reset the Server.
- Verify the correct driver instance in
USART_Server_Config.h.
- Ensure communication settings (mode) match between Server and Driver Validation; if changed, rebuild and reflash.
- Debug message "Server Start failed!" (build-type: Debug)
- Check heap (must be >
2 * USART_SERVER_BUF_SIZE).
- Verify RTOS allows >= 512 bytes allocation for the Server main thread (e.g., Global Dynamic Memory size in
RTX_Config.h if RTX5).
- Ensure the Server's USART driver supports all fixed settings:
- Baudrate 115200, 8-N-1, Flow Control None.