cancel
Showing results for 
Search instead for 
Did you mean: 

USB configuration

GauravK
Senior

Hi, I need to use USB in 2 modes:

1. See SD card files interfaced to controller through computer via USB

2. Transfer SD card files to "data storage device (USB stick)" via USB

Any examples for same? Display menu should handle above operations. 

Since the implementation is new to me what middleware's are needed? 

a. FATFS: SD card

b. FATFS: USB Disk

c. FreeRTOS: is CMSIS needed with FreeRTOS

What USB be configured to:

i. OTG/ dual

ii. Host

iii. Device

Please check and guide. 

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Have you checked examples? In Host mode, there are two examples using RTOS and without RTOS to transfer your files to mass storage device using MSC class

STM32CubeF4/Projects/STM324x9I_EVAL/Applications/USB_Host/MSC_RTOS at master · STMicroelectronics/STM32CubeF4 (github.com) They should be helpful!

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.

View solution in original post

3 REPLIES 3
FBL
ST Employee

Hi @GauravK 

 

First, using the same PHY, you need a hardware configuration supporting USB dual role OTG.

We can provide you with some examples but which STM32 product are you using? Below an example showing how to use SD card with FatFS stack

STM32CubeH7/Projects/STM32H743I-EVAL/Applications/FatFs/FatFs_uSD_Standalone at master · STMicroelectronics/STM32CubeH7 (github.com)

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.

Thanks getting reply from experts does help. 

The eval board is Nucleo-F439ZI. A external HS PHY will be used. Initially I can try with in-built FS OTG dual role.

FBL
ST Employee

Have you checked examples? In Host mode, there are two examples using RTOS and without RTOS to transfer your files to mass storage device using MSC class

STM32CubeF4/Projects/STM324x9I_EVAL/Applications/USB_Host/MSC_RTOS at master · STMicroelectronics/STM32CubeF4 (github.com) They should be helpful!

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.