cancel
Showing results for 
Search instead for 
Did you mean: 

STemWin + USB Host MSC + stm32h7

feelingoflight
Associate III

Hello.

I try to make application with USB FS (host msc) and emwin on board stm32h743i-eval.

When i connect USB, enumeration doesn't happen. Function USBH_Get_DevDesc always return USBH_BUSY, and usb stay in state ENUM_IDLE.

But if i comment function GUI_Init enumeration is ok and i can see some usb descriptors in my uart terminal. Something happening in GUI_Init, that prevents usb.

Another strange thing is that i also have USB (HS) Host camera device (UVC class), and it works fine with GUI_Init or without it.

So, this code works well:

SystemClock_Config();

__HAL_RCC_CRC_CLK_ENABLE();

//GUI_Init();

USBH_Init(&usb_storage_handle, usb_storage_process, USB_STORAGE_ID);

USBH_RegisterClass(&usb_storage_handle, USBH_MSC_CLASS);

USBH_Start(&usb_storage_handle);

while (1) {

USBH_Process(&usb_storage_handle);

}

But when i change

//GUI_Init();

on

GUI_Init();

USB dont work.

Help me please. Thanks

3 REPLIES 3
AJabl.1
Associate

Hi,

Have you been able to solve it?! 

I have the same problem on STM32F469 + FreeTROS + STemWIN + USB device :(

Best regards Adam

Artem.Moroz
Associate II

Hi!

The USB host is very resource heavy on STM devices. I was able to run 1xUSB host + STemWin + FreeRTOS on STM32F746 board with more-or-less stable operation, but the same board simply does not draw out 2xUSB hosts + STemWin + FreeRTOS, choking with interrupt flood.

Maybe you could try some debugging? Could this be a problem with too heavy drawing task for Stemwin?

AJabl.1
Associate

Hello everyone!

I found a solution to the problem.

The GUI_Init() function calls the functions: LCD_X_Config() from file: LCDConf.c.

I copied the above mentioned file from the demo. 

In this file was changing clock settings. After blocking this part of the code everything started :)

See bellow:

 /* LCD clock configuration */

 /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */

 /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 384 Mhz */

 /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 384 MHz / 5 = 76.8 MHz */

 /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_4 = 76.8 MHz / 2 = 38.4 MHz */

/*

 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;

 PeriphClkInitStruct.PLLSAI.PLLSAIN = 384;

 PeriphClkInitStruct.PLLSAI.PLLSAIR = 5;

 PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_4;

 HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); 

*/

Sometimes the simplest mistakes are the hardest to find! :face_with_tears_of_joy:

Best Regards to All