AnsweredAssumed Answered

Problem with stm32f4 discovery & stm32-mat/target

Question asked by jz.zhao on May 6, 2014
Latest reply on Jun 7, 2014 by Stark
Hi,

I am trying to get my stm32f4 discovery working with the Matlab/Simulink package provided by ST.
I am  using Matlab R2014a V8.3 on Windows 7.
I am using Keil µVision 4.72 as toolchain.
When I am trying the BlinkBlueLed demo and building it , it came as:

 Build 
1
1:20:55 PM 5/6/2014 Elapsed: 6 sec
### Real-Time Workshop build procedure for method: 'entry ### Starting build procedure for model: BlinkBlueLed ### Starting Real-Time Workshop build procedure for model: BlinkBlueLed ### Model connectivity is: normal ### Create verification block: None ### Check Current Directory for building application. [警告: Please change to STM32F4xx\STM32F4xxdemos\CodeGeneration build directory. In any other case there might be confilicts during the build-process towards finding desired files for creating the application.]
 Code Generation 
Elapsed: 5 sec
### Generating code into build folder: D:\Program Files\STMicroelectronics\STM32F4xx-MAT\STM32F4xx\STM32F4xxdemos\Test\BlinkBlueLed_stm32F4xx ### Real-Time Workshop build procedure for method: 'before_tlc ### before_tlc ### Top model: 'BlinkBlueLed ### Model: 'BlinkBlueLed ### Invoking Target Language Compiler on BlinkBlueLed.rtw ### Using System Target File: D:\Program Files\STMicroelectronics\STM32F4xx-MAT\STM32F4xx\rtw\stm32F4xx.tlc ### Loading TLC function libraries ### Initial pass through model to cache user defined code ### Caching model source code Warning: simMode value is 0.0 Warning: Create real-time application main.c ### Writing header file BlinkBlueLed.h ### Writing source file BlinkBlueLed.c ### Writing header file BlinkBlueLed_TimerPortAndPin.h ### Writing header file BlinkBlueLed_types.h ### Writing header file rtwtypes.h ### Writing header file BlinkBlueLed_private.h ### Writing source file main.c ### TLC code generation complete. ### Real-Time Workshop build procedure for method: 'after_tlc ### after_tlc ### Creating HTML report file BlinkBlueLed_codegen_rpt.html ### Real-Time Workshop build procedure for method: 'before_make ### Code Format : Embedded-C Adding source and include directories to make process. STM32F4xx package install path: D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1 - additional source directories: D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1\lib\CMSIS\Device\ST\STM32F4xx\Source\Templates D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1\lib\STM32F4xx_StdPeriph_Driver\src D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1\src D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1\lib\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm - additional include directories: D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1\lib\CMSIS\Device\ST\STM32F4xx\Include D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1\lib\CMSIS\Include D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1\lib\STM32F4xx_StdPeriph_Driver\inc D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1\src ### Processing Template Makefile: D:\Program Files\STMicroelectronics\STM32F4xx-MAT\STM32F4xx\rtw\stm32F4xx.tmf ### Wrapping unrecognized make command (angle brackets added) ### <"%MATLAB%\bin\%MATLAB_WIN_VER%\gmake"> ### in default batch file ### Creating BlinkBlueLed.mk from D:\Program Files\STMicroelectronics\STM32F4xx-MAT\STM32F4xx\rtw\stm32F4xx.tmf ### Building BlinkBlueLed: .\BlinkBlueLed.bat D:\Program Files\STMicroelectronics\STM32F4xx-MAT\STM32F4xx\STM32F4xxdemos\Test\BlinkBlueLed_stm32F4xx>set MATLAB=D:\Program Files\MATLAB\R2014a D:\Program Files\STMicroelectronics\STM32F4xx-MAT\STM32F4xx\STM32F4xxdemos\Test\BlinkBlueLed_stm32F4xx>"D:\Program Files\MATLAB\R2014a\bin\win32\gmake" -f BlinkBlueLed.mk GENERATE_ASAP2=0 STM32TARGET="STM32F4xxx" TOOLPATHFROMREGISTRY=1 DONGLE="STLinkV2" COMPILERSETTINGS="-c --cpu Cortex-M4.fp -g -O3 --apcs=interwork --split_sections $(INCLUDES)" LINKERSETTINGS="--cpu Cortex-M4.fp --map --list=$(MODEL)_KEIL_$(BOOT_MODE).map --scatter $(LDDIR)\$(STM32TARGET).sct --scanlib " ASSEMBLERSETTINGS="--via $(LDDIR)\asm.cmd" DOWNLOADAPPLICATION=1 SIMULATION_MODE_RP="NO_PIL" TARGET_SRCS="system_stm32f4xx.c stm32f4xx_gpio.c stm32f4xx_rcc.c stm32f4xx_flash.c stm32f4xx_pwr.c " SYSTEM_SRCS="stm32f4xx_it.c " STARTUP_SRCS="startup_stm32f4xx.s" ###Makefile for KEIL ###BuildMode : real_time MODELREF_TARGET_TYPE=NONE SIMULATION_MODE_RP=NO_PIL MAKEFILEBUILDER_TGT=0 STANDALONE_SUPPRESS_EXE=0 ###Startup file: startup_stm32f4xx.o ###Startup path: "D:\PROGRA~1\STMICR~1\STM32F~1\STM32F~1"\lib\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm ### Start compile .c source main.c

"main.c", line 76: Error: #20: identifier "TRUE" is undefined OverrunFlags[0] = TRUE; ^

"main.c", line 84: Error: #20: identifier "FALSE" is undefined OverrunFlags[0] = FALSE; ^

main.c: 0 warnings, 2 errors gmake: *** [main.o] Error 1

I think the problem is caused by
 /* Logical type definitions */ 35 #if (!defined(__cplusplus)) 36 #ifndef false 37 #define false (0U) 38 #endif 39  40 #ifndef true 41 #define true (1U) 42 #endif 43 #endif
in file rtwtypes.h , but I can't figure it out.
So is there any configuration I have missing ?
 At the same time ,I've tried a thrid-party demo provided by Waijung14_03a and it works well.
Please help me .

Thanks.

Outcomes