I am getting 'Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command' using monitor and tune using stm32f411re

122 ビュー (過去 30 日間)
Mustafa Emre Zeybek
Mustafa Emre Zeybek 2023 年 10 月 26 日
回答済み: Saipraveen 2024 年 11 月 14 日 11:20
Hello,
I am trying to read data from a potentiometer from stm32f411re using simple analog input block and display with the Simulink Coder Support Package for STMicroelectronics Nucleo Boards. I can use the controller with build, start &deploy but I cannot use monitor and tune I get this error. I already checked com port from the device manager and use the same com port. I need help please
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
Component:Simulink | Category:Model error

回答 (2 件)

Rangesh
Rangesh 2023 年 10 月 30 日
編集済み: Rangesh 2023 年 10 月 30 日
Hi Mustafa,
I understand that you are trying to troubleshoot the issue by checking the COM port, but it appears that the ".ioc" file specific to this board has not been created for Simulink. To create the file, please follow the steps provided below:
  • Change the Hardware board to “STM32F4XX Based” in the Hardware settings.
  • Navigate to Create > Build options > Target hardware resources.
  • In the resulting window, create a new ".ioc" file and select the hardware as “NUCLEO-F411RE”.
  • After creating the file, proceedto configure the COM port and USART in the Connectivity > Target hardware resources section.
I hope that following these steps will help you resolve the issue you are facing.
Thanks,
Rangesh.
  2 件のコメント
Mustafa Emre Zeybek
Mustafa Emre Zeybek 2023 年 11 月 1 日
Hello Rangesh,
Thank you for your answer. I also tried to use embedded coder too and created an .ioc file from cube mx but I still got the same xcp error
Muhammad Qureshi
Muhammad Qureshi 2023 年 11 月 23 日
I have the very same issue. Did you find an answer?
Please let me know.

サインインしてコメントする。


Saipraveen
Saipraveen 2024 年 11 月 14 日 11:20
The following comprehensive steps can help diagnose and resolve an XCP timeout error, serving as a useful reference for both your situation and others who may encounter similar challenges.
COM Port Configuration:
  • Ensure that the COM port specified in your config parameters matches the one shown in the Device Manager.
  • Check for any conflicts with other applications that might be using the same port. Ensure no other tools, such as ST tools or serial monitoring applications, are using the COM port simultaneously.
Update MATLAB and Support Packages:
Verify that you are using the latest version of MATLAB. Ensure the hardware setup for the relevant hardware support package is complete, as updates often include bug fixes and enhancements.
Board Compatibility:
Confirm that your board is supported by Monitor and Tune. Note that some Discovery boards are not supported, while Nucleo boards typically work fine.
Dedicated Timer Setting:
If your model includes signals from asynchronous subsystems, use the dedicated timer checkbox in the configuration settings to enhance communication stability.
Model Complexity and Resources:
  • If your model is complex or if the device is running out of memory, Monitor and Tune might not work properly. Consider simplifying the model or checking for memory usage issues.
  • For complex models (e.g., FOC Motor Control), consider a two-model approach: a host model to receive serial data and serial blocks in the target model to send/receive data.
  • Use a status LED to visualize if the model is running in real-time.
VDI Connection:
Ensure the device is not connected over VDI, as this has been known to cause issues with serial connections.
Test Communication:
  • Deploy a simple model with a USART block to send raw data to the host. Use Simulink or a terminal program like Putty to confirm target-to-host communication.
  • Perform a loopback test by deploying a Simulink model with a USART receive block connected to USART send block and monitor the data in Simulink or Putty to ensure bidirectional communication is functioning. Ensure the same USART as monitor and tune is used for this test.
Contact Technical Support:
If the issue persists after trying these steps, consider reaching out to MathWorks Technical Support for further assistance.

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by