2025-07-17 9:16 AM - last edited on 2025-07-17 9:50 AM by Andrew Neil
I create A project for STM32F411 Discovery board with STM32CubeIDE 1.19.0
and coding :
while (1)
{
/* USER CODE END WHILE */
MX_USB_HOST_Process();
HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
HAL_Delay(500);
/* USER CODE BEGIN 3 */
}
and don't set anything else.
(I saw that the connection settings for the leds were automatically created when Creating project)
i Build and Run code sucessfully but i dont see led Blink. Thanks
Edited to apply source code formatting - please see How to insert source code for future reference.
2025-07-17 9:34 AM
Run in debug mode to see if it's stepping through your code or hanging somewhere, particularly in MX_USB_HOST_Process.
2025-07-17 9:37 AM
Hello @studentof ,
Please follow the steps in this tutorial: STM32StepByStep:Step2 Blink LED - stm32mcu
2025-07-17 10:22 AM
I see that my code hanging at SystemClock_Config(); So i changed the settings according to the images below
But the same issue still occurred
2025-07-17 10:28 AM
@studentof wrote:I see that my code hanging at SystemClock_Config(); So i changed the settings according to the images below
So you've configured it to use an external crystal.
Does your Discovery board actually have an external crystal?
2025-07-17 10:29 AM
in tutorial: STM32StepByStep:Step2 Blink LED - stm32mcu
There is a error when i follow the directions:
2025-07-17 10:36 AM
in user manual Discovery kit with STM32F411VE MCU i see:
so i think my board have an external crystal
2025-07-17 12:14 PM - edited 2025-07-17 12:23 PM
Did you start with a new Board project?
If you do, you have the option for STM32CubeIDE to configure the peripherals for you, including the clock.
If you ever mess up the clock configuration, you can always get STM32CubeIDE to resolve the clock issue to a working state. Then you can custom configure the peripherals clocks again.
2025-07-17 12:47 PM
- In the previous response, I meant that I couldn’t select HSI because the IDE said: "PLL mux should have HSE as input."
- I found other posts related to the problem, and I realized that I only needed to disable USB_OTG_FS. After that, I successfully blinked the LED regardless of using HSE or HSI.
But in the future, if I need to use USB_OTG_FS, what should I do? What exactly caused the issue?