Programming fails?
Hi,
The code seems ok, but did you added a LED on PD2 port (also you can check with an oscilloscope) ?
From factory Nucleo F401RE board has an green LED on PA5 (see UM1724 pag 57 - http://www.st.com/web/en/resource/technical/document/user_manual/DM00105823.pdf and attached screenshot).
This code works for me on F401RE:
/* -3- Toggle PA05 IO in an infinite loop */
while (1)
{
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
/* Insert delay - ms */
HAL_Delay(500);
}
If you don’t have output on LD2 with above code, check if the board is correctly powered.