STM32 HAL PlatformIO LED blink example
In the autogenerated main.c
, use the following while()
loop:
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_GPIO_WritePin(LD1_GPIO_Port, LD1_Pin, GPIO_PIN_SET);
HAL_Delay(1000);
HAL_GPIO_WritePin(LD1_GPIO_Port, LD1_Pin, GPIO_PIN_RESET);
HAL_Delay(1000);
}
/* USER CODE END 3 */
On STM32H7 Nucleo boards, this will toggle the green LED.