2024-10-24 04:29 AM
Hi,
I am using the STM32H563 with an ST7735S display and encountering a colour difference between TouchGFX and the display. How can this issue be resolved?
Thanks
Mathan
Solved! Go to Solution.
2024-11-10 05:45 AM - edited 2024-11-10 05:46 AM
The ST7735 has a register called MADCTL (Memory Access Data Control), address 0x36. Notice that one of the bitfields is the RGB/BGR Order. You could try toggling this bit, which will tell the driver to interpret the red and blue channels opposite to what they currently are now.
In your project file drv_st7735.c, check the DRV_ST7735_SetRotation function. Notice that some pre-processor "if" sections set the madctl variable to the ST7735_MADCTL_RGB define and some others set it to ST7735_MADCTL_BGR.
Try swapping the ST7735_MADCTL_RGB with ST7735_MADCTL_BGR and vice versa for all rotation cases.
2024-10-25 05:07 AM
Hello @Mathan Raja ,
Most likely the drivers of your screen don't use the same format as TouchGFX.
For instance, TouchGFX uses ARGB but your display's driver might be in ABGR.
Someone else had a similar issue with an STT7735, here is how they solved it : https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/touchgfx-wrong-color-issue/td-p/195514
Please tell me if that helped you.
Regards,
2024-10-25 06:05 AM
Hi Gaetan Godart,
I display images in a loop, and pressing an external button changes the image (a small application).
Adjusting the data size resolved the colour issue, and now the correct colours appear.
However, the application is not functioning as expected. The callback and image-changing functions execute during debugging, but the issue persists, and the display appears frozen.
Thanks
Mathan
2024-10-28 05:00 AM
Hello @Mathan Raja ,
I don't really understand the issue here.
You changed the format and now your first image is fine?
But once you execute your interrupt that changes to another image, then you get the wrong colors again and the application freeze?
Can you share your project?
How do you change the image?
Can you try to isolate the actions (one for the image change and one for the interrupt), what happens in each case?
Do you use data cache (Dcache)?
What is your memory protection unit settings? Do you prevent speculative reading?
Regards,
2024-10-28 05:53 AM
Hi Gaetan Godart,
I'm running an application that displays five images in sequence, with each image changing upon pressing an external button (GPIO interrupt). Initially, this worked as expected.
After changing the SPI (polling mode) data size from 8 to 16 bits, the colours display correctly, but now the images seem frozen and do not change with the button press.
How do you change the image? External button press.
Do you use a data cache (Dcache)? Not used.
What is your memory protection unit settings? Do you prevent speculative reading?
Default STM32 memory regions are used; custom settings to prevent speculative reading are not enabled.
Thanks
Mathan
2024-10-29 02:29 AM
Hello @Mathan Raja ,
When I asked how you changed the image I was wondering if you changed the bitmap but I looked at your project and you just have all images preloaded and show visible the correct one.
Can you try to disable the instruction cache (ICache)?
Can you try to isolate the actions (one for the image change and one for the interrupt), what happens in each case?
Can you try to put your images in internal memory?
Regards,
2024-11-04 02:48 AM
Hi Gaetan Godart,
Sorry for the late reply—I was on vacation last week.
I have isolated the action items in the project, and here’s what I found:
With SPI data size at 8-bit:
With SPI data size at 16-bit (after initial setup):
Thanks
Mathan
2024-11-05 02:37 AM
Hello @Mathan Raja ,
No worries!
I think you should stick to 8 bits.
Have you looked at our documentation ?
I would suggest trying to fix the color issue, look at these resources:
If you still wants to go the 16 bits solution, maybe look at this community.st.com/t5/stm32-mcus-products/custom-spi-datasize/td-p/129849
Regards,
2024-11-05 05:16 AM
Hi Gaetan Godart,
can I get a direct answer?
Thanks
Mathan
2024-11-05 05:43 AM
What do you mean by direct answer?
Regards,