Main Content

Model Configuration Parameters for STM32 Processor Based Boards

Hardware Implementation Pane Overview

Default Hardware Implementation Pane

Configure hardware board to run Simulink® models.

  1. In the Simulink Editor, select Simulation > Model Configuration Parameters.

  2. In the Configuration Parameter dialog box, click Hardware Implementation.

  3. Set the Hardware board parameter to STM32xxxx Based.

  4. The parameter values under Hardware board settings are automatically populated to their default values.

    You can optionally adjust these parameters for your particular use case.

  5. To apply the changes, click Apply.

For more information on selecting a hardware support package and general configuration settings, see Hardware Implementation Pane.

Build Options

ParameterDescriptionDefault Value

Build action

Defines how Embedded Coder® responds when you build your model.

Build, load, and run

Runtime library

Select the runtime library.

Reduced C

Disable parallel build

Select to compile the generated code and driver source codes in parallel order for faster build and deployment speed.

off

Browse

Browse to select the STM32CubeMX project file.

 

Create

Create a STM32CubeMX project for a STM32F4xx Based hardware board.

 

Launch

Click to launch STM32CubeMX tool.

 

STM32CubeMX project file

Displays the STM32CubeMX project file.

 

Device id

Displays the device id.

 

Device family

Displays the device family.

 

Connectivity mode

Select the connectivity mode

ST link

Connection port

Select the connection port

SWD

Mode

Select the custom board mode

Normal

Reset mode

Select the reset modeSoftware reset

Auto detect board to download and run

Select this parameter to auto detect the board to download and run.

on

Device list

If Auto detect board to download and run parameter is not selected, you can select the hardware boards from the Device list or click Scan to detect hardware boards connected over st-link. You can also choose the custom boards from the device list.

 

Scan

Click Scan to detect all the hardware boards connected over st-link.

 

Clocking

ParameterDescriptionDefault Value

Clocking

The CPU clock frequency in MHz.

216

Connectivity

ParameterDescriptionDefault Value

USART/UART

Select the USART/UART for communication.

USART3

Serial port

Sets the serial port on the hardware board.

COM1

CAN

ParameterDescriptionDefault Value

Module

Select the CAN module.

CAN1

Baudrate (bits/sec)

Baudrate for CAN bus calculated based on data parameters.

1000000

Configure receive interrupt

Select this parameter to configure the receive interrupt and its parameters.

off

Configure FIFO# interruptSelect this parameter to configure FIFO interrupt parameters.

off

Enable FIFO# message pending interruptSelect this parameter to enable the FIFO# message pending interrupt.

off

Enable FIFO# full interruptSelect this parameter to enable the FIFO# full interrupt.

off

Enable FIFO# overrun interruptSelect this parameter to enable the FIFO# overrun interrupt.

off

Configure transmit interruptSelect this parameter to configure transmit interrupt parameters.

off

Enable mailbox empty interruptSelect this parameter to enable the mailbox empty interrupt.

off

Configure other interruptSelect this parameter to configure other interrupt parameters such as error warning interrupt, error passive interrupt, bus-off interrupt, last error code, wakeup and sleep acknowledge interrupts.

off

Enable error warning interruptSelect this parameter to enable the error warning interrupt.

off

Enable error passive interruptSelect this parameter to enable the error passive interrupt.

off

Enable bus-off interruptSelect this parameter to enable the bus-off interrupt.

off

Enable last error code interruptSelect this parameter to enable the last error code interrupt.

off

Enable wakeup interruptSelect this parameter to enable the wakeup interrupt.

off

Enable sleep acknowledge interruptSelect this parameter to enable the sleep acknowledge interrupt.

off

Accept all messages (in FIFO 0)

Enable this parameter to allow all CAN messages in FIFO 0. If it is disabled, then you can select and allow only the required CAN messages.

on

Filter bank numberSelect the filter bank number.

0

Enable filter bank #Select to enable the filter bank.

off

Filter bank # scaleSelect the filter bank scale.

Single 32-bit

Filter bank # modeSelect the filter bank mode

Identifier mask

Filter bank # FIFO assignmentSelect the filter bank FIFO assignment.

FIFO0

Filter bank # Id typeSelect the filter bank Id type.

Standard 11-bit

Id #Specify the Identifier list value.

0

Mask #Specify the Identifier mask value.

0

Display enabled filter banks configuration in command windowClick to display all the enabled filter banks configuration in MATLAB command window. 
Disable all filter banksClick to disable all the filter banks configuration. 

FDCAN

