2021-02-20 12:42 AM
Dear. All
Hi, everyone.
I am a hardware engineer.
I created a very simple logic to create mcu code through simulink, and I succeeded in creating code-build-download.
By the way, I'm trying to find out why it doesn't work because it doesn't work in the logic on the mcu.
Version : Matlab 2019a / STM32CubeIDE 1.5.1
My Test logic is below.
PC0 - GPIO INPUT set (active_low sw ON) -> PA8 - GPIO OUTPUT set (led on)
PC0 - GPIO INPUT set (active_low sw OFF) -> PA8 - GPIO OUTPUT set (led OFF)
Q1) Logic doesn't seem to generate code, is there any way to know?
Q2) When I call GPIO_WRITE from the simulation link, I get this error, what kind of error is it? I don't know if this error is affecting in simulink code generation.
Q3) Is it right to create a code in a simulink, run a ".project", build and download it to CUBEIDE? The file created by SIMULINK is "simulink_test1.c", but is it different from MAIN.C?
Q4) I want to check the variable value in CUBEIDE, but what is the reason why I can't check the value because of this error?
simulink Code Generation is my first time, so I don't know much about it, so please answer me.
2021-05-26 09:08 AM
Hello,
I don't really know about the first two questions, but for the rest you should try to right-click on "simulink_test1", open the "properties" window, and in the C/C++ tab untick the box that says "Exclude ressource from build".
Personally I need to do that after every Simulink code generation and it seems that ypou haven't done that given the look of the icon of the "simulink_test1" folder.