Main Content

Model Configuration Simulink Support Package for Raspberry Pi Hardware

Hardware Implementation Overview

Configuration Parameters dialog box for Raspberry Pi.

  1. On the Modeling tab of the toolstrip, select Model Settings.

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

  3. Set the Hardware board parameter to Raspberry Pi. This selection populates the Hardware board settings parameters with the default values for the Raspberry Pi™ hardware. You can adjust these parameters to suit your particular use case.

  4. Click Apply.

Hardware Implementation pane parameters do not control hardware or compiler behavior. The parameters describe hardware and compiler properties for the MATLAB® software.

  • Specifying hardware characteristics enables simulation of the model to detect error conditions that can arise when executing code, such as hardware overflow.

  • MATLAB uses the information to generate code for the platform that runs as efficiently as possible. MATLAB software also uses the information to give bit-true agreement for the results of integer and fixed-point operations in simulation and generated code.

See Also

Hardware board

Select the hardware board upon which to run your model.

Changing this parameter updates the dialog box display so that it displays parameters that are relevant to your hardware board.

To install support for a hardware board, start the Support Package Installer by selecting Get Hardware Support Packages. Alternatively, in the MATLAB Command Window, enter supportPackageInstaller.

After installing support for a hardware board, reopen the Configuration Parameters dialog box and select the hardware board.

Settings

Default: None if the specified system target file is ert.tlc, realtime.tlc, or autosar.tlc. Otherwise, the default is Determine by Code Generation system target file.

None

No hardware board is specified. The system target file specified for the model is ert.tlc, realtime.tlc, or autosar.tlc.

Determine by Code Generation system target file

Specifies that the system target file setting determines the hardware board.

Get Hardware Support Packages

Invokes the Support Package Installer. After you install a hardware support package, the list includes relevant hardware board names.

Hardware board name

Specifies the hardware board to use to implement the system this model represents.

Tips

  • When you select a hardware board, parameters for board settings appear in the dialog box display.

  • After you select a hardware board, you can select a device vendor and type.

Base rate task priority

This parameter sets the static priority of the base rate task. However, the changes that you make in this parameter do not result in any functionality differences on the Raspberry Pi hardware.

Settings

Default: 40

Detect task overruns

Detect when a task overrun occurs in a Simulink® model running on the target hardware. Indicate when an overrun has occurred.

A task overrun occurs if the target hardware is still performing one instance of a task when the next instance of that task is scheduled to begin.

You can fix overruns by decreasing the frequency with which tasks are scheduled to run, and by reducing the number or complexity of the tasks defined by your model.

If those solutions do not fix the task overrun condition, and you are using External mode, consider disabling External mode.

Settings

Default: None

Scheduler options

ParameterDescriptionDefault Value
Base rate triggerSet source of scheduler interruptOperating system timer

Board Parameters

ParameterDescriptionDefault Value
Device AddressIP address or host name of the hardware board.192.168.0.101
Device NameDevice name of your Raspberry Pi board in Simulink Online™None
UsernameRoot user name for Linux® running on the hardware board.pi
PasswordRoot password for Linux running on the hardware board.raspberry

Build options

ParameterDescriptionDefault Value
Build actionOption to specify whether you want only build or build and run actions during code generation.Build and run
Build directoryBuild directory for Linux running on the hardware board./home/pi
Run on boot

Automatically starts a Simulink model deployed on the hardware every time you restart the hardware.

off

SPI

ParameterDescriptionDefault Value
SPI0 CE0 Bus Speed (kHz)Bus speed in kilo hertz for channel 0.500
SPI0 CE1 Bus Speed (kHz)Bus speed in kilo hertz for channel 1.500

CAN

ParameterDescriptionDefault Value
CAN Bus Speed (kBit/s)CAN bus speed in kilo bits per second.500
Allow All MessagesSelect this parameter to allow all messages.On
ID Type 1CAN message frame format for filter 1Normal
Acceptance Mask 1Specify acceptance mask value for filter 10
Acceptance Filter 1Specify acceptance filter value for filter 1255
Inverse FilterInverse criterion to pass messages for filter 1Off
ID Type 2CAN message frame format for filter 2Normal
Acceptance Mask 2Specify acceptance mask value for filter 20
Acceptance Filter 2Specify acceptance filter value for filter 2255
Inverse FilterInverse criterion to pass messages for filter 2Off
ID Type 3CAN message frame format for filter 3Extended
Acceptance Mask 3Specify acceptance mask value for filter 30
Acceptance Filter 3Specify acceptance filter value for filter 3255
Inverse FilterInverse criterion to pass messages for filter 3Off
ID Type 4CAN message frame format for filter 4Extended
Acceptance Mask 4Specify acceptance mask value for filter 40
Acceptance Filter 4Specify acceptance filter value for filter 4255
Inverse FilterInverse criterion to pass messages for filter 4Off

MQTT

ParameterDescriptionDefault Value
Broker AddressThe address of the MQTT broker.mqtt.thingspeak.com
UsernameUser name for MQTT broker to authenticate the client.<empty>
PasswordPassword for MQTT broker to authenticate the client.<empty>
Client IDA unique identifier for the client that is connected to the MQTT broker. <empty>

External mode

ParameterDescriptionDefault Value
Communication interfaceThe transport layer External mode uses to exchange data between the host computer and the target hardwareXCP on TCP/IP
Run external mode in a backgroundThe option to force the External mode engine to run the generated code in a background task.Not selected
Logging buffer size (in bytes)The buffer size for logging data in Universal Measurement and Calibration Protocol (XCP)-based External mode.1000000
PortThe port the External mode uses for communications between the hardware board and host computer.17725
VerboseOption to view the External Mode execution progress and updates in the Diagnostic Viewer or in the MATLAB Command WindowNot selected

Connected I/O

ParameterDescriptionDefault Value
Communication InterfaceTransport layer used to exchange data between host computer and hardwareTCP/IP

Modbus properties

ParameterDescriptionDefault Value
Communication InterfaceType of communication interface that the blocks use for MODBUS® communicationTCP/IP
ModeMODBUS mode of operationMaster
Remote Slave IP port numberIP port number of the master device on the TCP/IP network502
Local IP port numberIP port number of the slave device(s) on the TCP/IP network502
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

Dashboard properties

ParameterDescriptionDefault Value
Enable deployment for Dashboard blocksEnable deployment of Customizable Dashboard blocks on Raspberry Pi hardware boardsNot selected
IP address typeSelect IP address that the web server uses to host dashboardDevice address
IP addressEnter IP address of device that hosts the dashboard on a web browser192.168.1.10
WebSocket portEnter port number for the WebSocket server8000
HTTP portEnter port number for the HTTP server8888