cancel
Showing results for 
Search instead for 
Did you mean: 

STM32_MAT/Target Error

Lixin Tang
Associate
Posted on April 19, 2017 at 20:54

Greetings

I tried for 2.5 days to build a Matlab/Simulink (matlab 2017a) model and use ST_MAT_Library(4.4.1) to generate code. But it didn't work. I setup the system target file as 'stm32.tlc', and I added the path of stm32_mat_target in my matlab path. 

I used STM32Cubemx (4.20) and Keil (MDK-ARM V5, the free trial version). 

What should I do? 

Thank you

Lixin

Here are the error information:

------------------------------------------------------------------------------------------------

Build 4 1 1 Clear

02:29 PM Elapsed: 6 sec

♯♯♯ Real-Time Workshop build procedure for method: 'entry

♯♯♯ modelName: 'model_for_test_h

♯♯♯ gcs: 'model_for_test_h

♯♯♯ bdroot: 'model_for_test_h

♯♯♯ Starting Real-Time Workshop build procedure for model: model_for_test_h

♯♯♯ Windows version:win64

♯♯♯ Model connectivity is: external

♯♯♯ Create verification block: None (External mode)

♯♯♯ External mode parameters: 0,1,115200,10

Code Generation 2 1

Elapsed: 3 sec

♯♯♯ Generating code into build folder: C:\ST\open loop stm32f100c6t6\model_for_test_h_stm32

Source 'model_for_test_h/GPIO_Read' specifies that its sample time (-1) is back-inherited. You should explicitly specify the sample time of sources. You can disable this diagnostic by setting the 'Source block specifies -1 sample time' diagnostic to 'none' in the Sample Time group on the Diagnostics pane of the Configuration Parameters dialog box.

Component:Simulink | Category:Block warning

----------->STM32 MCU:stm32f4

♯♯♯ Real-Time Workshop build procedure for method: 'before_tlc

♯♯♯ modelName: 'model_for_test_h

♯♯♯ gcs: 'model_for_test_h

♯♯♯ bdroot: 'model_for_test_h

♯♯♯ before_tlc

♯♯♯ Invoking Target Language Compiler on model_for_test_h.rtw

♯♯♯ Using System Target File: C:\Matlab\STM32\rtw\stm32.tlc

♯♯♯ Loading TLC function libraries

♯♯♯ Initial pass through model to cache user defined code

Warning: '---------->STM32_Config: MCU_Name is stm32f4'

.

♯♯♯ Caching model source code

Warning: simMode value is 2.0 0:RTW 1:PIL 2:EXT

Warning: Create external mode application main.c

Error: File: C:\ST\open loop stm32f100c6t6\model_for_test_h_stm32\tlc\customRoutineProcess.tlc Line: 179 Column: 27

Attempt to call a non-function value: SLibModelInitFcnName

Main program:

==> [00] C:\ST\open loop stm32f100c6t6\model_for_test_h_stm32\tlc\customRoutineProcess.tlc:<NONE>(179)

[01] C:\MATLAB_R2017a\rtw\c\tlc\mw\formatwide.tlc:<NONE>(483)

Error: File: C:\ST\open loop stm32f100c6t6\model_for_test_h_stm32\tlc\customRoutineProcess.tlc Line: 179 Column: 47

Values of NULL type cannot be expanded

Main program:

==> [00] C:\ST\open loop stm32f100c6t6\model_for_test_h_stm32\tlc\customRoutineProcess.tlc:<NONE>(179)

[01] C:\MATLAB_R2017a\rtw\c\tlc\mw\formatwide.tlc:<NONE>(483)

.

♯♯♯ Writing header file model_for_test_h.h

♯♯♯ Writing source file model_for_test_h.c

.

♯♯♯ Writing header file STM32_Config.h

♯♯♯ Writing header file model_for_test_h_types.h

♯♯♯ Writing header file rtwtypes.h

♯♯♯ Writing header file multiword_types.h

♯♯♯ Writing header file model_for_test_h_private.h

♯♯♯ Writing source file main.c

.

♯♯♯ TLC code generation complete.

♯♯♯ Generating TLC interface API.

♯♯♯ Creating data type transition file model_for_test_h_dt.h

.♯♯♯ Real-Time Workshop build procedure for method: 'error

♯♯♯ modelName: 'model_for_test_h

♯♯♯ gcs: 'model_for_test_h

♯♯♯ bdroot: 'model_for_test_h

♯♯♯ Real-Time Workshop build procedure for model: 'model_for_test_h' aborted due to an error.

Error: Errors occurred - aborting

Component:Simulink | Category:Block diagram error

#stm32-mat/target-matlab
1 ACCEPTED SOLUTION

Accepted Solutions
Lixin Tang
Associate
Posted on April 20, 2017 at 15:12

I solved this problem by switching to Matlab 2016B from Matlab 2017A. Thanks.

View solution in original post

2 REPLIES 2
abdou si
Associate III
Posted on April 20, 2017 at 01:23

can you attache an image of your Simulink project

Lixin Tang
Associate
Posted on April 20, 2017 at 15:12

I solved this problem by switching to Matlab 2016B from Matlab 2017A. Thanks.