STM32F411 Discovery board Blink LED program error

20 views (last 30 days)
I am trying to run the Getting started with stm32f4discovery project in matlab simulink. the code simple wont run. I tried multiple methods and answers however my error is always related to USB connection issues.
"Error while trying to establish USB communication with the STM32F4-Discovery board. Please reset the USB communication: 1. Disconnect the USB cable from the board. 2. Wait for three seconds. 3. Connect the USB cable again."
There is simply no information regarding the use of specific discovery f411 board, neither has MATLAB or STM have bothered to specify anything, the support package seems like namesake.
Has anyone worked specifically with this board and could support me in troubleshooting this?
Other than the specified steps from the example, there is a lot of external settings involved, I have updated the ARM compilier, STLink, STLink Firmware, MATLAB add ons are in place, tried with jumper on CN3 on and off also, however a simple LED program cannot be run. My board is showing up under USB seriel bus devices, no COM port no information regarding COM port, no ways to know how to use the STLink or the COM port.
Looking forward to your expert comments.

Accepted Answer

Madhu Varshini
Madhu Varshini on 31 Aug 2023
Hi,
The STM32F4-Discovery board, specifically utilizing the STM32F407VG microcontroller, is officially supported according to the information provided on the STMicroelectronics STM32F4-Discovery webpage.
If you are working with a different board from the STM32F4 family, it's important to note that direct support for that specific board might not be available within the 'STM32F4-DISCOVERY' support package.
As a workaround, you can consider using the "STM32F4xx Based Boards" option available within the Embedded Coder support package in Simulink. To ensure successful model verification, you can follow the STM32CubeMX workflow.
Remember to configure the COM port and UART settings accurately, aligning them with the configuration set in the build setup.
  2 Comments
Sanath
Sanath on 31 Aug 2023
Yes, I tried it again, resinstalled the embedded support package and then it installed all the drivers again, then i selected STM32F4xx board, then it worked for me.
Sanath
Sanath on 31 Aug 2023
Hi, I have another similar issue related to connectivity, I was able to run the blink program but when i moved on to a more complex program such as interfacin the onboard LSM303AGR Sensor for Magnetometer, I get the following error
"Error:External Mode Open Protocol Connect command failed
Caused by:
Could not connect to target application: XCP serial port error: open: The system cannot find the file specified [system:2]"
I looked this up and it is most likely the error related to COM Port, however, I cannot find my board under COM Ports, just in device manager it shows port #1 hub #1, hence I have put in COM1.
At the same time, i tried a lot to see the exact COM port but it is not available to see. If the blink program is able to run on hardware as well as if I am able to use "build, deploy & start" with the code without any errors, the Magnetometer program should work in "monitor and tune" as well, right? I did not change anything else expect the blocks.
I am using the below example (only magnetometer blocks):
https://de.mathworks.com/help/fusion/ug/estimate-oientation-using-ahrs-filter-and-imu-data-in-simulink.html

Sign in to comment.

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!