Unable to go to external mode

240 views (last 30 days)
Syed Hamza Ali
Syed Hamza Ali on 31 Jul 2017
Edited: Walter Roberson on 13 Nov 2021 at 3:19
I am running simple LED blinking using Simulink and Arduino and i am running into this error
Build process completed successfully
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.
Component:Simulink | Category:Block diagram error
Unable to connect to the 'Arduino Uno' target for 'syched'.
What to do.
  7 Comments
Victor Maciel
Victor Maciel on 10 Jul 2020
Me too, Rok Avsec. The problem was the baud rate too high.

Sign in to comment.

Answers (6)

abdolreza azizi
abdolreza azizi on 15 Jun 2018
i have this problem for matlab2018 and latest simulink support package.how fix it?
  4 Comments
abdolreza azizi
abdolreza azizi on 22 Jun 2018
AVR Memory Usage
----------------
Device: atmega2560
Program: 21432 bytes (8.2% Full)
(.text + .data + .bootloader)
Data: 1479 bytes (18.1% Full)
(.data + .bss + .noinit)
### Successful completion of build procedure for model: arduino_communication
Build process completed successfully
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.

Sign in to comment.


Madhu Govindarajan
Madhu Govindarajan on 26 Oct 2017
Have you tried manually setting the COM port to the accurate port? Another common issue that causes this - A MATLAB arduino object already exists. This would not allow you to do External mode at the same time and you have to clear the object before you do external mode.
If error still persists, please reach out to Technical support of MathWorks.
  4 Comments
Madhu Govindarajan
Madhu Govindarajan on 31 Oct 2018
Try a power cycle of switching off the Arduino power via USB and other external sources, then double pressing the RESET button to put it in bootloader mode. Then try external mode again.
Btw, with Arduino Uno there are some release restrictions. More info here - https://www.mathworks.com/hardware-support/arduino-simulink.html

Sign in to comment.


DEBASISH MISHRA
DEBASISH MISHRA on 27 Mar 2018
Hi, try to reduce the step size, may be 50e-6
  1 Comment
Walter Roberson
Walter Roberson on 28 Mar 2018
The timeout on connection to target has nothing to do with step size. It is a problem in reaching the device at all.

Sign in to comment.


Benjamin
Benjamin on 25 Jun 2018
I have the same problem. Any solutions?


satish moupuri
satish moupuri on 5 Nov 2021
I have the follwing error while click the connect button after connecting the generic F28335 board
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.

Community Treasure Hunt

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

Start Hunting!