Code generation for stm32f4 discovery results in an empty main.c
2 次查看(过去 30 天)
显示 更早的评论
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
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!