CMSIS-Driver Validation  
Driver Validation
 
Loading...
Searching...
No Matches
SPI Server

The SPI Server application provides features used by the CMSIS-Driver Validation suite to test physical operation of the SPI 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 SPI driver.

Note
STM32F429I-DISC1 was selected because its SPI driver is stable and supports all required features.
For running on STM32F429I-DISC1 board, see Running on STM32F429I-DISC1 board.
For running on other hardware, see Running on specific hardware.

Features

Operation

The Server waits for a command from the SPI Client (Driver Validation), executes it, and then waits for the next one. Most commands have no additional data phase, though some do. The Server operates as an SPI Slave except when a Master transfer is explicitly requested; after completing it, the Server returns to Slave mode.

Configuration

Communication settings are defined in SPI_Server_Config.h file.

SPI_Server_Config.h configuration file in Configuration Wizard view mode

Configuration settings

Note
The SPI Server receives commands as an SPI Slave using the Slave Select line. The Server's SPI driver must support hardware-monitored Slave Select functionality.

Commands

Commands are human-readable (ASCII) for simpler analysis with an SPI bus analyzer.

Note
For detailed command descriptions, see README.md in project root.

Example capture (Master transfer validation):

Running on STM32F429I-DISC1 board

Using the Arm CMSIS Solution VS Code extension, create a new solution from example:

  1. In the CMSIS extension, click Create a New Solution.
  2. Select an STM32F429I-DISC1 board as a Target Board.
  3. Under Templates, Reference Applications, and Examples, select SPI Server (CMSIS-Driver Validation SPI Server application for STM32F429I-DISC1 board).
  4. Choose Solution Base Folder and click Create.
  5. Build and run the SPI Server application on the STM32F429I-DISC1 board.

SPI1 pinout (STM32F429I-DISC1):

SPI function Pin
SPI Clock PA5
Master Output Slave Input (MOSI) PA7
Master Input Slave Output (MISO) PB4
Slave Select PA15
Note
IMPORTANT: Connect ground between the SPI Server and the Device (Driver) Under Test to ensure a common reference potential.
The STM32F429I-DISC1 SPI Server does not support National Semiconductor Microwire frame format.
The STM32F429I-DISC1 SPI 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:

  1. In the CMSIS extension, click Create a New Solution.
  2. Select the Target Board.
  3. Under Templates, Reference Applications, and Examples, select SPI Server (CMSIS-Driver Validation SPI Server application).
  4. Choose Solution Base Folder, click Create.
  5. Select the board layer that provides an SPI Driver, click OK.
  6. If SPI is not routed to ARDUINO (or a different SPI peripheral is required), open SPI_Server_Config.h, Open Preview and edit Driver_SPI# to the required instance.
  7. Build and run the SPI Server application on your hardware.
Note
IMPORTANT: The target board's SPI CMSIS-Driver must be fully CMSIS compliant!
The SPI Server for build-type: Debug displays command execution on an STDOUT channel (typically Virtual COM Port via Debug adapter).

Troubleshooting

  1. Server not responding
    • Reset the Server.
    • Verify the correct driver instance in SPI_Server_Config.h.
    • Reduce bus speed used for communication with the Server (in DV_SPI_Config.h).
  2. Debug message "Server Start failed!" (build-type: Debug)
    • Check heap (must be > 2 * SPI_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 SPI driver supports all fixed settings (Slave with hardware-monitored Slave Select, CPOL=0/CPHA=0, 8 bits, MSB to LSB).
  3. Tests report data mismatch
    • Ensure Slave Select line has a pull-up to Vcc (3.3 V).
    • Keep wires short and separate; pair SCK and GND if possible.
    • Ensure the SPI driver does not drive Slave Select line while inactive.