Configure a Simulink® model to generate code, build an executable, and then run the executable on your Xilinx® Zynq® platform. The executable runs in the Linux® environment on the ARM® Cortex-A9 processor on the Xilinx Zynq platform.
Create a copy of your model using File > Save As. Keep the original model as a backup copy.
With your model open, press Ctrl+E or select Simulation > Model Configuration Parameters.
In the Configuration Parameters dialog box, click Hardware Implementation.
Set the Hardware board parameter to either Xilinx Zynq ZC702/ZC706 Evaluation Kits or ZedBoard™ development board.
Set the Operating system parameter to match the OS running on the
In Configuration Parameters, select the Code Generation pane.
Display the items under Code Generation by clicking the triangle next to it.
On the Code Generation pane, set System target
(Optional) If the target hardware operating system is set to VxWorks®, set Toolchain to
Wind River Workbench GNU
Wind River Workbench DIAB.
Save your changes to the model.
If your host computer is connected to multiple Xilinx Zynq platform boards, disconnect the ones you are not using.
Click the Build Model button.
The software performs the action specified by the Build action parameter. By default, this parameter is configured to build the executable, load the executable to the target hardware, and then run the executable in the Linux environment on the dual-core ARM Cortex-A9 processor on the Xilinx Zynq platform.
By default, the executable runs on a single core. PIL simulation and PIL-based execution profiling require single-core execution. To configure the executable to run on both cores, see Multicore Processor Targets (Simulink).
The software displays a code Generation Report for the model.
When the software finishes building and downloading the executable to the hardware, it displays a command-line status window.
If a connection timeout error occurs while the executable is downloading to the Zynq platform, try these steps:
In the MATLAB® Command Window, enter:
bdclose all clear all h = zynq() h = setupZynqHardware(h) connect(h)
ans = 0
These commands close open models, reload settings from the Zynq platform.
The final command,
connect(h) returns a zero when the connection is
made. Otherwise, perform the steps described in: Get IP Address of Xilinx Zynq Platform.
Build the executable again by pressing Ctrl+B or clicking the build button.