CMSIS-Driver Validation  
Driver Validation
 All Files Functions Variables Macros Groups Pages
USART Server

The USART Server is an application providing a set of features used by the CMSIS-Driver Validation suite to test the physical operation of the USART driver.
It is located in the <pack root directory>\Tools\USART_Server directory.

The USART Server offers the following features:

Operation

The USART Server is continuously waiting on a command from the USART Client (Driver Validation), after the command is received it is executed, and the process repeats.
Most commands do not have any additional related data phase, but some do have additional input or output data exchange phase following the command.

Configuration

Communication interface settings used during command exchange are set in the USART_Server_Config.h configuration file.

usart_server_config_h.png
USART_Server_Config.h configuration file in Configuration Wizard view mode

Configuration settings

Driver_USART# selects the driver instance used by the USART Server.
Communication settings specify the communication parameters for command exchange with the USART Client:

Fixed communication settings used for command exchange with the USART Client are:

Commands

Commands are encoded in human readable format (ASCII strings) so they can be viewed by the USART bus analyzer and analyzed more easily.

Supported commands:

Note
For details about commands please refer to Abstract.txt file in the <pack root directory>\Tools\USART_Server\Board\MCBSTM32F400 directory.

Picture below shows a capture of USART Driver Validation validating functionality of the Send function in the Asynchronous mode

usart_bus_async_send.png

Porting USART Server to other targets

To create USART Server application for a different target device, follow the steps below:

  1. Create a new project in µVision for your target device
  2. In the RTE window enable and configure the following software components:
    • CMSIS: CORE
    • CMSIS: RTOS2 (API): Keil RTX5 any variant
    • CMSIS Driver: USART (API)
    • CMSIS Driver: VIO (API) select Virtual implementation if implementation for your target system is not available
    • Generic device specific components (startup, clock system, I/O, ...) as required (please consult device's documentation for more information)
    • Resolve any unresolved dependencies between components
  3. Copy the USART_Server.c file from the <pack root directory>\Tools\USART_Server\Source directory to the project root and add it to µVision project
  4. Copy the USART_Server.h file from the <pack root directory>\Tools\USART_Server\Include directory to the project root
  5. Copy the files specified below from the directory <pack root directory>\Tools\USART_Server\Config to the project root:
    • USART_Server_Config.h: also adapt this file as required by your device
    • USART_Server_HW.c: add this file to the µVision project also adapt it for your device's specific handling of the GPIO lines for testing of the DCD and RI lines
  6. Add root of the project to include path (Options for Target -> C/C++ -> Include Paths: .\)
  7. Add the main.c file from a template (Right-click Source Group 1... and select Add New Item to Group, select User Code Template and choose the CMSIS-RTOS2 'main' function file from CMSIS: RTOS2:Keil RTX5) and update with code snippet below (replace app_main function):
    #include "USART_Server.h"
    /*----------------------------------------------------------------------------
    * Application main thread
    *---------------------------------------------------------------------------*/
    __NO_RETURN static void app_main (void *argument) {
    (void)argument;
    USART_Server_Start();
    for (;;) {}
    }
  8. Build and download the ported USART Server application to the target device

Troubleshooting

Problems and solutions:

  1. USART Server is not responding to commands
    • reset the USART Server
    • check that correct driver instance is selected in the USART_Server_Config.h file
    • check that communication settings (mode) between USART Server and USART Driver Validation are the same,
      if they are not, correct them, rebuild the application and download to the hardware
  2. USART Server is not responding to commands it reports "Server Start failed!" message if debug variant is used
    • check heap settings (it has to be larger than 2 * USART_SERVER_BUF_SIZE specified in the USART_Server_Config.h file)
    • check that RTOS allows allocation of at least 512 bytes for the USART Server main thread (Global Dynamic Memory size [bytes] setting in RTX_Config.h file if RTX5 is used)
    • check that USART driver used for USART Server supports selected mode and all fixed settings:
      • Baudrate: 115200
      • Data Bits: 8
      • Parity: None
      • Stop Bits: 1
      • Flow Control: None

USART Server on the Keil MCBSTM32F400

µVision project and source files for the MCBSTM32F400 board are available in the <pack root directory>\Tools\USART_Server\Board\MCBSTM32F400 directory.

On the Keil MCBSTM32F400 the USART1 interface is used, with the following pinout:

USART function Pin
Tx PB6
Rx PB7
CLK (synchro) PA8
CTS PA11
RTS PA12
DCD test pin PA9
RI test pin PA10
Note
IMPORTANT: Ground must be connected between USART Server and Device (Driver) Under Test so that USART signals have same ground potential.

For more information please consult Abstract.txt file in the project root.

Note
For synchronous mode testing this device's hardware supports only synchronous Master mode, so it can only be used for testing synchronous Slave mode of the Driver Under Test.

USART Server on the STMicroelectronics STM32F429I-DISC1 (32F429IDISCOVERY) board

µVision project and source files for the STM32F429I-DISC1 board are available in the <pack root directory>\Tools\USART_Server\Board\STM32F429I-DISC1 directory.

On the STMicroelectronics STM32F429I-DISC1 board the USART1 interface is used, with the following pinout:

USART function Pin
Tx PA9
Rx PA10
CLK (synchro) PA8
CTS PA11
RTS PA12
DCD test pin PA13
RI test pin PA14
Note
IMPORTANT: Ground must be connected between USART Server and Device (Driver) Under Test so that USART signals have same ground potential.

For more information please consult Abstract.txt file in the project root.

Note
For synchronous mode testing this device's hardware supports only synchronous Master mode, so it can only be used for testing synchronous Slave mode of the Driver Under Test.