2022-03-30 11:53 PM
Why does the screeen glitch for a moment every 20 second when G++ optimization for Debug turned on. If optimization is turned off then it works fine.
2022-03-31 05:47 AM
If changing the optimization level leads to poor behavior, there is typically a bug in the code somewhere that is causing issues. Poor cache management, and variables not declared as volatile that should be are possible causes.
2022-04-01 12:25 AM
Do you have any idea what could produce glitches on regular 20 seconds interval. I disabled all other RTOS tasks and interupts not related to LCD.
2022-04-01 07:55 AM
You haven't given me much to work with here. What does your program do? What does "glitch" mean exactly? Is the screen actively changing or remaining static? Do you do anything at ~20sec intervals?
2022-04-03 11:09 PM
Program is running on a STM32H750XBH. It is running a 800x480 LDC display. I am using LTDC, DMA2D and TouchGFX deisigner for running the display. What is interesting is that this problem only occurs when g++ -0g or -01 optimization is on. It works normally on other optimization levels. Program should not be doing anything special on 20 seconds intervals. There are two other tasks running (GPS over UART and CAN interface), but I disabled them so they are not cousing the problem.
Link to the video of glitch:
2022-04-06 05:17 AM
I found out that if I disable instruction cache the glitch disapears. Now the question remains why does the glitch apear when the instruction cache is enabled and optimization for debuging is on in g++.