2017-10-13 12:30 PM
USBH_UserProcess (USBH_HandleTypeDef *phost, uint8_t id) function never called
I'm using Cube MX 4.22.1.
STM32CubeF4 Firmware Package V1.16.0.
Stm32F4Discovery board.
Cube settings:
Peripherals-
USB_OTG_FS -> Host_Only
RCC -> HSE -> Crystal/Ceramic Resonator
MiddleWares-
FATFS -> USB Disk
USB_HOST -> Mass Storage Host Class
Clk Config to HSE and HCLK to 168MHz
All settings default.
I build project and flash the board. All generated code without changing.
USBH_UserProcess() function never called. I connect and disconnect the flash drive to user USB. Nothing happens.
Trying to generate code for Keil UVision v4 and v 5. Same results.
When I'm doing same things with older Cube MX version all works.
Example from Firmware Repository FatFs_USBDisk works without problem.
Looks like problem in generated code by MX Cube.
But I can't find where.
(I'm trying to increase stack and heap size - without results)
#msc #usbh_userprocess #stm32f4discovery2018-04-05 02:43 AM
Same problem. Any WA?
The difference only in the usbh.conf file:
USBH_StatusTypeDef USBH_LL_DriverVBUS(USBH_HandleTypeDef *phost, uint8_t state)
{ if(state == 0) { HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, GPIO_PIN_SET); } else { HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, GPIO_PIN_RESET); } HAL_Delay(200); return USBH_OK; }On
Stm32F4Discovery board
PC0 is used to power USB devices.