2022-10-06 06:25 AM
I'm now trying to blink a LED on my STM32MP157-DK2 board.
I have managed to run and even modify the GPIO_EXTI example, but I'd like to do this from scratch.
1) I first created a project using CubeMX and wrote my code in the IDE.
It seems that I can't use the BSP_LED_*** instructions as the build gives compilation errors : why can't I build my code when using these instructions ? Do I miss an include ?
2) Then I tried to use the HAL_GPIO_*** instructions. This time, the build is successful, but the debug does not blink the LED.
I have seen in the manual UM2367 that the blue LED is connected to PD11, so I try this:
HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_11);
HAL_Delay (100); /* Insert delay 100 ms */
but it doesn't blink. What did I miss?
Thanks for your help.
Solved! Go to Solution.
2022-10-07 07:00 AM
I finally got it work. I declared the GPIO as GPIO_Output and reserved to M4
2022-10-07 07:00 AM
I finally got it work. I declared the GPIO as GPIO_Output and reserved to M4
2022-10-10 01:03 AM
how did you do it? Did you set the GPIO pin manually? I am having some problems configuring GPIO the pins.
Thank you!
2022-10-10 03:04 AM
Yes, I set the pins manually in CubeMX. I set the PD11 as Output (left click) and reserved it to M4 (right click). Maybe this is specific for the STM32MP1 which has 2 cores.
Then the generated code enables to use HAL_GPIO_*** instructions on that specific output
2022-10-10 06:55 AM
I forgot to reserve it to M4. Thank you! ;)