2025-01-22 07:28 PM
Hi I am using the STM32F7 MCU to use a usb. I can get the USB connected however, when I try to run debug, the application hard faults, and I can't trace the error. I was hoping to get a reference to a tutorial from STM regarding reading/writing to USB. I have the pinout configuration correct. I am using USB_OTG_FS Host Only, Mass Storage Host Class. In FATFS I adjusted the parameters USE_LFN to be enabled with static working buffer on the BSS, I disabled FS_REENTRANT.
2025-01-22 10:10 PM
You should have a look on the USB_MSC or Ux_Device_MSC examples if your goal is to make the MCU to be detected as a mass storage device when you connect it through USB to a HOST PC.
Greetings
2025-01-23 01:34 AM
Hello @Priyank ,
We recommend trying the USB application for the STM32F7 MCU available on our GitHub. For example, the USB_Host/MSC_Standalone example demonstrates how to use the STM32F7xx USB OTG Host to operate with a USB flash drive using Bulk Only Transfer (BOT) and SCSI commands, combined with the FatFs file system.
This example should help resolve your issue.
Regards,
2025-01-23 01:56 PM
Hi I think I may have misworded my situation. When a USB is connected to the MCU, the mcu can read/write whatever is on the USB, most examples online just use Mass Storage class and use the device as a host. Is this incorrect? I got the hard fault to stop, I increased the USBH_PROCESS_STACK_SIZE to 1024, but now when the usb is connected it hits the HOST USER CONNECTION, then goes straight to HOST_USER_UNRECOVERED_ERROR. And keeps looping.