Error: Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command
Afficher commentaires plus anciens
I am using F280039C with 2023a version of MATLAB. While using the 'Monitor and Tune' option, I am able to flash the code but still seeing this error:
External Mode Open Protocol Connect command failed
Caused by:
- Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command
I have referred to the solution here but of no help: https://in.mathworks.com/matlabcentral/answers/1628360-why-am-i-unable-to-connect-to-target-the-model-throws-an-error-external-mode-open-protocol-connec
Attached are the hardware settings. I have checked the COM port which is selected as the Application / User UART. Tried with the Data port as well, but didn't help.

Is there any specific setting to be done for SCIA to make this functional? The current baud config is 115200.
Thanks,
Aditya
Réponses (2)
akshatsood
le 13 Oct 2023
Modifié(e) : akshatsood
le 13 Oct 2023
Hi Aditya,
I understand that you are encountering an error while using F280039C with MATLAB R2023a which is as follows
External Mode Open Protocol Connect command failed
Caused by:
Could not connect to target application: XCP internal error: timeout expired,
in response to XCP CONNECT command
This error has been extensively discussed in the community, and there have been numerous proposed workarounds. I recommend exploring the following discussions where you can find valuable insights and potential solutions.
I hope this helps.
Nivedita
le 23 Juil 2026
0 votes
Hello,
This error usually means that the model was built and programmed, but Simulink could not establish the Monitor & Tune / External Mode XCP connection with the running target application.
Before debugging External Mode itself, first verify that the basic serial link is working.
Suggested checks:
- Confirm that External Mode is configured to use the same SCI module that is connected to the board’s Application/User UART.
- Confirm that the COM port selected in the model is the Application/User UART COM port, not another debug/data port.
- Check that the baud rate in the model matches the target configuration. If 115200 does not work, try a lower baud rate first to rule out baud-rate or clock mismatch issues.
- Make sure no other application, such as CCS, PuTTY, a serial terminal, or another MATLAB session, is holding the COM port.
- Use a serial terminal tool such as PuTTY to verify basic RX/TX communication before trying External Mode/XCP.
- Recheck the SCI TX/RX pin assignment for the selected SCI module.
Relevant documentation:
- Set up serial communication with target hardware: Set Up Serial Communication with Target Hardware - MATLAB & Simulink
- Troubleshoot External Mode: Troubleshooting External Mode Issues - MATLAB & Simulink
- Baud rate troubleshooting: Optimizing Baud Rate Settings for External Mode Communication - MATLAB & Simulink
Since flashing succeeds, this is most likely a mismatch in COM port, SCI module, baud rate or UART routing rather than a code generation failure.
Thanks,
Nivedita.
Catégories
En savoir plus sur C2000 Microcontroller Blockset dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!