ParameterDescriptionDefault Value

Configure Module

Select the FDCAN module.

FDCAN1

Nominal Baudrate (bits/sec)

Nominal Baudrate for FD CAN bus calculated based on data parameters.

1000000

Data Baudrate (bits/sec)

Data Baudrate for FD CAN bus calculated based on data parameters.

1000000

Enable edge filtering for synchronization

Select this parameter to enable the edge filtering for synchronization.

off

After Rx FIFO # is full the next message accepted for the FIFO overwrites the oldest FIFO messageSelect this parameter to receive message after Rx FIFO # is full the next message accepted for the FIFO overwrites the oldest FIFO message.

off

Configure receive interrupt sourcesSelect this parameter to configure the receive interrupt sources and its parameters.

off

Configure Rx buffer interrupt sourcesSelect this parameter to configure the Rx buffer interrupt sources and its parameters.

off

Dedicated RX buffer messageSelect the dedicated RX buffer message. Message stored to dedicated Rx buffer interrupt line.

Disable

Configure RX FIFO# interrupt sourcesSelect this parameter to configure RX FIFO # interrupt sources and its parameters.

off

RX FIFO# new messageSelect the RX FIFO# new message interrupt line.

Disable

RX FIFO# fullSelect the RX FIFO# full interrupt line.

Disable

RX FIFO# message lostSelect the RX FIFO# message lost interrupt line.

Disable

RX FIFO# watermarkSelect the RX FIFO# watermark interrupt line.

Disable

High priority messageSelect the receive interrupt high priority message interrupt line.

Disable

Configure transmit interrupt sourcesSelect this parameter to configure the transmit interrupt sources and its parameters.

off

Configure TX FIFO# interrupt sourcesSelect this parameter to configure TX FIFO # interrupt sources and its parameters.

off

TX complete

Select the TX complete interrupt line.

Disable

TX cancellation finishSelect the TX cancellation finish interrupt line.

Disable

TX emptySelect the TX empty interrupt line.

Disable

Configure TX event FIFO# interrupt sourcesSelect this parameter to configure TX event FIFO # interrupt sources and its parameters.

off

TX event FIFO# new entrySelect the TX event FIFO# new entry interrupt line.

Disable

TX event FIFO# fullSelect the TX event FIFO# full interrupt line.

Disable

TX event FIFO# element lostSelect the TX event FIFO# element lost interrupt line.

Disable

TX event FIFO# watermarkSelect the TX event FIFO# watermark interrupt line.

Disable

Configure other interruptSelect this parameter to configure other interrupt parameters such as timestamp wraparound, message RAM access failure, timeout occurred, error logging overflow, warning status, error passive status, bus-off status, watchdog event, arbitration protocol error, data protocol error, reserved address access.

off

Timestamp wraparoundSelect the timestamp wraparound interrupt line.

Disable

Message RAM access failureSelect the message RAM access failure interrupt line.

Disable

Timeout occurredSelect the timeout occurred interrupt line.

Disable

Error logging overflowSelect the error logging interrupt line.

Disable

Error passive statusSelect the error passive status interrupt line.

Disable

Warning statusSelect the warning status interrupt line.

Disable

Bus off statusSelect the bus off status interrupt line.

Disable

Watchdog eventSelect the watchdog event interrupt line.

Disable

Arbitration protocol errorSelect the arbitration protocol error interrupt line.

Disable

Data protocol errorSelect the data protocol error interrupt line.

Disable

Reserved address accessSelect the reserved address access interrupt line.

Disable

Configure global filterSelect this parameter to configure global filter and its parameters.

off

Reject remote frames standardSelect this parameter to reject the remote standard frames.

on

Reject remote frames extendedSelect this parameter to reject the remote extended frames.

on

Non matching frames standardSelect the non matching frames standard.

Reject

Non matching frames extendedSelect the non matching frames extended.

Reject

Configure standard filtersSelect this parameter to configure the standard filters and its parameters.

off

Select standard filterSelect the standard filter.

0

Filter # configurationSelect the standard filter configuration.

Disable filter element

Filter # type (filter type will be ignored if filter configuration is store into RX buffer)Select the standard filter type.

Classic ID and mask filter (ID1-filter, ID2=mask)

Filter # ID1Specify the standard filter# ID1.

0

Filter # ID2(provide buffer number if filter configuration is store into RX buffer)Specify the standard filter# ID2 buffer number if filter configuration is store into RX buffer.

0

Configure extended filtersSelect this parameter to configure the extended filters and its parameters.

off

