Why do I get an 'ext_comm' error when I try to run a model in External mode on a Zynq board with Embedded Coder?

11 views (last 30 days)
I am using the Embedded Coder Support Package for Xilinx Zynq Platform. I can successfully build a Simulink model on my Zynq board. However, when I try to run the model in External mode by changing the dropdown box from "Normal" to "External", and then going to Simulation > Connect to Target, I observe the following error:
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
I have verified that the board is switched on, that it is connected to my host machine, and that the application for the model is running on the target. How can I further troubleshoot this error?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Oct 2018
This error message indicates that Simulink is unable to communicate with the Zynq board over the Ethernet connection. If you have already checked the three suggestions from the error message, the most probable cause of this error is that the first 3 numbers in the board's IP address do not match those from the host computer's IP address.
Please apply the steps below:
1) To determine the IP address for the host computer, you can use the IPCONFIG command at a DOS prompt for a Windows machine, or IFCONFIG at a shell for a MacOs/Linux machine.
2) To determine the IP address for the Zynq board, you can use a terminal program such as PuTTY. Please follow the steps given in the documentation page below:
3) To resolve the 'ext_comm' error, you can change the IP address of the Zynq board to match the first three numbers in the IP address of the host computer. Once you have logged into the Zynq board over a serial connection, you can use the the IFCONFIG command to change the static IP address:
zynq> ifconfig eth0
Here, change the '' to the desired IP address, which should match the first three numbers for the host computer. Once you have done this, you should also make sure that you change the IP address in the model's Configuration Parameters, under Hardware Implementation > Target Hardware Resources > Board Parameters > Device Address.
  1 Comment
Jeedella Jeedella
Jeedella Jeedella on 16 Dec 2018
I have the same problem. I have verified all of the mentioned steps. From the host computer I can ping my Zybo board. The ar3 connected to a local network. I am sure that the problem is not related to wrong ip address.
Could you please help us with this problem?
kind regards

Sign in to comment.

More Answers (2)

Noam Levine
Noam Levine on 14 Jan 2019
The Embedded Coder Support Package for Xilinx Zynq Platform will not work with the Zybo board out of the box. You need to create a custom refernce design for Zybo, as explained in this example.

dawit mamo
dawit mamo on 10 Nov 2019
I have also the same problem I used matlab 2019a with vivado2018.2 the model run on the zed board but when I say run on external mode it shows the above same error

Community Treasure Hunt

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

Start Hunting!

Translated by