AnsweredAssumed Answered

STM32-MAT/Target Processor-in-the-Loop (PIL). Keil error compiling.

Question asked by Selector on May 29, 2016
Latest reply on Aug 29, 2016 by
I have some problem with my Simulink model when I use her in PIL simulation mode with the STM32F4 Discovery Board via ST-Link debugger (SWD port).

My system configuration:
- Windows 7 Professional x64;
- MatLab R2014a x64;
- Keil uVision v4.73 or v5.16;
- STM32CubeMX v4.15.0 (Firware packege STM32Cube FW_F4 V1.12.0);
- STM-32 MAT/TARGET v4.2.0.

MatLab directory:
C:\Program Files\MATLAB\R2014a

Keil directory:
C:\Program Files (x86)\Keil_v5 or C:\Program Files (x86)\Keil_v473

STM32Cube directory:
C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeMX

STM-32 MAT/TARGET directory:

I create simple Simulink model, build and run project on my STM32F4 Discovery board:

Then I switch on PIL mode and run Simulink model, got a compilation problem:
- PIL mode
- Diagnostic Viewer
- CubeMX
- Keil v4.73

The problem is shown when I compile the project in the rt_main.c file. File rt_main.h is missing. How to correct these errors:
# error Must specify a model name.  Define MODEL=name.

# error Must specify the number of sample times.  Define NUMST=number

#error Separate output and update functions are not supported by rt_main.c. \
You must update rt_main.c to suit your application needs, or select \
the 'Single output/update function' option.