cancel
Showing results for 
Search instead for 
Did you mean: 

MATLAB/Simulink XCP protocol via LPUART1

JellyFish
Visitor

Hi all,

I failed to run Nucleo-G431RB board using Simulink "Monitor & Tune" mode via Simulink XCP protocol.

I've got the error message at Simulink,
"Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command"

There has been no problem for Simulink "Build, Deploy & Start".

I followed an example from the link below.
https://www.mathworks.com/help/ecoder/stmicroelectronicsstm32f4discovery/ug/STM32F4XX-ADC-example.html

I've already changed Simulink model configuration to run Nucleo-G431RB LPUART.
- Hardware board = STM32G4xx Based
- Hardware board settings> Build options> Create> Select hardware = NUCLEO-G431RB
- Connectivity > USART/UART = LPUART1
- Connectivity > Serial port = COM1 (same port for STMicroelectronics STLink Virtual COM Port)

MATLAB related version:
- MATLAB 2023a
- Embedded Coder Support Package for ARM Cortex-M Processors V23.1.0
- Embedded Coder Support Package for STMicroelectronics STM32 Processors V23.1.3

STM32 related version:
- STM32CubeMX V.6.4.0
- STM32Cube_FW_G4_V1.5.1


I've read the similar post below, but couldn't figure out what was the problem.
https://community.st.com/t5/stm32-mcus-products/nucleo-g491re-communication-error-with-matlab-simulink-xcp/td-p/82065

Thank you in advance!

2 REPLIES 2
JellyFish
Visitor

Let me attach the ioc and Simulink files.

STTwo-32
ST Employee

Hello @JellyFish and welcome to the ST Community.

For support on MATLAB/Simunlink, i suggest you to use the MATLAB Community https://www.mathworks.com/matlabcentral/content/communities.html.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.