Skip to main content
Visitor II
January 26, 2022
Question

STM32f401RC USB mass storage host issue?

  • January 26, 2022
  • 2 replies
  • 710 views

I am using an stm32f401rc microcontroller, peripheral USB mass storage host is not detected, I am generating code as per the USB MSC HOST labs document.

MX_USB_HOST_Process();

switch(Appli_state)

{

case APPLICATION_IDLE:

break;

case APPLICATION_START:

HAL_UART_Transmit(&huart6,"APPLICATION_START\r\n",strlen("APPLICATION_START\r\n"),1000);

if(f_mount(&myUsbFatFS, (TCHAR const*)USBHPath, 0) == FR_OK) 

HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET);

break;

case APPLICATION_READY:

HAL_UART_Transmit(&huart6,"APPLICATION_READY\r\n",strlen("APPLICATION_READY\r\n"),1000);

if(HAL_GPIO_ReadPin(BUTTON_GPIO_Port, BUTTON_Pin) == GPIO_PIN_SET)

if(UsbTest_Write()) 

HAL_GPIO_WritePin(LED4_GPIO_Port, LED4_Pin, GPIO_PIN_SET);

else 

HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);

HAL_Delay(1000);

break;

case APPLICATION_DISCONNECT:

HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET);

break;

}

the application starts but the application-ready message have not occurred.

Regards,

naren

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    January 26, 2022

    Hello @Nredd.1​ ,

    Try to increase heap and stack sizes in the CubeMx setting.

    Maybe you should check the pins configuration, check if  D+/D- are not swapped !

    When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

    Imen

    Nredd.1Author
    Visitor II
    January 27, 2022

    Thanks,

    It is working with external CLK settings,

    the USB hid device's barcode scanner is working fine, but some hid devices is not working(keyboard and mouse)