Simulink connect to Zynq-7020 board failed.

6 次查看(过去 30 天)
Enviornment: Matlab2020a+vivado2019.1 Board: zynq-xc7z020clg400 customized board
As the SoC is in clg400 package. The default SD files from ZC702/zedboard (development kits) cannot run in this board.
I planned to register the custom board and follow the steps. but failed when simulink estable connection to the target IP:192.168.1.101 through port:17725
I doubt that the firmware in SD is not correct. Did I miss some configures in the following steps?
Steps:
  1. In vivado, use zybo z7-20 board as the base as the its Soc is the same type as target board. Creat block design and generate ps7_init_gpl.c/ps7_init_gpl.h and design.tcl
  2. copy ps7_init_gpl.c/ps7_init_gpl.h into the buildroot project, which run in ubuntu16. overwrite the two files in zybo.
  3. buildroot.py -b zybo -p zynq to generat SD files. Copy files into the SD card.
  4. Insert SD into target board, boot. In matlab command line, zynq() will return the linuxshell with IP/Port. which means matlab can connect the target by eth.
  5. Register custom board in matlab, and run the demo hdlcoder_led_blinking_4bit. Follow HDL workflow advisor, the bitstream is generated and download into the target. The LEDs start blinking.
  6. In the gm_hdlcoder_led_blinking_4bit_interface model, HardwareBoard: 'Xilinx Zynq-7000 based board', StopTime: Inf. Then Click 'Monitor&Tune'. Simulink builds the model and connect to the target . Simulink returns: Failed to run the model on hardware.
Infos in the diagnositic panel .
Attempting to establish connection with hostname '192.168.1.101' through port 17725.
Error occurred while executing External Mode MEX-file 'ext_comm':
Failed to connect to the target. Possible reasons for the failure:
a) The target is not switched on.
b) The target is not connected to your host machine.
c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target.
Caused by:
An error occurred attempting to open an rtIOStream. More detail may be reported in the MATLAB command window
As well when I connect the target again with 'connect' command in simulink, the workspace shows more info:
Waring: Timed out waiting for application to start.
> In codertarget.zynq.internal/LinuxShell/waitForAppToStart (line 415)
In codertarget.zynq.internal.extmodeHooks (line 51)
In coder.oneclick/CoderTargetHook/locEvalNoOutput
In coder.oneclick/CoderTargetHook/preExtModeConnectAction
In coder.oneclick/TargetHook/createOneClickObjAndConfigureModelForExtModeConnect
In coder.internal.toolstrip/HardwareBoardHandler/extModeConnect (line 110)
In coder.internal.toolstrip/HardwareBoardContext/connectModelExtModeHardwareBoardActionCBInternal (line 117)
In coder.internal.toolstrip/HardwareBoardContext/connectModelExtModeHardwareBoardActionCB (line 274)
Attempting to establish connection with hostname '192.168.1.101' through port 17725.
  1 个评论
Vegard Steinsland
Vegard Steinsland 2021-10-22
This is maybe an old tread but i think this may help.
The problem i had was that Simulink needs to use root privileges directly to transfer files and start processes on the Zynq 7020 board (KRTL Snickerdoodle Black), so you have to add the root user.
Step-by-step
  1. Logon to the Zynq trough putty og other SSH
  2. Enter root mode by typing “sudo -i”
  3. Enter the regular password, the one defined in the config
  4. When loggen into root type “passwd”
  5. Make a root password
Goto Simulink and change user and password to point to root, and press Monitor and Tune. Now it worked for me.

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by