Select extended filterSelect the extended filter.

0

Display configured standard and extended filter elements in command windowDisplays all the configured standard and extended filter configurations in MATLAB command window. 
Reset standard filter configurationClick to reset all the standard filter configuration. 
Reset extended filter configurationClick to reset all the extended filter configuration. 

UART/USART

ParameterDescriptionDefault Value

Configure UART/USART#

Select the USART/UART module to configure.

USART1

Transmit mode

Select the transmit mode to configure USART/UART module.

Buffered mode using TXE interrupt

Receive mode

Select the receive mode to configure USART/UART module.

Buffered mode using RXNE interrupt

Transfer buffer length

Specify the transfer buffer length.

128

Receive buffer length

Specify the receive buffer length.

128

Stop receiving data on error until erroneous data is read

Select to stop receiving data on error until erroneous data is read.

off

Ethernet

ParameterDescriptionDefault Value

Enable DHCP for local IP address assignment

Configures the board to get an IP address from the local DHCP server on the network.

off

Ethernet host name

Defines the local host name.

STM32xx

Note

This parameter is available only when DHCP settings are disabled in STM32CubeMX project.

Board IP address

Sets the IP address of the board.

192.168.1.10

Note

This parameter is available only when DHCP settings are disabled in STM32CubeMX project.

Subnet mask

Sets the subnet mask for the board.

255.255.255.0

Note

This parameter is available only when DHCP settings are disabled in STM32CubeMX project.

Gateway

Sets the gateway required to access the target computer.

192.168.1.1

Note

This parameter is available only when DHCP settings are disabled in STM32CubeMX project.

MAC address

Defines the physical network address of the board.

00:80:E1:00:00:00

ADC#

ParameterDescriptionDefault Value

DMA transfer complete interrupt is enabled

DMA transfer complete interrupt is enabled by default.

off

Watchdog interrupt is enabled

Watchdog interrupt is enabled by default

off

Enable Regular EoCS interrupt

Select Enable regular EoCS interrupt to trigger an ISR from a ADC.

off

Enable Injected EoCS interrupt

Select Enable injected EoCS interrupt to trigger an ISR from a ADC.

off
Enable Overrun interrupt

Select Enable Overrun interrupt to trigger an notification when overrun occurs.

off
Run ADC calibration during model initialization

Select Run ADC calibration during model initialization to perform ADC calibration during model initialization to remove any bias.

on
Calibration method

Select the ADC Calibration method. You can launch automatic calibration or specify calibration registers manually.

Launch automatic calibration
Calibration mode

Select the ADC Calibration mode.

Offset
Linear calibration factor word#

Specify the leaner calibration factor word.

0
ADC conversion mode

Select the ADC conversion mode for which you want to lauch the calibration. ADC conversion can be single ended or differential or both.

Single ended
Single ended mode offset calibration factor

Specify the ADC single ended offset calibration factor.

0
Differential ended mode offset calibration factor

Specify the ADC differential ended offset calibration factor.

0

Refresh

Click Refresh to update configuration parameters according to changes in selected STM32CubeMX project.

 

HRTIM

ParameterDescriptionDefault Value

Suspend update events during preload write timers select

Enable to configure the timers to suspend update events during preload write timers.

off

Synchronized counter start timers select

Enable to configure the timers to synchronize counter start timers.

off

Enable interrupts select

Select the timers to enable interrupts.

TimerA

Enable delayed protection trigger interrupt

Select this parameter to enable delayed protection trigger interrupt for the selected higher resolution timer module.

off

Enable counter reset/roll-over event interrupt

Select this parameter to enable counter reset/roll-over event interrupt for the selected higher resolution timer module.

off
Enable channel# reset interrupt

Select this parameter to enable channel reset interrupt for the selected higher resolution timer module.

off
Enable channel# set interrupt

Select this parameter to enable channel set interrupt for the selected higher resolution timer module.

off
Enable capture# event interrupt

Select this parameter to enable capture event interrupt for the selected higher resolution timer module.

off
Enable update interrupt

Select this parameter to enable update interrupt for the selected higher resolution timer module.

off
Enable repetition event interrupt

Select this parameter to enable repetition event interrupt for the selected higher resolution timer module.

off
Enable compare# event interrupt

Select this parameter to enable compare event interrupt for the selected higher resolution timer module.

off
Enable register update event

Select this parameter to enable register update event for the selected higher resolution timer module.

off
Enable synchronization update event

Select this parameter to enable synchronization update event for the selected higher resolution timer module.

