AnsweredAssumed Answered

LED blinking using Simulink and STM32-MAT/TARGET

Question asked by XJ Q on Nov 6, 2017
Hello all,
In my test project I want to use the STM32F4 Discovery Board (MCU: STM32F407VGTx) to realize the following simple functions with the help of Simulink and STM32-MAT/TARGET:
1) Making three user LEDs (PD12, PD13 and PD14 ) blink one by one, whereby each LED blinks 1 second.
2) Using the user button (PA0) to toggle LED PD15.
I made the following configurations for my project:
1) STM32CubeMX: I only changed the input mode of PA0 from GPIO_ETI0 to GPIO_Input. Other configurations stay as default.
2) Simulink: 
   a) Type of Solver: Fixed-step
   b) Solver: auto
   c) Fixed-step size(fundamental sample time): auto
3) Keil: Nothing changed
Simulink models *.slx in three different versions and the MCU configuration file *.ioc are availible in the attachment. You can check them for more details and use them to establish a new project again.
According to the simulation result below, the self-designed "Counter" counts up from 0 to 2 and then goes back to its initial value 0 at the end of the period. Therefor, three LEDs will be toggled one by one by using this counter.
However, after downloading the programm to the board, things are different from what they must be! These three LEDs are blinking too quickly as if they were always ON!
Is there anyone who can help me?
Thanks a lot!

Outcomes