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

I have the same fault here. Does anyone have a solution?
I am able to 'Deploy to hardware' and it runs the blinking LED, however if I select 'Run' in Simulink it completes the 'Build process completed successfully'
Then 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.
Vinay Rathore
Vinay Rathore 2017년 10월 18일
Did any one found the solution of above problem. I have the same issue on arduino mega 2560
Christian Mack
Christian Mack 2017년 10월 21일
I have the same problem. (Matlab/Simulink 2017a, mega2560, win10) Please help!
gopinath virat
gopinath virat 2018년 8월 26일
I am all so same problem I am solved reset support package ex( arudino uno change none after set the arudino uno run simulink after problem solved)
Rok Avsec
Rok Avsec 2018년 12월 20일
I had the same problem. Go and read this thread. I spent 2 days looking arround but this did the trick in 1 minute.
tuan le tho
tuan le tho 2019년 5월 28일
Thanks a lot for sharing
That trick works
Victor Maciel
Victor Maciel 2020년 7월 10일
Me too, Rok Avsec. The problem was the baud rate too high.

댓글을 달려면 로그인하십시오.

답변 (6개)

abdolreza azizi
abdolreza azizi 2018년 6월 15일

1 개 추천

i have this problem for matlab2018 and latest simulink support package.how fix it?

댓글 수: 4

Walter Roberson
Walter Roberson 2018년 6월 15일
Are you using a genuine Arduino or a clone ?
Madhu Govindarajan
Madhu Govindarajan 2018년 6월 15일
@abdolreza azizi - can you try adding a scope to the arduino_gettingstarted model and run it in external mode with your hardware and let us know what errors you are getting.
abdolreza azizi
abdolreza azizi 2018년 6월 21일
recently I installed Matlab 2018a with update2 and the latest Simulink support package for Arduino hardware. when I deploy the Simulink model to Arduino mega2560, it works well. but when I want to run in external mode, this error occurs. also : 1. I don't have any additional devices or shields. 2. about three months ago with Matlab 2017a and latest support package i able to run external model and also deploy the model to Arduino mega2560, due, and UNO. but last week I tried to run external model on Arduino, but it didn't work. (deploy works well ) then I change my Matlab to 2018a with update 2 and latest support package. the fault occurs again but i can deploy the Simulink model to Arduino and it works well. 3. it didn't work with basic example model.
abdolreza azizi
abdolreza azizi 2018년 6월 22일
편집: Walter Roberson 2018년 6월 25일
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.

댓글을 달려면 로그인하십시오.

Madhu Govindarajan
Madhu Govindarajan 2017년 10월 26일

0 개 추천

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

Vinay Rathore
Vinay Rathore 2017년 10월 26일
Thanks for your answer MAdhu, i appreciate that but i have already checked all those setting, can you please provide us other solution. \
Christian Mack
Christian Mack 2017년 10월 27일
I could solve the prolbem in my case. I was using a "MEGA 2560" from China (a arduino replica) and it did not work. Now I tried a SainSmart MEGA 2560 (another replica) and this one is working fine (with the same settings and the same simulink model.)
Steffen Hartmann
Steffen Hartmann 2018년 10월 30일
Hello, I have the same problem when using simulation/external on my arduino uno system. When running on the hardware with "deploy to hardware" the code runs standalone like expected. That means communication in not a problem? It´s set to "Manual/com3". Could it be that simulation uses another com-port? Thank you in advance
Madhu Govindarajan
Madhu Govindarajan 2018년 10월 31일
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

댓글을 달려면 로그인하십시오.

DEBASISH MISHRA
DEBASISH MISHRA 2018년 3월 27일

0 개 추천

Hi, try to reduce the step size, may be 50e-6

댓글 수: 1

Walter Roberson
Walter Roberson 2018년 3월 28일
The timeout on connection to target has nothing to do with step size. It is a problem in reaching the device at all.

댓글을 달려면 로그인하십시오.

Benjamin
Benjamin 2018년 6월 25일

0 개 추천

I have the same problem. Any solutions?
Gonzalo Cabanas
Gonzalo Cabanas 2018년 11월 13일

0 개 추천

I have the same problem with an Chinese replica Arduino Mega 2560...Did anyone solve this problem?
Thank you guys!
satish moupuri
satish moupuri 2021년 11월 5일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Arduino Hardware에 대해 자세히 알아보기

질문:

2017년 7월 31일

편집:

2021년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by