Simulink External Mode not working on Texas Instruments C2000 Launchpad F28377S
Show older comments
Hi, I am trying to use Simulink r2016a "External" Simulation Mode, to run a simple Simulink program (blink LEDs at a specified rate) on a Texas Instruments C2000 Launchpad F28377S board, and monitor what is happening using scopes in Simulink.
If I can do this, then I will be able to implement and debug more complex models on the Launchpad.
I can run the "Update Diagram" check succesfully.
I can "Deploy to Hardware" succesfully - the built in LEDs on the board blink as expected.
But when I press "Run", for "External" Simulation Mode, I get the error:
" Error occurred while executing External Mode MEX-file 'ext_serial_win32_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."
The error message is confusing, as the target is definately on, connected, and the program is running on the target.
Details of my setup:
I am using a USB cable to connect my pc to the C2000 Launchpad F28377S board.
I've attached some screenshots of relevant settings, and my code is attached.
I understand that in External Mode, the Launchpad board will send data back to Simulink on my pc over Serial communications, on the USB cable. I think there might be a setting here that I have got wrong.
Any help would be much appreciated.






4 Comments
Dheeraj Kapur
on 21 Dec 2016
Hi, have you been able to resolve this? We are facing the same problem and are getting the same error while in the external mode. We're using a TI TMS320F28069 control card.
Drew Radcliff
on 6 Apr 2017
I am also getting this issue with the Launchpad F28379D. Would like to know if anyone has solved.
Thanks
Matthias Baert
on 20 May 2017
Exactly the same problem here, shame that MATLAB does not have an answer to this problem.
SIVA KRISHNA
on 20 Feb 2022
Please recheck the Oscillator clock frequency properly. That should solve the issue. For F2838X devices, it should be 25 MHz.
Accepted Answer
More Answers (6)
Matthias Baert
on 23 May 2017
1 vote
I have found the solution to this problem. MATLAB initialises the SCI_A port badly. If one has a look in the documentation of the Launchpad one can see that the SCI_A port needs to be configured to use GPIO 42 and 43 in order to be able to communicate over USB. For me this solved the problem completely.
4 Comments
Matthias Baert
on 23 May 2017
EDIT: I use the F28379D board, so if you have another board check the documentation to see which pins you need for USB communication. Matlab does not configure this correctly automatically.
Gabriel Pauka
on 9 Aug 2017
Edited: Gabriel Pauka
on 9 Aug 2017
I'm also working with the F28379D, and the "SCI_A" configuration for Tx = GPIO 42 and Rx = GPIO 43 worked perfectly! Thanks!
han wang
on 28 Jan 2021
Many thanks! It works with F28379D.
Hassan Khalid
on 11 Apr 2021
@Matthias Baert im using arduino UNO. I am facing the same issue. Can you please guide me in similar way in this regard.
Matko Pecanic
on 4 Jan 2018
1 vote
My solution: Hi, as you can see above I had the same problem despite doing all the stuff mentioned above.
So after no more smart options I started doing random shi*. I changed from CPU1 to CPU2 in Hardware Implementation > Build options and ofcourse it did not work. So I changed it back to CPU1 and hit RUN just to make sure it still does everything as same as before, bit this time it worked :D
1 Comment
Yunjie Gu
on 30 Mar 2021
Thanks Matko, this trick works for me. I guess it might be that the code running on CPU2 are disrupting the sci communication interrput handler.
Brian McKay
on 10 Oct 2016
0 votes
Just a guess... but sometimes, CCS locks the USB port to the board because it maintains the connection. Try using the MathWorks tools to build and download, before connecting with CCS. Or if you do connect with CCS, make sure it is disconnected and releases the USB port - as both programs cant access USB port at the same time.
-Brian
5 Comments
emmanuel doit
on 17 Oct 2016
emmanuel doit
on 17 Oct 2016
Tfm tfm
on 8 Mar 2017
Hello, Emmanuel. Have you solved this problem? I've seen many other people struggling with that as well, but no response.
Hi everybody, I have been using f28379D series. I had same problem. After checking internal clock (Hardware configuration > Clock Settings) the problem were solved . now I can work external mode. But building and downloading time is so much ( about 3 minutes) I couldnt reduce that time. ? Anyone have this problem?
Lukasz Huchel
on 10 Aug 2017
Why the internal clock solves the problem?
Matko Pecanic
on 3 Jan 2018
Edited: Matko Pecanic
on 3 Jan 2018
0 votes
I'm using an F28379D Launchpad and did all the things mentioned above:
- set SCI_A PINS to 42 & 43
- checked "internal clock" box (it becomes 10MHz automatically)
also matched baud rate
Still getting this 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. Component:Simulink | Category:Block diagram error Unable to connect to the 'TI Delfino F2837xD' target for 'Launchpad_test3'. Component:Simulink | Category:Model error
1 Comment
SIVA KRISHNA
on 20 Feb 2022
Please recheck the Oscillator clock frequency properly. That should solve the issue. For F2838X devices, it should be 25 MHz.
giray uzun
on 24 Feb 2018
Edited: giray uzun
on 24 Feb 2018
0 votes
I had the same problem. Then I have tried something and fixed. First, you need to specify GPIO_42 and GPIO_43 as Tx and Rx as in SCI_A tab. Then go `clocking` and write `Oscillator frequency in MHz` 10 instead of 20 which is the default. If it does not work, try to use internal oscillator. By the way, I am using F28379D.
All options are at ` Hardware Implementation`.
Have a nice programming.
1 Comment
Dynamo
on 29 Aug 2025
0 votes
For anyone looking for an answer to this question in 2025 here is how I solved this problem on TI Delfino F28379D:
- If you are using any other board than TI Delfino F28379D then make sure you check the GPIO pins it uses for Tx and Rx (basically input output pins of the board) you will find this information in the manual of the board you are using so search carefully. It is GPIO 42 Tx and GPIO43 for Rx for TI Delfino F28379D.
- Once you have your board and GPIO pin numbers. Check the oscillator clock frequency it should be 10 MHz for TI Delfino F28379D. It may differ from board to board.
- Open device manager in your PC and look for Ports and COM and double click on XDS 100 Class USB serial port (COMX) where X is some integer number. Note down the COMX as we will use it later in MATLAB. Now in port settings Set baud rate to 115200, parity to nonne, leave everything as default.
- Go to MATLAB and Simulink. Open hardware settings. Click on HArdware Implementation.
- Click on target hardware resources.
- Go to Clocking and set Oscillator OSCCLK to 10 MHz
- Go to SCI_A and set Tx and Rx as GPIO42 and GPIO43. Check baud rate and other settings same as Device manager port settings.
- Go to External mode and check the COM port is right same as device manager.
- Go to connected IO and again check right COM port.
Now run the simulation on the board through build,deloy and run. It should work.
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!