off
Enable DLL calibration done interrupt

Select this parameter to enable DLL calibration done interrupt for the selected higher resolution timer module.

off
Enable burst period completed interrupt

Select this parameter to enable burst period completed interrupt for the selected higher resolution timer module.

off
Enable system fault interrupt

Select this parameter to enable system fault interrupt for the selected higher resolution timer module.

off
Enable fault# interrupt

Select this parameter to enable fault interrupt for the selected higher resolution timer module.

off

SPI

ParameterDescriptionDefault Value

Module

Enable to configure the timers to suspend update events during preload write timers.

SPI1
Enable TX interrupt

Select this parameter to enable SPI transmit interrupt.

off
Enable RX interrupt

Select this parameter to enable SPI receive interrupt.

off
Enable error interrupt

Select this parameter to enable SPI error interrupt.

off

Enable TxFIFO ready interrupt

Select this parameter to enable SPI transmit FIFO ready interrupt.

off

Enable RxFIFO ready interrupt

Select this parameter to enable SPI receive FIFO ready interrupt.

off

Enable TxFIFO or RxFIFO ready interrupt

Select this parameter to enable SPI transmit or receive FIFO ready interrupt.

off

Enable Tx failed interrupt

Select this parameter to enable the SPI transmit failed interrupt.

off
Enable underrun interrupt

Select this parameter to enable the SPI underrun interrupt.

off
Enable overrun interrupt

Select this parameter to enable the SPI overrun interrupt.

off
Enable CRC error interrupt

Select this parameter to enable the SPI CRC error interrupt.

off
Enable TI frame interrupt

Select this parameter to enable the SPI TI frame interrupt.

off
Enable mode fault interrupt

Select this parameter to enable the SPI mode fault interrupt.

off
Enable end transfer interrupt

Select this parameter to enable the SPI end transfer interrupt.

off
Enable master mode interrupt

Select this parameter to enable the SPI controller mode interrupt.

off
Enable TxFIFO empty interrupt

Select this parameter to enable the SPI transmit FIFO empty interrupt.

off
Enable TSER interrupt

Select this parameter to enable the SPI TSER interrupt.

off

Timers

ParameterDescriptionDefault Value

Timer group

Select the timer group.

Advanced Timers 1/8/20
Show TIM# configurations

Select the timer module for configurations.

off
Start timer during model initialization

Select this parameter to start the counter during model initialization.

on

Enable Trigger Interrupt

Select to enable trigger interrupt.

off

Enable Capture Compare # Interrupt

Select to enable capture compare interrupt.

off

Enable Update Interrupt

Select to enable update interrupt.

off

Enable Break Interrupt

Select to enable break interrupt.

off
Enable Commutation Interrupt

Select to enable commutation interrupt.

off
Enable Index Interrupt

Select to enable index interrupt.

off
Enable Direction Interrupt

Select to enable direction interrupt.

off
Enable Transition Error InterruptSelect to enable transition error interrupt.off
Enable Index Error InterruptSelect to enable index error interrupt.off

External Mode

ParameterDescriptionDefault Value

Communication interface

Sets the transport layer used to exchange data between host and hardware.

Serial

Logging buffer size (in bytes)

Specify the logging buffer size.

1024

Use a dedicated timer to improve time stamp accuracy

Enable the parameter to use a dedicated timer to improve the time stamp accuracy.

on

Verbose

Sets to view external mode execution progress and updates.

on

PIL

ParameterDescriptionDefault Value

PIL communication interface

Select the interface used for PIL communication.

Serial

CORDIC

ParameterDescriptionDefault Value

Input buffer length(In bytes)

Specify the input buffer length in bytes.

40

Output buffer length(In bytes)

Specify the output buffer length in bytes.

40

MQTT

ParameterDescriptionDefault Value
Broker IP AddressMQTT broker web address<Enter Broker I.P. Address>
PortTCP/IP port to use for the MQTT connection.

1883

Client usernameUser name for MQTT broker to authenticate the client.<null>
Client passwordPassword for MQTT broker to authenticate the client.<null>
Client IDA unique identifier for the client that is connected to the MQTT broker. <null>

I2S

ParameterDescriptionDefault Value
Use PDM filter from STM32CubeMX

Enable this parameter to utilize the PDM filter configuration from the STM32CubeMX.

off
Configure PDM2PCM channel(s) for I2S#

Select the I2S channel to configure PDM2PCM.

off
PDM2PCM channel for stream 1/2

Specify the I2S PDM2PCM channel configured in the STM32CubeMX project.

1