2025-01-02 08:45 AM - edited 2025-01-03 06:33 AM
Hi Folks and Happy New Year!
I've been trying to track down a problem I'm having with my project for several months now. Essentially I'm getting these red-ish lines through portions of my buttons, but only when (I presume) they are drawn or redrawn - namely when the screen first loads, when they are pressed, or when as in this example, they have text drawn over them that updates.
In the case of the above picture, I've been able to get the lines to appear more consistently by layering some text over top of some of the buttons and then updating that text with each tick where it says "Tick Counter: xxxx". I managed to luck out and have it appear on the "Cancel" of the cancel button this time, though it probably only happens about 1 out of 10 times when the screen loads.
These lines have been appearing pretty consistently throughout my development on the project, and they seem (though I'm still not completely sure) to be happening regardless of my application code. The reason I say this is that I've commented out large portions of my application code and had them still appear. Frustratingly, they are not consistent. I can do a build, have them appear, and then insert a trivial line of code (even a NOP), and then they will disappear, only to reappear again after I add a few more lines.
This really seems to point to some sort of issue where I'm writing off the edge of an array or something (it seems that parts of my frame buffer are getting inadvertently overwritten? But then why just buttons? And why does it still happen when I essentially remove my application code?)
I've included my TOUCHGFXHAL code that has my driver code in it.
Details on my project:
MCU: STM32L496VGTN
Display: NHD-2.8-240320AF-CSXP-FT (ST7789 Controller) connected via FMC 16-bit parallel
External Flash: MT25QL128A using quad-spi with a custom loader
Firmware details: No RTOS (Bare Metal/super-loop)
Touch GFX Configuration:
Other possible helpful details:
Any tips, tricks, or advice towards debugging this issue would be greatly appreciated. You might say figuring this out has become my new year's resolution!
2025-01-03 06:16 AM
On additional thing I just noticed - if I set the button's alpha value to 254 or less, instead of 255, I don't seem to get the artifacts. I don't know how this factors into the problem, but figured I would mention it.