ST Nucleo detection error Simulink

조회 수: 26(최근 30일)
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 ( ), 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
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.

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


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:
rehash toolboxcache
3. Restart MATLAB.
  댓글 수: 1
Qu Cao
Qu Cao 2017년 7월 26일

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

Kars 2017년 11월 6일
Little bit late, but the update from the hardware support package (16.2.3) did solve it :)
  댓글 수: 2
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
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: 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.

Community Treasure Hunt

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

Start Hunting!

Translated by