cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f401RC USB mass storage host issue?

Nredd.1
Associate III

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

2 REPLIES 2
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Nredd.1
Associate III

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)