Main Content

Model Configuration Simulink Coder Support Package for STMicroelectronics Nucleo Boards

Hardware Implementation Pane Overview

Configuration parameters

  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 one of the Nucleo boards, for eg.STM32 Nucleo F302R8.

  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. Click Apply to apply the changes.

Note

In the Configuration Parameter dialog box, go to Code Generation > Interface > Code interface and ensure Code interface packaging is set to Nonreusable function.

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

Build options

ParameterDescription

Build action

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

Set host drive

The option to copy the generated output bin file automatically or manually to a drive.

Drive

The drive on which to copy the generated output bin file manually.

Clocking

ParameterDescription

CPU Clock (MHz)

The CPU clock frequency in MHz.

Ethernet

Ethernet

ParameterDescriptionDefault Value

Enable DHCP for local IP address assignment

Select this parameter to configure the board to get an IP address from the local DHCP server on the network.

Selected

Ethernet host name

Provides the name of the hardware board selected.

NUCLEO_xxxx

Board IP Address

Select this parameter to set the IP address of the board.

192.168.1.10

Subnet mask

Specify the subnet mask for the board.

255.255.255.0

Gateway

Set the serial gateway to the gateway required to access the target computer.

192.168.1.1

MAC Address

Specify the media access control (MAC) address, the physical network address of the board.

A8-63-F2-00-00-80

I2C

ParameterDescription

Bus speed (in Hz)

Defines the rate of data communication between the peripherals connected by the I2C bus.
Serial clock (SCL) pin

Sets serial clock (SCL) pin.

Serial data (SDA) pin

Sets serial data (SDA) pin.

SPI

ParameterDescription

Bus speed (in Hz)

 
Serial data out (SDO) pinThe pin that connects the master output to the slave input.
Serial data in (SDI) pinThe pin that connects the slave output to the master input.
Clock (SCK) pinThe clock pin for SPI communication.

SCI

ParameterDescription
Baudrate (in Hz)

Defines how fast the data is sent over a serial line.

Receive pin

Sets the receiving pin of UART.

Transmit pin

Sets the transmitting pin of UART.

Data bits length

Sets the number of data bits to transmit.

Parity

Sets the type of parity checking to identify low-level errors.

Stop bits

Sets the number of stop bits to indicate end of a packet.

PIL

ParameterDescription

PIL communication interface

The serial interface used for PIL communication
Serial portThe serial port for PIL communication

External mode

Build Options

ParameterDescription
Communication interfaceThe option is used for running your model in External mode with serial communication
Serial portThe serial port used by the target hardware
VerboseThe option to view the External mode execution progress and the updates in Diagnostic Viewer or MATLAB Command Window
Logging buffer size (in bytes)Specify the logging buffer size.
Use a dedicated timer to improve time stamp accuracyEnable the parameter to use a dedicated timer to improve the time stamp accuracy.

Connected IO

ParameterDescription
Serial portThe serial port used by the target hardware

CAN#

ParameterDescription
Baudrate in bits/s (1e9/((BS1+BS2+1)*Tq))Baudrate in bits/s of the CAN bus.
Receive pinSet the receiving pin of CAN.
Transmit pinSet the transmitting pin of CAN.
Test ModeSet operating mode for CAN interface.

Modbus

ParameterDescriptionDefault Value
Communication interfaceType of communication interface that the block will use for Modbus® communicationRS485
ModeModbus mode of operationClient
Server IDServer device address or identifier1
Configure CoilsConfigure coil register parametersSelected
Configure Discrete InputsConfigure discrete input register parametersSelected
Configure Holding registersConfigure holding register parametersSelected
Configure Input registersConfigure input register parametersSelected
Received timeout (ms)Maximum time in milliseconds the master waits for a response from Modbus server100

RS485

ParameterDescriptionDefault Value
Serial ModuleSerial module (port) that the block will use for Modbus communication SCI 0
DE PinData Enable pin number8
RE PinReceive Enable pin number9

ThingSpeak

ParameterDescriptionDefault Value
ThingSpeak server connection timeout (in s)

Specify the ThingSpeak server connection timeout in seconds.

3
ThingSpeak server response timeout during write (in s)

Specify the ThingSpeak server response timeout during write operation in seconds.

1
ThingSpeak server response timeout during read (in s)

Specify the ThingSpeak server response timeout during read operation in seconds.

5