Elektroda.pl
Elektroda.pl
X
Please add exception to AdBlock for elektroda.pl.
If you watch the ads, you support portal and users.

[stm32f4xxx] - [C/keil/simulink] Błędy kompilacji.

Radzio M. 23 Mar 2014 20:12 1623 2
Computer Controls
  • #1
    Radzio M.
    Level 34  
    Witam. Mam zestaw stm32f429zi DISCOVERY. Chciałbym połączyć ten zestaw z simulinkiem. Link do dokumentacji.
    Robię krok po kroku z instrukcji zawartej w paczce i niestety nie udaje mi się zapalić leda ;).
    Log z matlaba :
    Code:
    ### Real-Time Workshop build procedure for method: 'entry
    
    ### Starting build procedure for model: led

    ### Starting Real-Time Workshop build procedure for model: led
    ### Model connectivity is: normal

    ### Create verification block: None

    ### Check Current Directory for building application.
    Warning: 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.
    ### Generating code into build folder: D:\STMicroelectronics\STM32F4xxmatlab\STM32F4xx\led_stm32F4xx
    Warning: The model 'led' does not have continuous states, hence
    Simulink is using the solver 'FixedStepDiscrete' instead of
    solver 'ode3'. You can disable this diagnostic by explicitly
    specifying a discrete solver in the solver tab of the
    Configuration Parameters dialog, or by setting the 'Automatic
    solver parameter selection' diagnostic to 'none' in the
    Diagnostics tab of the Configuration Parameters dialog
    Warning: Removed
    'D:\STMicroelectronics\STM32F4xxmatlab\STM32F4xx\led_stm32F4xx\html'
    from the MATLAB path for this MATLAB session.
       See 'doc path' for more information.
    ### Real-Time Workshop build procedure for method: 'before_tlc
    ### before_tlc

    ### Top model: 'led
    ### Model: 'led
    ### Invoking Target Language Compiler on led.rtw
    ### Using System Target File: D:\STMicroelectronics\STM32F4xxmatlab\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 led.h
    .
    ### Writing source file led.c
    ### Writing header file led_types.h
    .
    ### Writing header file rtwtypes.h
    .
    ### Writing header file led_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 led_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:\STMICR~1\STM32F~1\STM32F~1
     - additional source directories:
     D:\STMICR~1\STM32F~1\STM32F~1\lib\CMSIS\Device\ST\STM32F4xx\Source\Templates
     D:\STMICR~1\STM32F~1\STM32F~1\lib\STM32F4xx_StdPeriph_Driver\src
     D:\STMICR~1\STM32F~1\STM32F~1\src
     D:\STMICR~1\STM32F~1\STM32F~1\lib\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm
     - additional include directories:
     D:\STMICR~1\STM32F~1\STM32F~1\lib\CMSIS\Device\ST\STM32F4xx\Include
     D:\STMICR~1\STM32F~1\STM32F~1\lib\CMSIS\Include
     D:\STMICR~1\STM32F~1\STM32F~1\lib\STM32F4xx_StdPeriph_Driver\inc
     D:\STMICR~1\STM32F~1\STM32F~1\src
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    .
    ### Processing Template Makefile: D:\STMicroelectronics\STM32F4xxmatlab\STM32F4xx\rtw\stm32F4xx.tmf
    ### Wrapping unrecognized make command (angle brackets added)
    ###    <"%MATLAB%\bin\%MATLAB_WIN_VER%\gmake">
    ### in default batch file
    ### led.mk which is generated from D:\STMicroelectronics\STM32F4xxmatlab\STM32F4xx\rtw\stm32F4xx.tmf is up to date
    ### Building led: .\led.bat
     
    D:\STMicroelectronics\STM32F4xxmatlab\STM32F4xx\led_stm32F4xx>set MATLAB=E:\Program Files\MATLAB\R2013b 
     
    D:\STMicroelectronics\STM32F4xxmatlab\STM32F4xx\led_stm32F4xx>"E:\Program Files\MATLAB\R2013b\bin\win64\gmake" -f led.mk  GENERATE_ASAP2=0 STM32TARGET="STM32F4xxx" TOOLPATHFROMREGISTRY=1 DONGLE="STLinkV2" COMPILERSETTINGS="--cpu Cortex-M4.fp -c -g -O0 -DARM_MATH_CM4 -DSTM32F4XX -DUSE_STDPERIPH_DRIVER --apcs=interwork --split_sections --c99" LINKERSETTINGS="--cpu Cortex-M4.fp --map --list=$(MODEL)_KEIL_$(BOOT_MODE).map --scatter $(LDDIR)\$(STM32TARGET).sct --scanlib " ASSEMBLERSETTINGS="--via $(LDDIR)\asm.cmd" DOWNLOADAPPLICATION=0 SIMULATION_MODE_RP="NO_PIL" TARGET_SRCS="system_stm32f4xx.c misc.c stm32f4xx_adc.c stm32f4xx_dma.c stm32f4xx_exti.c stm32f4xx_gpio.c stm32f4xx_rcc.c stm32f4xx_syscfg.c stm32f4xx_tim.c stm32f4xx_usart.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:\STMICR~1\STM32F~1\STM32F~1"\lib\CMSIS\Device\ST\STM32F4xx\Source\Templates\arm
    ### Start compile .c source main.c
    "main.c", line 41: Error:  #20: identifier "RT_MODEL_led" is undefined
      extern RT_MODEL_led *const led_M;
             ^
    "main.c", line 72: Error:  #132: expression must have pointer-to-struct-or-union type
          rtmSetErrorStatus(led_M, "Overrun");
          ^
    main.c: 0 warnings, 2 errors
    gmake: *** [main.o] Error 1
    ### Real-Time Workshop build procedure for method: 'error
    ### Real-Time Workshop build procedure for model: 'led' aborted due to an error.
    >>
  • Computer Controls
  • #2
    mickpr
    Level 39  
    Radzio M. wrote:
    "main.c", line 41: Error: #20: identifier "RT_MODEL_led" is undefined
    Radzio M. wrote:
    "main.c", line 72: Error: #132: expression must have pointer-to-struct-or-union type
    rtmSetErrorStatus(led_M, "Overrun");

    Czego jeszcze nie wiesz?
    Masz błąd - zajrzyj w kod, sprawdź - czego brakuje.
  • #3
    Radzio M.
    Level 34  
    Czekałem na taką odpowiedź ;) Może ktoś już próbował połączyć simulinka z stm32f4? Jakie polecacie środowisko bo do wyboru są 3 (szkoda, że ograniczane)?