cancel
Showing results for 
Search instead for 
Did you mean: 

STemwin stucks when creating GUI driver

Ala
Senior

hey there

I have a stm32H743iit6 which I wish to run emwin on it. I also have a 50pin LCD which runs on LTDC. after configuring pins and clock and also SDRAM, I notice that when it comes to LCD_X_Config() and so the function

GUI_DEVICE_CreateAndLink(), the program stucks and doesn't work. I've tested and tried both linear and flexcolor GUI driver but no good. any ideas why it gets stuck in this function?

3 REPLIES 3
Imen.D
ST Employee

Hello @Ala​ and welcome to the Community 🙂

GUI_Init must be called before any STemWin function is used.

The clock for CRC module must be enabled before calling GUI_Init, if not STemWin will be not function.

This is mentioned in the AN4323 to call GUI_Init function prior to use any STemWin function or GUI routines:

"To initialize the STemWin internal data structures and variables, GUI_Init() should be used. Note that before initializing the GUI, the CRC module (in RCC peripheral clock enable register) should be enabled."

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Dear @Imen DAHMEN​ 

I have already configured CRC and also I've used GUI_Init() before calling stemwin functions

it is true that calling GUI_Init() should be before, as GUI_Init() calls these functions itself. first it calls GUI_X_Config()

then LCD_X_Config()

and at last, LCD_DisplayDriver()

inside LCD_X_Config() there is a function called GUI_DEVICE_CreateAndLink() which is responsible for creating a LCD driver to connect MCU to LCD. when I trace my program in debugging mode, I realize that my code stops here and doesn't go further(it stucks in Hard_fault() while(1))

any ideas why this happens? any experience? thanks everyone in advance your ideas help through alot🙇

Imen.D
ST Employee

Hi @Ala​ ,

There are some configuration routines which need to be modified in order for the system to work properly.

Please make sure that the following items are correctly configured:

  • Display driver to be used for drawing operations
  • Color conversion routines to be used
  • Display controller initialization
  • Hardware acceleration
  • Hardware JPEG decoding
  • Memory area to be used by emWin, and try increase the size of the memory for emWin assigned in GUI_X_Config() function

More details can be found in the chapter "Configuration" in the emWin user manual.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen