Skip to main content
Senior
May 7, 2024
Solved

USB configuration

  • May 7, 2024
  • 3 replies
  • 1016 views

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. 

This topic has been closed for replies.
Best answer by FBL

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!

3 replies

ST Technical Moderator
May 8, 2024

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 "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
GauravKAuthor
Senior
May 8, 2024

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.

FBLBest answer
ST Technical Moderator
May 9, 2024

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 "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL