I am trying to Blink external LED using STM32CubeIDE and Proteus
while (1)
{
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
HAL_Delay(100);
}
[)2
The LED doesn't blink
I am assuming that you have configured the pin to be output correctly with no pull up or pull down resistor. Hence you will need to terminate the LED into the ground instead of 3.3V.
In the event there is no pull up or pull down resistor, the pin is neither high or low, the pin is in a "z-state" hence when you toggle the LED from low to high there is no potential difference between the pin and the LED so no current flows, and when the pin goes from High to low, the diode property (only allows current flow in one direction) of the LED doesn't let current flow into towards the board.
PA1
as a GPIO output pin (can be done in STM32CubeIDE)? – relSystemClock_Config()
andMX_GPIO_Init()
, like at wiki.st.com/stm32mcu/wiki/… – Clifford