Skip to main content
Associate III
October 14, 2025
Question

GUI flickering & fluctuating between screens during eeprom read write.

  • October 14, 2025
  • 3 replies
  • 1370 views

Hello All,

 

I am working on the touchgfx project and have an application where I have created some screens and performing the different operations while button pressed.

I am writing and reading the data content to external EEPROM, eg, some 10-15 parameters while button is pressed and reading it while other button is pressed.

 

Before adding the Eeprom operation My Screens and operations were working fine and fluently, but after adding the code for writing the parameters to eeprom, the screens started to flicker between screens and the GUI is getting distorted. 

This is not normal behavior, Can any one suggest how shall I take care of it or what would be the best way to perform external Eeprom read write operations, without interrupting the GUI ?

 

Regards,

Shi

 

3 replies

MM..1
Chief III
October 14, 2025

Shi Shi, show your code or ideas. And primary in gfx task you cant use any blocking code, same for other tasks not blocking gfx task level...

Shiv09Author
Associate III
October 15, 2025

Hello @MM..1 

Thanks for the quick reply, so the idea is I have to save and load the parameters when the user provides some data, 20-30 bytes of data, when buttons are pressed the data has to be stored in EEPROM, and when other is pressed the Data has to read from EEPROM and then display it. currently I am doing these operations in model, I can susseccfully write and read from EEPROM, but the screens are now fluctuating and flickering. The EEPROM write would require 5 ms delay.

If I have to perform same operations, you are suggesting to use other thread for EEPROM read write is it correct ?

or if there is any better idea then kindly suggest, will try the same.

 

Regards,

Shi

Ozone
Principal
October 15, 2025

> currently I am doing these operations in model, I can susseccfully write and read from EEPROM, but the screens are now fluctuating and flickering.

It is questionable if this (i.e. model behavior) is meaningful in this regard.

> The EEPROM write would require 5 ms delay.

Not exactly, it returns "busy" as long as a write is ongoing, which can take several milliseconds. I suppose 5ms is the average or worst-case number from the datasheet.

If your code busy-waits for that time, you definitely have problems with flickering screens.

Shiv09Author
Associate III
October 17, 2025

Hello @Ozone ,

Yes I am using the freertos task, trying to create one and use it.

Only my question is why the screen gets fluctuating, the buttons and icons which were working earlier fluently, now after adding the write /Read function got messed up.

 

What all things shall I verify and check to make GUI working smooth and fluent ? I mean the settings and initializations for frame and screen.

 

Ozone
Principal
October 20, 2025

Most likely your EEPROM task blocks the Touchgfx screen update during a write and the associated busy period.
I have only very superficial knowledge of Touchgfx, so I can't comment on details. I suppose either via timer-triggered interrupt handler or DMA.

You did not disclose any of the code you are using for EEPROM access, especially write access.
Either check and correct interrupt priorities (I2C versus screen update), or implement the EEPROM write via polling.

Shiv09Author
Associate III
October 22, 2025

Hello @Ozone 

 

Thanks for the suggestion, Yes there was a 5 milli sec delay for write operation which I reduced to 1 milli sec, but still observed the flickering, tried to reduce the clk from 51 mhz to 18.1 mhz the flickering got reduced to better level but not resolved completely. 

I just what to know if there is any better way to solve this problem. if you need i can share the images of function snippets, hope that could help just let me know which files and function you need will share may be that will give better idea.

 

Br,

Shi

jchernus-fikst
Senior
October 17, 2025

Yes, you should have a separation of frontend and backend. The model can communicate with your backend (see https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/backend-communication) 

Shiv09Author
Associate III
October 22, 2025

Hello @jchernus-fikst ,

 

Thanks for the reply, Yes I tried the same way, I am using MVP flow to send and receive data. Model->presenter->view and vise versa. I can see the data been sent and updated on screen.

Though I have been using the Message queue between GUI thread and other UART thread which doesn't cause lot trouble but when only when, Tring to write some data with delay (Changed from 5 millisec to 1 milli sec), still able to see flickering and fluctuations on screen with buttons.

 

Tried to look at other STM32 tickets, if someone have faced this issue, then found one where the clock is reduced for LTDC. I also tried to change the clock of LTDC from 51 mhz to 18.1 mhz, then the intensity of flickering reduced a lot.

Even in my case this worked a better but it didnt resolved the issue completely. 

If there is something more to try just let me know will try whatever is possible to make it stable.

 

Br,

Shi

Ozone
Principal
October 22, 2025

> Though I have been using the Message queue between GUI thread and other UART thread which doesn't cause lot trouble but when only when, Tring to write some data with delay (Changed from 5 millisec to 1 milli sec), still able to see flickering and fluctuations on screen with buttons.

If you do so, especially the delays, from within an interrupt context, you will surely run into exactly such problems.
Mind you, all Cube generated interrupt callbacks run in interrupt context.