cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to connect to the target on simulink !!

Abdelhak GOUDJIL
Associate II
Posted on March 12, 2018 at 17:10

Hi --

I use 2016b Matlab version with STM32F429ZI nucleo board.

I am tring to use External mode with simulink,

I followed

the example and the instructions decribed in ''the MAT/TARGET instruction (Hands On, Rev 2.2, Page 86-105). I follow all procedure mentioned on MAT-Target PDF, but when I begin connecting my model to the target this error message occurred (Picture below):

''Error occurred while executing External Mode MEX-file 'ext_comm': Failed to connect to the target. Possible reasons for the failure: 

 

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.

Any help for solving this issue please ?

0690X0000060A4vQAE.png

#stm32-mat/target-matlab #simulink
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on March 13, 2018 at 04:48

Hi, Abdelhak

  1. You must try change selection to stm32_tcpip and change again back to stm32_serial for make sure that MEX-file name is ext_serial_win32_comm.
  2. Check your COM Port at Device Manager before Build model at Simulink.
  3. STM32F429ZI use USART3 for external mode
  4. After you build and download your code to target please make sure that your target is running before click Connect to Target at Simulink.

(1.)

0690X0000060A6IQAU.png0690X0000060A3eQAE.png

(2.)

0690X0000060A6YQAU.png

(3.)

0690X0000060A6cQAE.png

View solution in original post

4 REPLIES 4
Andrew Neil
Evangelist
Posted on March 12, 2018 at 17:50

https://community.st.com/0D50X00009XkX71SAF

Posted on March 12, 2018 at 18:07

Thanks for your response

But i don't understant how to  use USB Serial Port ?  Instead STMicroelectronics STLink Virtual COM Port !!!! ?

 

 

Any help please ?
Posted on March 13, 2018 at 04:48

Hi, Abdelhak

  1. You must try change selection to stm32_tcpip and change again back to stm32_serial for make sure that MEX-file name is ext_serial_win32_comm.
  2. Check your COM Port at Device Manager before Build model at Simulink.
  3. STM32F429ZI use USART3 for external mode
  4. After you build and download your code to target please make sure that your target is running before click Connect to Target at Simulink.

(1.)

0690X0000060A6IQAU.png0690X0000060A3eQAE.png

(2.)

0690X0000060A6YQAU.png

(3.)

0690X0000060A6cQAE.png
Abdelhak GOUDJIL
Associate II
Posted on March 13, 2018 at 16:01

panuwat.s

All it's ok now, thank you very much.