MATLAB Answers

Why do I get a "Failed to connect to the target" error when trying to run in external mode with a TI F28379D ControlCard?

40 views (last 30 days)
I have a Simulink model that I am trying to run on my TI F28379D ControlCard in External mode, but I keep seeing the following error:
Error occurred while executing External Mode MEX-file 'ext_comm': Failed to connect to the target. A time-out occurred while waiting for the connection response from the target. Possible reasons for the time-out:
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.
Also, sometimes when I try to run the model it appears to almost begin running, but then I see some similar but different errors:
Error occurred while executing External Mode MEX-file 'ext_comm':
ExtSetTargetPkt() call failed on CLOSE.
Ensure target is still running
Simulink cannot send a start packet to the mdoel 'myModel' running in external
mode, as the target has lost its connection with the host.
I have verified that all of my GPIO and COM port settings are correct, as described in this MATLAB Answers post:
I was even able to run the simple model from that post in external mode, but my real model will not work. What could be causing this?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 11 Apr 2018
The SW1 switch on the right-bottom of the board is supposed to be ON. The ON state can be inferred by label 1 and 0 around this switch. Please move both knobs on this switch towards 1.

  1 Comment

Multiplexer on 30 Oct 2018
Im constantly getting this error but on TI F28379D LAUNCH-XL board but there is no such switch there. The error appears when im trying to use solver step size lower than 0.01s. I even increased the external mode trigger duration to 200 and error still shows up for example for sample rates like 0.001s (0.001s x 200 = 0.2s).

Sign in to comment.

More Answers (1)

Taimur Zaman
Taimur Zaman on 14 Jan 2019
whenever i run my model; each time, i try this code and it works for me. try to keep sampling rate low, as changing it from 0.1 to 0.001 caused this same error for me.
if ~isempty(instrfind)


Sign in to comment.

Translated by