Deploy AUTOSAR Adaptive Application on Linux ARM64 Machine
This example shows how to deploy an AUTOSAR adaptive model on a Linux ARM64 target machine using the Embedded Coder® Support Package for Linux Applications.
The AUTOSAR adaptive model used in this example is autosar_LaneGuidance.slx
. This example demonstrates how to configure the model, set up the ARM64 target, and deploy it through the Linux Runtime Manager application.
To deploy the model, you need a MATLAB-supported machine with Simulink®, Embedded Coder, and Embedded Coder Support Package for Linux Applications installed along with Linux ARM64 (ARMv8-A or newer) machine with at least 2GB of RAM and 2GB of non-volatile storage available for application deployment.
Configure AUTOSAR Adaptive Model
Open the autosar_LaneGuidance.slx model by using this command in the MATLAB® command window.
open_system("autosar_LaneGuidance");
In the model configuration parameters, set the Hardware Implementation > Hardware board parameter to
Embedded Coder Linux Docker Container-ARM64
.
set_param("autosar_LaneGuidance","HardwareBoard","Embedded Coder Linux Docker Container-ARM64")
In the configuration parameters, under Code Generation > Build process > Toolchain settings Verify that Toolchain is set to
AUTOSAR Adaptive Linux Executable
. If not, set the toolchain using this command:
set_param("autosar_LaneGuidance","Toolchain","AUTOSAR Adaptive Linux Executable")
Set Up ARM64 Target Machine
Open the Linux Runtime Manager app by clicking Apps > Linux Runtime Manager from the model toolstrip. Alternatively, use this command.
linuxRuntimeManager
In the Target Configuration section provide the IP address of the Linux ARM64 machine along with the user credentials.
Under the Linux Target tab, in the Connect To Target section, click Connect. Alternatively, use these commands.
% Create a target object for the selected target tg = linuxTarget("LinuxTarget1"); % Connect the target tg.connect
After the target connects successfully, the CPU architecture of the target machine is shown as arm64 in the MATLAB command window.
For more information on setting up the target computer, see Setup Linux Target Computer.
Deploy Application on ARM64 Target
Under the Linux Target tab, in the Prepare section, click Create & Deploy Application Package.
In the dialog box opened, select the
autosar_LaneGuidance.slx
model.
This generates the application and deploys it on the target.
Alternatively, to create an application package from a Simulink model, use this command.
linux.createApplicationPackage("autosar_LaneGuidance");
To deploy the application package, use this command.
tg.deployApplicationPackage("autosar_LaneGuidance")
After the model is built and the adaptive application is successfully deployed on the target, you can see the deployed application including the executables in the Targets Tree.
For more information, see Build Simulink Model and Deploy Application.