Could not connect to STM32F7xx board for serial communication
14 views (last 30 days)
Show older comments
Hello,
I followed the steps mentioned below on how to work on the STM32 processor based boards:
- https://www.mathworks.com/videos/using-simulink-with-stm32-discovery-and-stm32f4xx-based-boards-1637578171735.html
- https://www.mathworks.com/help/supportpkg/stmicroelectronicsstm32f4discovery/ug/Getting-started-stm32cubemx.html
I was able to "Build, Deploy & Start" the simulink model without any errors.
However, once I try to run in the "Monitor & Tune" mode I get the error:
- "External Mode Open Protocol Connect command failed. Caused by: Could not connect to target application: XCP serial port error: open: The parameter is incorrect".
Moreover, when I try the "Connect" mode after the "Build, Deploy & Start" I get the error:
- "External Mode Open Protocol Connect command failed. Caused by: DWARF Parser internal error: Parser::describeSymbol xcpDummyDoubleVariable is not a global variable"
My board is recognized as Virtual COM Port and in the Configuration parameters -> Hardware Implementation -> Connectivity I set the Serial Port to the Virtual COM Port that the board is set on.
The implementation from the STM32CubeMX:
I used STM32CubeMX and STM32CubeIDE to test the serial connection and it was working fine.
The only difference between both solution is that Simulink asks for USART and I used USART1 for this. Also, the driver selector should be LL for the solution to be used in Simulink. However, with the STM32CubeIDE it is HAL.
I'm not sure what is the cause of the problem. I hope someone knows a solution to this error.
Thanks.
Answers (1)
Sameer Pujari
on 25 Oct 2022
Hi Omar Ismail
I understand you are facing communication issue while using “Monitor and Tune” mode on STM32F7xx board
Ensuring following settings should enable you the configuration for “Monitor and Tune”
- In CubeMX, Ensure that you are using USART1 in “Asynchronous mode” and set Baud rate to 115200 Bits/s
- In Configuration parameters > Hardware Implementation > Connectivity, Specific USART1 and COM port used by the device
For detailed explanation you can refer to Monitoring and Tuning Using STMicroelectronics STM32 Processor Based Boards - MATLAB & Simulink - MathWorks India
I hope this information helps you!
4 Comments
WUG
on 5 Dec 2022
Edited: WUG
on 5 Dec 2022
Dear Omar Ismail
Thank you for your hearty answers.
May you teach me what kind of USB-TTL converter you had used and your configuration about USART, such about baud rate and so on?
Maybe I had do some wrong configuration between PC and STM32.
I am looking forward to your answers.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!