Skip to Content
Block descriptionsSystemSystem Target

System Target Block Description

This block is used to configure core parameters and model options within the Simulink environment. Specifically, it enables model integration with a CubeMX configuration file, adds FreeRTOS support, and sets up code generation and compilation options.



System Target block

Table of Contents

Inputs

This block has no inputs.

Outputs

Output NameTypeDescription
Start init functionboolConditional output
An output that triggers the Initialize block. This output is available when the Enable initialization function call output option is enabled.

Block Parameters

”Common” Tab

ParameterDescription
Integrate with .ioc fileEnables access to the parameter containing the path to the CubeMX configuration file.
CubeMX file pathConditional Parameter
The file path to the CubeMX configuration file. This parameter is accessible when the Integrate with .ioc file option is enabled.
The path can be selected using the “Select File” button.
The file can be opened directly using the “Open file” button.
MicrocontrollerThe microcontroller model for which the code is generated. If a file is selected in the CubeMX file path option, the model will be detected and selected automatically.
RTOS typeThe type of Real-Time Operating System (RTOS) used in the model. This will populate automatically once it is configured within the CubeMX file.
Enable timerEnables a custom execution time source for the model.
Timer numberConditional Parameter
The number of the timer used as the model execution time base. This parameter is available when the Enable timer option is enabled.
Timer clock [MHz]Conditional Parameter
The clock frequency of the timer used as the model execution time base. This parameter is available when the Enable timer option is enabled.
Enable initialization function call outputEnables the output port used to trigger the Initialize block.
Enable init delayEnables an initialization delay.
Delay [msec]Conditional Parameter
The initialization delay time in milliseconds. This parameter is available when the Enable init delay option is enabled.
Display ioc errors as warningsAllows displaying CubeMX configuration file errors as warnings within Simulink. If disabled, these errors will not be shown.
Sample time [s]The refresh period of the model.


System Target block parameters, Common tab

“Build options” Tab

ParameterDescription
Generate project filesProject file generation settings:
None - no files are generated
System32CubeIDE - files are generated for the STM32CubeIDE environment
Makefile parallel executionEnabling this option allows the Make utility to build multiple independent files simultaneously, which speeds up C code compilation.
Interface identifierThe identifier of the interface used for programming and debugging:
SWD – Serial Wire Debug mode (two-wire)
JTAG – standard JTAG interface (multi-wire)
BuildProject build options:
Generate Code – generates C compilation code without flashing it to the microcontroller
Deploy to hardware – builds the project and flashes it directly onto the target microcontroller
External mode – external mode that allows executing the code on the microcontroller while simultaneously tuning parameters in Simulink (e.g., using sliders), injecting signals, or monitoring real-time block data.
Build optimization levelThe optimization level applied to the generated code during the C build process.


System Target block parameters, Build options tab

“Target - host connection” Tab

This tab is only available when the External mode option is selected in the Build parameter under the “Build options” tab.

ParameterDescription
Communication interfaceThe communication interface used to connect with the host computer:
Serial – serial interface
Interface typeThe type of communication interface:
USART/UART – UART interface
USART/UART module numberThe number of the USART/UART module used for communication with the host computer.
Baudrate [bps]Data transmission speed in bits per second.
Serial portThe serial port used to communicate with the host computer.
Timeout [s]The time limit the system waits for a response from the host computer in seconds.
VerboseEnables displaying detailed log information regarding messages and task progress reports.


System Target block parameters, Target - host connection tab

CubeMX Configuration for a Given MCU Model

The minimal required CubeMX file configuration for the Simulink model is detailed in the Getting Started tab.

See Also

Last updated on