Contenu principal

Model Configuration Raspberry Pi Blockset

R2026b

Hardware Implementation Overview

Configuration Parameters dialog box for Raspberry Pi hardware.

  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

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.<empty>
Device NameDevice name of your Raspberry Pi board in Simulink® Online™<empty>
UsernameRoot user name for Linux® running on the hardware board.<empty>
PasswordRoot password for Linux running on the hardware board.<empty>

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
Enable parallel buildEnable Simulink to compile generated code and driver source code in parallel.On
Run on boot

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

Off
Start-up delay (in seconds)Delay build or build and run by given amount of time3

SPI

ParameterDescriptionDefault 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

ParameterDescriptionDefault Value
Interface configurationCAN interface configuration methodSpecify via Simulink
Number of interfacesNumber of CAN interfaces to configure1
CAN NameSocketCAN interface namecan0
CAN TypeCAN interface typeReal
CAN protocolCAN communication protocol selectionClassical CAN
Bus speed (kbps)CAN bus bit rate for classical CAN communication500
Nominal bitrate (kbps)Arbitration phase bit rate for CAN FD communication500
Data bitrate (kbps)Data phase bit rate for CAN FD communication2000
Transmit queue buffer sizeTransmit queue length for SocketCAN interface65536
Filter configuration (all interfaces)CAN message filtering mode selectionAllow all messages
ID typeCAN identifier format for acceptance filterNormal
Acceptance MaskCAN identifier bit mask for filtering0
Acceptance filterCAN identifier filter value255
Inverse filterInvert filter criterion to reject matching messagesOff

MQTT

ParameterDescriptionDefault Value
Encryption typeCommunication encryption type between MQTT client and MQTT brokerNone
BrokerSelect the MQTT broker service provider that receives, filters, and sends messages to the clients.ThingSpeak
Broker addressAddress of the MQTT brokermqtt3.thingspeak.com
Configuration file path on targetLocation of configuration file on the Raspberry Pi <empty>
Print diagnostic messagesEnable logging of diagnostic messageOn
PortPort number for MQTT communication1883
CA Server certificate pathServer root certificate download path<empty>
UsernameUser name for MQTT broker to authenticate the client<empty>
PasswordPassword for MQTT broker to authenticate the client<empty>
Client IDUnique identifier of MQTT client<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
Host interfaceHost-side interface for XCP external mode communicationSimulink
CAN VendorCAN hardware vendor for host-side XCP on CAN communicationFirst available vendor
CAN DeviceCAN hardware device for host-side XCP on CAN communicationFirst available device
CAN ChannelCAN hardware channel for host-side XCP on CAN communicationFirst available channel
CAN interface nameSocketCAN interface name on the target for XCP on CAN communicationcan0
Extended CAN IDUse extended 29-bit CAN identifiers for XCP external mode communicationOff
CAN ID commandCAN identifier for XCP command messages from host to target2
CAN ID responseCAN identifier for XCP response messages from target to host3
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 Window.off
Set logging buffer size automaticallyAutomatically preallocate buffer size<empty>
Set XCP target polling timeSet 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

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 operationClient
Remote Server IP port numberIP port number of the client device on the TCP/IP network502
Local IP port numberIP port number of the server device(s) on the TCP/IP network502
Configure CoilsConfigure coil register parametersSelected
Start addressStarting address of the coil register 0
QuantityQuantity of coil register1
Configure Discrete InputsConfigure discrete input register parametersSelected
Start AddressStarting address of the coil register 0
QuantityQuantity of coil register1
Configure Holding registersConfigure holding register parametersSelected
Start addressStarting address of holding register0
QuantityQuantity of holding register1
Configure Input registersConfigure input register parametersSelected
Start addressStarting address of input register0
QuantityQuantity of input register1
Received timeout (ms)Maximum time in milliseconds the client 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