ST Nucleo detection error Simulink

조회 수: 32 (최근 30일)
Kars
Kars 2017년 7월 6일
댓글: FRANCESCO BORCHI 2022년 2월 11일
Hi all,
I recently bought a ST Nucleo F401RE from STMicroelectronics. I've installed the driver and the device pops up nicely in the device manager. When I want to code it with Simulink, I install the Hardware Support Package and open the stmnucleo_communication demo. I set the COM port to the correct value and run the example on external mode. When I try to built/run it, Simulink says it can not detect the ST Nucleo board, and returns this error:
The following error occurred during deployment to your hardware board:
The STM32 board is not detected. Please check that the board is connected. If the board is connected, please install drivers for the board
I've already tried different PC's (Windows 7 64bit and Windows 10 64 bit), different versions of Matlab (2016b and 2017a) and reinstalling the driver for the ST Nucleo ( ST Link v2 ).
When I write a program in C using the mbed developer compiler ( https://developer.mbed.org/compiler/ ), I can upload the program to the Nucleo and it works fine, so this indicates that there is not a connection/driver error as suggested by Simulink.
Any clues what I'm missing?
  댓글 수: 2
Jan
Jan 2021년 6월 16일
I have had the same Error-Message "The following error occurred during deployment to your hardware board: The STM32 board is not detected. Please check that the board is connected. If the board is connected, please install drivers for the board".
In my case I could fix the problem with the ST-Link firmware update (stsw-link007). The updater should also be included in STM32CubeIDE.
Step 1: Start the Upgrade of ST-Link with stsw-link007 or in STM32CubeIDE.
Step 2: Choose "Change Type" and "STM32 Debug + Mass storage + VCP
Step 3: Start the Upgrade
If the Upgrade was successful, you will find your STM-Controller as mass storage.
After the Upgrade the Error-Message in MATLAB Simulink didn't occour again.
FRANCESCO BORCHI
FRANCESCO BORCHI 2022년 2월 11일
I also had the same error. I solved in a different way though (my drivers were working fine, and I could program the board with the CubeIDE). It turned out I needed to select the target manually.
  1. ctrl+e on the simulink model
  2. Choose "Hardware implmentation" on the left-hand menu
  3. "Target hardware resources"
  4. "Set host drive" pick "Manually" from the drop-down menu
  5. Choose the drive that your OS is setting your board on (i.e. "D:")
Then it built the code and loaded on the board/chip.
Hope it helps.

댓글을 달려면 로그인하십시오.

답변 (3개)

Don Zheng
Don Zheng 2017년 7월 19일
편집: Don Zheng 2017년 7월 19일
Will the following steps help?
1. Open the MATLAB version with the support package.
2. In the MATLAB command line, run the following commands:
resotredefaultpath
rehash toolboxcache
3. Restart MATLAB.

Kars
Kars 2017년 11월 6일
Little bit late, but the update from the hardware support package (16.2.3) did solve it :)
  댓글 수: 2
Peeyush
Peeyush 2017년 11월 7일
Hi kheinen,
This is reply for the message you sent me via my author page. Yes I am the developer of support package. I tried reproducing the issue at my end, unfortunately could not do it. Can you reinstall the support package 17.2.1.0 once at your end? I am not sure what is the issue, but can suggest you following steps:
- Delete folders starting from 3P. in ‘tempdir’ in your system. You can type ‘tempdir’ in MATLAB to know the path to your temp directory.
- Delete folder named as ‘MathWorks’ inside your download directory
- Uninstallation of support package
- If you see some folders remaining at: matlabshared.supportpkg.getSupportPackageRoot path, please delete those
- Install support package from add-on managers again.
- Update the board firmware using utility at the page: http://www.st.com/en/development-tools/stsw-link007.html
Rerun the model in external mode.
Thanks, Peeyush
Kars
Kars 2017년 11월 10일
편집: Kars 2017년 11월 10일
Hi Peeyush,
I did all the steps you said, but unfortunately still got the same connection error:
Error occurred while executing External Mode MEX-file
'ext_serial_win32_comm':
Failed to connect to the target. A time-out occurred while waiting for the connection response from the target. Possible reasons for the time-out:
a) The target is not switched on.
b) The target is not connected to your host machine.
c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target.
Edit: When I put my model in the one of the examples, it works. I think I missed some model configuration parameters when running my own model, but can't find out which. When I make a new model, I set the hardware board to the Nucleo F401RE and I set the correct COM port. Am i missing some important parameter here?

댓글을 달려면 로그인하십시오.


salvador Tazanou
salvador Tazanou 2018년 7월 18일
Hello everybody, I recently began to use the ST Nucleo F401RE from STMicroelectronics. My goal is to use it with Matlab-Simulink to communicate with a pressure sensor (sdp611, data sheet attached) via I2C. I install the Hardwares Support Packages and begun with the "getting started" examples. There is an example making me believe that I'm doing something wrong. The example is: Read Temperature from I2c based Sensor using STMicroelectronics Nucleo Boards. Link:https://de.mathworks.com/help/supportpkg/nucleo/examples/read-temperature-from-an-i2c-based-sensor-using-stmicroelectronics-nucleo-board.html I just connected my microcontroller to the PC and ran the model in external mode (no sensor was connected with the micro-controller) and was able to get some temperature value!!! Furthermore, I tried to connect my sensor with the micro-controller(pin D15->SCL, D14->SDA using 10k pull up resistors). My sensor is not even influencing the value of the Master read block. My questions are: is there any method to make sure my sensor have been detected (like verifying its adress)? By using the Block "master read block" should the user first use the "master write block", to make possible the read operation? Are every sequence (start and stop sequence) already implemented in those blocks? Any advice or support will be welcome.
Tades

Community Treasure Hunt

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

Start Hunting!

Translated by