2016-05-29 12:33 PM
Hi,
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:
C:\MATLAB\STM32-MAT
I create simple Simulink model, build and run project on my STM32F4 Discovery board:
1.
https://drive.google.com/open?id=0B1LzDTmWWv9YdlMxNzhCT0o0TFE
2.
https://drive.google.com/open?id=0B1LzDTmWWv9YN3ZSQmNLR2tPbTA
3.
https://drive.google.com/open?id=0B1LzDTmWWv9YRjBqbzdDR3pKNHM
Then I switch on PIL mode and run Simulink model, got a compilation problem:
- PIL mode
https://drive.google.com/open?id=0B1LzDTmWWv9YeHg5dkhFR08zelk
- Diagnostic Viewer
https://drive.google.com/open?id=0B1LzDTmWWv9YQ0ZUWVlGOWVYdEU
https://drive.google.com/open?id=0B1LzDTmWWv9YVXRLMEZWMWlCNzA
https://drive.google.com/open?id=0B1LzDTmWWv9YZGFUMjZ5cHhrNDQ
https://drive.google.com/open?id=0B1LzDTmWWv9YdWpRQ1picmdmaU0
- CubeMX
https://drive.google.com/open?id=0B1LzDTmWWv9YRmF0ak1ZV1Fmb2M
- Keil v4.73
https://drive.google.com/open?id=0B1LzDTmWWv9YQlRXZUJXNzhzZzg
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
&sharperror 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.
Thanks.
#stm32-mat/target #matlab2016-06-02 07:28 AM
Hello,
can you please verify model configuration parameters. open configuration parameters window code generation>System target file You must select stm32.tlc (click browse and select stm32.tlc) Set STM32 parameters and click ok. You should not have rt_main.c generated file but main.c Best regards Pascal2016-06-02 02:38 PM
Hi,
I was doing these steps. - First of all, I opend MatLab and joint the working directory of my project (�?¡:\test). - Then, I create a new Simulink-file in this directory (�?¡:\test\test.slx). - I open STM32Cube and create new .io file for STM32F407VG, then I generated project for Keil v4 (�?¡:\test\test\test.io, �?¡:\test\test\Drivers, �?¡:\test\test\Inc, �?¡:\test\test\MDK-ARM, �?¡:\test\test\Src, �?¡:\test\test\test). - In my Simulink model (test.slx) I configure Code Generation parameters: select stm32.tcl file in the Cedo Generation->System target file - Set STM32 options (Download Application, STM32Cube path update), then click apply button. - Switched simulink model in PIL mode - Add to the model STM32_Config block - In this block I chose my test.io file - Then I add GPIO_Write block, Pulse Generation block - Connect my STM32 Discovery board to PC across SWD debugger and USB to UART converter. - Click to Run button in Simulink model window - Follow step-by-step on-screen instructions - Reconfigure STM32Cube project - Generate new Keil v4 project - In the Keil v4.73 I open last generation project and get again the problems described above. In the latest Keil project has both a main.c file and rt_main.c file. Keil can'n compile rt_main.c file.2016-06-03 02:24 AM
2016-06-03 03:25 AM
Thank you for your response.
2016-08-28 07:19 PM
have
,