CubeMX Configuration for a Given MCU Model
H7
General CubeMX Settings
| No. | Name | Path | Setting | Description | Screenshot |
|---|---|---|---|---|---|
| 1 | SPI Mode | Pinout & Configuration > Connectivity > SPI* > Mode | Full-Duplex Master | Setting the SPI peripheral operating mode to Full-Duplex and the role to Master. | ![]() |
| 2 | SPI Clock | Clock Configuration | Value depending on the target SPI bus speed | Setting the clock source for the SPI interface. This value depends on the target SPI bus speed and the system clock configuration. | ![]() |
| 3 | Prescaler (for Baud Rate) | Pinout & Configuration > Connectivity > SPI* > Parameter Settings > Basic Parameters > Prescaler | Value depending on the target SPI bus speed | Setting the prescaler for the SPI bus. This value depends on the target SPI bus speed and the system clock configuration. | ![]() |
| 4 | Data Size | Pinout & Configuration > Connectivity > SPI* > Parameter Settings > Basic Parameters > Data Size | 8 Bits | Setting the size of data transmitted through the SPI interface. | ![]() |
| 5 | Maximum output speed | Pinout & Configuration > Connectivity > SPI* > GPIO Settings > click the specific pin to open its configuration window > Maximum output speed | Very High | Setting the maximum output speed for the GPIO pins responsible for the SCK, MISO, and MOSI lines of the SPI interface. | ![]() |
CS (Chip Select) Pin Settings
The CS (Chip Select) pin can be configured in two ways: as a software-controlled GPIO pin or as a Hardware NSS Signal. The choice depends on the Chip Select parameter in the block configuration.
GPIO Pin as CS
| No. | Name | Path | Setting | Description | Screenshot |
|---|---|---|---|---|---|
| 1 | Hardware NSS Signal | Pinout & Configuration > Connectivity > SPI* > Mode > Hardware NSS Signal | Disable | Disabling the hardware NSS (CS) signal. | ![]() |
| 2 | GPIO Pin for CS | Pinout & Configuration > Pinout view > click the chosen GPIO pin | GPIO_Output | Configuring the GPIO pin as an output for the CS signal. | ![]() |
| 3 | Optional parameter Pin User Label | Pinout & Configuration > Pinout view > right-click the chosen GPIO pin | Value depending on the chosen pin | Setting a custom user label for the GPIO pin used as CS. | ![]() |
| 4 | GPIO Output Level | Pinout & Configuration > System Core > GPIO > click the chosen GPIO pin and navigate to the settings below > GPIO output level | Low | Setting the default logical output level of the GPIO pin used as CS. | ![]() |
| 5 | GPIO mode | Pinout & Configuration > System Core > GPIO > click the chosen GPIO pin and navigate to the settings below > GPIO mode | Output Push Pull | Setting the operating mode of the GPIO pin used as CS. | ![]() |
| 6 | GPIO Pull-up/Pull-down | Pinout & Configuration > System Core > GPIO > click the chosen GPIO pin and navigate to the settings below > GPIO Pull-up/Pull-down | No pull-up and no pull-down | Configuring internal pull-up or pull-down resistors for the GPIO pin used as CS. | ![]() |
| 7 | Maximum output speed | Pinout & Configuration > System Core > GPIO > click the chosen GPIO pin and navigate to the settings below > Maximum output speed | Very High | Setting the maximum output speed for the GPIO pin used as CS. | ![]() |
Hardware NSS as CS
| No. | Name | Path | Setting | Description | Screenshot |
|---|---|---|---|---|---|
| 1 | Hardware NSS Signal | Pinout & Configuration > Connectivity > SPI* > Mode > Hardware NSS Signal | Hardware NSS Output Signal | Enabling the hardware NSS (CS) output signal. | ![]() |
| 2 | Maximum output speed | Pinout & Configuration > Connectivity > SPI* > GPIO Settings > click the NSS pin to open its configuration window > Maximum output speed | Very High | Setting the maximum output speed for the hardware NSS pin used as CS. | ![]() |
Interrupts for the SPI interface are not required.
SPI* - the asterisk (*) symbol represents the number of the SPI module used in the model, e.g., SPI1, SPI2 etc.
Last updated on













