cancel
Showing results for 
Search instead for 
Did you mean: 

STM32_MAT_Target External mode error

Reza Hosseinzadeh
Associate II
Posted on July 26, 2017 at 19:34

Hello,

I am trying to use the Simulink external mode according to the hands on for stm_32_mat_target.

During the process I got two errors when I click build in Simulink and after selecting serial port and usart pins, there is an error as :

The IPs still have some not configured or wrong parameter values: [USART2]

Do you still want to generate code?

I tried with USART2 without configuring USART in cube mx and also with USART1 and 3 to use a USB to UART bridge and then configured the USART connection in cube mx but still getting the same error before generating the code.

And if I continue generating the code when I try connecting to the target in Simulink I m getting the following error:

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.

Caused by:

Expected 1xN string array for host name

I am using Matlab2016b,

I tried with cube_mx 4.21.0 and 4.22.0

Using both Keil u5.23 and IAR embedded workbench 8.11.2.13606

#simulink #stm32-mat/target-matlab #stm32f334 #usart
4 REPLIES 4
Reza Hosseinzadeh
Associate II
Posted on July 27, 2017 at 11:17

By the way I am using Stm32F334c8Tx on a discovery board, the board number is MB1142B, so since for using VCP(Virtual COM Port) SB14 and 16 is not ON in this board I soldered the bridge. This info I found in UM1735 User manual:

USART configuration

The USART2 interface available on PB3 and PB4 of the STM32F334C8T6 can be connected to ST-LINK/V2-1 MCU to use the virtual COM port function. By default the USART2 communication between the target STM32F334C8T6 and ST-LINK/V2-1 MCU is not enabled. To use the virtual COM port function with The on-board STM32F334C8T6, then set SB14 and SB16 ON.

Amel NASRI
ST Employee
Posted on August 02, 2017 at 18:07

Hi

Hosseinzadeh.Reza

‌,

Please note that your case is reported internally for further check, we will keep you updated.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on September 22, 2017 at 10:22

Hi Amel,

I also found this problem with STM32F303 Nucleo board. the problem is 

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.

Caused by:

Expected 1xN string array for host name
Sam Q.
Associate III
Posted on November 15, 2017 at 12:57

Hi! Have you already troubleshoot your error while using external mode?