cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up USB storage with HAL/CubeMX

Rogers.Gary
Senior II

Hello:

I have used CubeMX to generate base code for a USB storage device in host mode. The last I see of it in the code is the call in main: "MX_USB_OTG_FS_HCD_Init();"

Now I would like to take the next big step and try to connect, and write/read. Is there an actual example anywhere that I could reference? Looks like my package (IAR EWARM) went out of their way not to include a single example. A search of the web, including this community returned nothing.

Any reference or link would be just great, thank you.

Gary

3 REPLIES 3
Rogers.Gary
Senior II

Hi again,

Is there just no examples on this essential subject? Document? White paper? App note? Sorry, I cannot locate anything. Again: Connecting to, writing and reading a mass storage USB device.

Thanks again.

Rogers.Gary
Senior II

No one in the community can help with this?

Imen.D
ST Employee

Hello @Rogers.Gary​ ,

I suggest you to try the MSC_Standalone example that you can find in the STM32CubeL4 firmware package:

STM32Cube_FW_L4_V1.13.0\Projects\STM32L476G-EVAL\Applications\USB_Device\MSC_Standalone

You can take this working example as start point and make required updates according to your needs, this can help you as an implementation example.

I'd highly recommend you to have a look to the UM1734 User manual STM32Cube™ USB device library about the STM32Cube USB device library.

Kind Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen