필터 지우기
필터 지우기

Code generation for stm32f4 discovery results in an empty main.c

조회 수: 4 (최근 30일)
Alexander Babin
Alexander Babin 2020년 11월 21일
댓글: Peeyush Kumar 2020년 12월 2일
Hello to everyone,
I am trying to connect my stm32f4 discovery board to simulink to generate code and run in on the board via IAR EWARM.
The model is built without any errors, but when the project is opened in IAR, it shows the main.c function, where there is nothing but initialization of this and that. I will now show the steps that i make:
1) create a project in stm32mx cube for the given MCU, lets say i want a LED on pin PD15 to turn on when the button on pin A0 is pressed, so i configure the corresponding pins and create an .ioc file config.ioc. Then i create a project in some folder and close the stm32mx cube.
2) in matlab i create a folder, where i create a simulink model leds.slx
3) in the model parameters i configure Code Generation for the target file stm32.tlc, solver for fixed-point solver with 0.001 step, stm32 project options - i refresh cube path, click apply
4) this is the model i build:
very simple
5) in the mcu config i choose the config.ioc
6) build the model
7) open the project folder, in the EWARM folder there is the project file, open it with IAR:
8) make the project, no errors, no warnings
9) press download and debug:
the main.c file contains no info on system operation, some initiation and empty infinite loop.
If anyone has any ideas on how to resolve this issue, please, do share!
Best regads, Alex
  댓글 수: 1
Peeyush Kumar
Peeyush Kumar 2020년 12월 2일
Hi Alexander,
The above workflow is officially supported by ST Microelectronics, please refer to the follwoing link for more information:

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by