Nucleo-G491RE: communication error with MATLAB/Simulink XCP protocol via LPUART1
- April 12, 2023
- 2 replies
- 3532 views
Hi all,
I'm not able to connect Simulink to the model running on the Nucleo-G491RE board using the "Monitor&Tune" mode via Simulink XCP protocol -> Virtual COM Port -> STLINK-V3E -> VCP LPUART1.
I can deploy the model itself successfully to the board (Simulink: Build&Deploy). The model just contains a pulse generator driving the user LED on the board, which works.
In the attachment, I have prepared the Simulink model, the *.ioc CubeMX project file and the output of the Simulink diagnostic viewer after running the "Monitor&Tune" mode.
The jumpers on the board are configured to use LPUART1 between the STLINK-V3E and the MCU (default):
LPUART1 (PA2/PA3) connected to STLINK-V3E Virtual COM port:
SB17, SB23: ON
SB18, SB22, SB12, SB20: OFF
USART1 (PC4/PC5) connected to ARDUINO® (D1 & D0) and ST morpho connector (CN10 pin 35 & 37).
SB13, SB19: ON
SB12, SB20, SB18, SB22: OFF
I followed an example from Mathworks called "Code Verification and Validation with PIL for STMicroelectronics STM32 Processors Based Boards" (unfortunately I'm not allowed to post links here).
I use following MATLAB related versions:
MATLAB 2022b
Embedded Coder Support Package for ARM Cortex-M Processors V22.2.0
Embedded Coder Support Package for STMicroelectronics STM32 Processors V22.2.1 (this supports the STM32G4xx)
I use following STM32 related versions:
STM32CubeMX V 6.4.0
STM32CubeProgrammer 2.6.0
STM32G4 firmware: STM32Cube_FW_G4_V1.5.1
Two more notes:
- I tried to modify the jumpers such that the USART interface is used instead of LPUART, which was also not working - the same error message arises.
- Also, I tried the same example on a Nucleo-F446RE using the normal USART interface, which works as expected using the "Monitor & Tune" mode.
Has anyone had this problem before? If so, I would be happy to hear his/her solution to the problem.
Also I'm about to measure the signals of the LPUART with a logic analyzer. I will post the results when I'm ready.
Thank you in advance!
