2020-03-30 05:28 AM
Hi
I would like to read a file on a USB stick. But phost-> gState remains HOST_ABORT_STATE; (usbh_core.c) . The code was generated with STM32CubeMX.
USB_OTG_FS is set to Host_Only. Class for FS IP is set to Mass Storage Host Class in USB_HOST Mode and configuration.
board :
NUCLEO-F413ZH
clock settings :
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLM = 16;
RCC_OscInitStruct.PLL.PLLN = 192;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 4;
RCC_OscInitStruct.PLL.PLLR = 2;
ide:
Keil µVision V5.26.2.0
Thanks in advance
Kind regards
2020-03-30 12:04 PM
Please enable debug prints in the USB library (via CubeMX or manually somewhere in usb...conf.h) and fatfs.
-- pa
2020-03-31 02:04 AM
Hi
Thanks for the tip. Because of this I found out that Keil's debugger is wrong.
With debugging (USB library) enabled I see that the USB stick is recognized.
The debugger stops at phost-> gState = HOST_ABORT_STATE; (usbh_core.c), but this is not executed. In reality, phost-> gState has the value HOST_SET_CONFIGURATION. Which is the correct value.
Kind regards