Model Configuration Simulink Support Package for Raspberry Pi Hardware
Hardware Implementation Overview
On the Modeling tab of the toolstrip, select Model Settings.
In the Configuration Parameter dialog box, select Hardware Implementation.
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.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 Implementation Options (Simulink Coder)
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
, orautosar.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
Parameter | Description | Default Value |
---|---|---|
Base rate trigger | Set source of scheduler interrupt | Operating system timer |
Board Parameters
Parameter | Description | Default Value |
---|---|---|
Device Address | IP address or host name of the hardware board. | <empty> |
Device Name | Device name of your Raspberry Pi board in Simulink Online™ | <empty> |
Username | Root user name for Linux® running on the hardware board. | <empty> |
Password | Root password for Linux running on the hardware board. | <empty> |
Build options
Parameter | Description | Default Value |
---|---|---|
Build action | Option to specify whether you want only build or build and run actions during code generation. | Build and run |
Build directory | Build 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 |
Enable parallel build | Enable Simulink to compile generated code and driver source code in parallel. | On |
SPI
Parameter | Description | Default Value |
---|---|---|
SPI0 CE0 Bus Speed (kHz) | Bus speed in kilo hertz for SPI 0 channel 0. | 500 KHz |
SPI0 CE1 Bus Speed (kHz) | Bus speed in kilo hertz for SPI 0 channel 1. | 500 KHz |
SPI1 CE0 Bus Speed (kHz) | Bus speed in kilo hertz for SPI 1 channel 0. | 500 KHz |
SPI1 CE1 Bus Speed (kHz) | Bus speed in kilo hertz for SPI 1 channel 1. | 500 KHz |
SPI1 CE2 Bus Speed (kHz) | Bus speed in kilo hertz for SPI 1 channel 2. | 500 KHz |
CAN
Parameter | Description | Default Value |
---|---|---|
CAN Bus Speed (kBit/s) | CAN bus speed in kilo bits per second. | 500 |
Allow All Messages | Select this parameter to allow all messages. | On |
ID Type 1 | CAN message frame format for filter 1 | Normal |
Acceptance Mask 1 | Specify acceptance mask value for filter 1 | 0 |
Acceptance Filter 1 | Specify acceptance filter value for filter 1 | 255 |
Inverse Filter | Inverse criterion to pass messages for filter 1 | Off |
ID Type 2 | CAN message frame format for filter 2 | Normal |
Acceptance Mask 2 | Specify acceptance mask value for filter 2 | 0 |
Acceptance Filter 2 | Specify acceptance filter value for filter 2 | 255 |
Inverse Filter | Inverse criterion to pass messages for filter 2 | Off |
ID Type 3 | CAN message frame format for filter 3 | Extended |
Acceptance Mask 3 | Specify acceptance mask value for filter 3 | 0 |
Acceptance Filter 3 | Specify acceptance filter value for filter 3 | 255 |
Inverse Filter | Inverse criterion to pass messages for filter 3 | Off |
ID Type 4 | CAN message frame format for filter 4 | Extended |
Acceptance Mask 4 | Specify acceptance mask value for filter 4 | 0 |
Acceptance Filter 4 | Specify acceptance filter value for filter 4 | 255 |
Inverse Filter | Inverse criterion to pass messages for filter 4 | Off |
MQTT
Parameter | Description | Default Value |
---|---|---|
Encryption type | Communication encryption type between MQTT client and MQTT broker | None |
Broker Address | Address of the MQTT broker | mqtt3.thingspeak.com |
Port | Port number for MQTT communication | 1883 |
CA Server certificate path | Server root certificate download path | <empty> |
Username | User name for MQTT broker to authenticate the client | <empty> |
Password | Password for MQTT broker to authenticate the client | <empty> |
Client ID | Unique identifier of MQTT client | <empty> |
External mode
Parameter | Description | Default Value |
---|---|---|
Communication interface | The transport layer External mode uses to exchange data between the host computer and the target hardware | XCP on TCP/IP |
Run external mode in a background | The 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 |
Port | The port the External mode uses for communications between the hardware board and host computer. | 17725 |
Verbose | Option to view the External Mode execution progress and updates in the Diagnostic Viewer or in the MATLAB Command Window. | Not selected |
Set XCP target polling time | Set XCP-based target polling time for Simulink models automatically or manually. | Automatically |
Polling time (in seconds) | Enter polling time in seconds. | 2 |
Connected I/O
Parameter | Description | Default Value |
---|---|---|
Communication Interface | Transport layer used to exchange data between host computer and hardware | TCP/IP |
Modbus properties
Parameter | Description | Default Value |
---|---|---|
Communication Interface | Type of communication interface that the blocks use for Modbus® communication | TCP/IP |
Mode | Modbus mode of operation | Client |
Remote Server IP port number | IP port number of the client device on the TCP/IP network | 502 |
Local IP port number | IP port number of the server device(s) on the TCP/IP network | 502 |
Configure Coils | Configure coil register parameters | Selected |
Configure Discrete Inputs | Configure discrete input register parameters | Selected |
Configure Holding registers | Configure holding register parameters | Selected |
Configure Input registers | Configure input register parameters | Selected |
Received timeout (ms) | Maximum time in milliseconds the client waits for a response from Modbus server | 100 |
Dashboard properties
Parameter | Description | Default Value |
---|---|---|
Enable deployment for Dashboard blocks | Enable deployment of Customizable Dashboard blocks on Raspberry Pi hardware boards | Not selected |
IP address type | Select IP address that the web server uses to host dashboard | Device address |
IP address | Enter IP address of device that hosts the dashboard on a web browser | 192.168.1.10 |
WebSocket port | Enter port number for the WebSocket server | 8000 |
HTTP port | Enter port number for the HTTP server | 8888 |