cancel
Showing results for 
Search instead for 
Did you mean: 

usbh_userprocess never called

Vasiliy Alekseev
Associate
Posted on October 13, 2017 at 21:30

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 #stm32f4discovery
1 REPLY 1
ss tt
Associate
Posted on April 05, 2018 at 11:43

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.