cancel
Showing results for 
Search instead for 
Did you mean: 

stm32F769I-Disco with FreeRTOS as MSC USB Host

terter etuet
Associate II
Posted on March 28, 2017 at 12:58

Hello,

i am trying to read/write to an USB-Stick thru the HS USB-Port,

i setted up CubeMX with FREERTOS, USB_HOST HSIP Mass Storage Host Class, enabled FATFS on USB-Disk  and set USB_OTG_HS external Phy Host_Only (beside some other stuff for the LCD).

it compiles und runs, but when i insert a USB-Stick it crashes in the HAL_HCD_IRQHandler(&hhcd_USB_OTG_HS) function...

many thanks for any help

3 REPLIES 3
Amel NASRI
ST Employee
Posted on March 28, 2017 at 18:39

Hi

tostadad.testo

‌,

In the package STM32CubeF7, there are some available examples that should help you to find the exact problem you are facing for a similar use case.

I recommend you have a look to following ones and update them to be used withSTM32F769I-Discovery:

  • STM32Cube_FW_F7_V1.6.0\Projects\STM32F769I_EVAL\Applications\USB_Host\MSC_RTOS
  • STM32Cube_FW_F7_V1.6.0\Projects\STM32746G-Discovery\Applications\USB_Host\MSC_RTOS

-Amel

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.

terter etuet
Associate II
Posted on March 29, 2017 at 10:52

Many Thanks Amel for your suggestion...

i got it running by replacing the CubeMX-generated HAL_HCD_MspInit with the HAL_HCD_MspInit from the SM32F769-DISCO Demo-Application...

but what really puzzles me: what sense makes the CubeMX-Codegenerator if the code is not usable, or the defaults are not compatible with the choosen board? The LCD had the wrong configuration, commenting out HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) helped, and changing HAL_HCD_MspInit was good for the USB....

many thanks for your help

terter

Posted on March 29, 2017 at 11:29

Happy to hear that you have something working now.

To understand more your initial issue, it is important to know what did you selected (the board or the chip) when you started with CubeMX?

You may have some pins configuration conflicts that you need to manage or take into consideration. In all cases, you should  check the User Manual of the board you are using to know more about pins assignment and jumpers positions for example.

-Amel

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.