Skip to main content
Rogers.Gary
Senior II
February 28, 2019
Question

Setting up USB storage with HAL/CubeMX

  • February 28, 2019
  • 3 replies
  • 1011 views

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

This topic has been closed for replies.

3 replies

Rogers.Gary
Senior II
March 1, 2019

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
March 1, 2019

No one in the community can help with this?

ST Technical Moderator
March 5, 2019

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks