2022-08-17 12:08 AM
I'm using STM32H747I-DISCO board to test. I connected OTG adapter and USB disk to CN1 (OTG HS) port.
In my STM32CubeIDE I have USB_OTG_FS enabled and configured.
The software initialized the driver (successfully), then I try to mount my USB disk and I get FR_DISK_ERR.
I checked in the documentation, that the LD7 should indicate the VBUS voltage presence. The LED is off, so I guess I don't have VBUS voltage.
Why is that?
Is this related to the USB_HOST settings?
Especially I'm interested in Drive_BUS_FS pin. I found nothing in documentation on what pin I should connect it to. I just selected a random free pin and configured it as GPIO output. But it does not help. The LD7 is still off, my USB disk is not mounted.
What am I doing wrong here?
Solved! Go to Solution.
2022-08-17 02:43 AM
OK, I figured it out, I configured USB_OTG_HS.
Here:
Unfortunately - still doesn't work. LD7 is on, so I have VBUS, but f_mount() still returns FR_DISK_ERR. Also - when started normally the application hangs. Black screen. When I wanted to check what function fails in main (added a breakpoint on main()) - it runs, everything except USB disk works. So - there's still something wrong, but I have no idea what. I tried to disable DMA - didn't help.
2022-08-17 02:20 AM
Hello,
>> I connected OTG adapter and USB disk to CN1 (OTG HS) port.
On that board, the CN1 is connected to the STM32 USB_OTG_HS hardware block thanks to the U4-USB332C (ULPI interface), and not to the STM32 USB_OTG_FS hardware block.
So in STM32CubeIDE, you'll probably want to configure USB_OTG_HS instead of USB_OTG_FS.
There is af Mass Storage Class with FatFs example in the STM32H7 software package:
STM32Cube_FW_H7_V1.10.0\Projects\STM32H747I-DISCO\Applications\USB_Host
At the time it was created, this example was not generated with STM32CubeIDE but maybe that can help you to see how to do.
2022-08-17 02:43 AM
OK, I figured it out, I configured USB_OTG_HS.
Here:
Unfortunately - still doesn't work. LD7 is on, so I have VBUS, but f_mount() still returns FR_DISK_ERR. Also - when started normally the application hangs. Black screen. When I wanted to check what function fails in main (added a breakpoint on main()) - it runs, everything except USB disk works. So - there's still something wrong, but I have no idea what. I tried to disable DMA - didn't help.