MX_USB_HOST_Process();
/* USER CODE BEGIN 3 */
//判断USB是否进入准备状态APPLICATION_READY
switch(Appli_state)
{
/**
* The generated code from STM32CubeMX has two "confusing" application states
* APPLICATION_START on HOST_USER_CONNECTION and APPLICATION_READY on HOST_USER_CLASS_ACTIVE.
* Any FatFs commands should be executed after APPLICATION_STATE_READY is reached."
*/
case APPLICATION_READY:
printf("ready ok\n");
MSC_Application();
Appli_state = APPLICATION_IDLE;
break;
case APPLICATION_IDLE:
default:
break;
}
可以连接 但无法进入到 case APPLICATION_READY:
串口打印
USB Device disconnected
USB Device Connected
USB Device Reset Completed
ERROR: Control error: Device not responding
USB Device Connected
USB Device Reset Completed
ERROR: Control error: Device not responding
USB Device Connected
USB Device Reset Completed
ERROR: Control error: Device not responding
USB Device Connected
USB Device Reset Completed
ERROR: Control error: Device not responding
USB Device Connected
USB Device Reset Completed