2026-05-12 2:45 AM - edited 2026-05-12 2:47 AM
Hello Everyone,
I am working on a custom USB bootloader project on STM32H743 using:
My bootloader detects USB pendrive successfully and I can see:
But the system gets stuck / deadlocked when calling:
DIR dir;
if(f_opendir(&dir, "0:/") != FR_OK)
{
return UPDATE_NONE;
}The MCU hangs inside f_opendir() and never returns.
Current flow:
MX_USB_HOST_Init();
while(1)
{
MX_USB_HOST_Process();
if(Appli_state == APPLICATION_READY)
{
HAL_Delay(500);
update_flags = ver_check();
break;
}
}Inside ver_check():
if(f_mount(&USB_FatFs, USBHPath, 0) != FR_OK)
{
return UPDATE_NONE;
}
if(f_opendir(&dir, USBHPath) != FR_OK)
{
return UPDATE_NONE;
}Additional Information:
Has anyone faced f_opendir() blocking forever on H7?
Any guidance would be greatly appreciated.
Thank you.
2026-05-13 11:22 AM
Do you reproduce using firmware example? Here is an example implementing f_opendir, can you try to compare with the implementation provided?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.