cancel
Showing results for 
Search instead for 
Did you mean: 

How to swap little-endian to big-endian in TouchGFX?

KYama.1
Associate III

Hi Community,

I'm trying to connect STM32F412 with SPI LCD (ILI9341). And, I'm trying to run TouchGFX on this combination. The white and black color is correct. However, another colors are strange. I think that the endian is swapped. Might be, TouchGFX supports only little endian.

This ILI9341 device only support big-endian at using SPI port. If I use parallel port, it can choose both little-endian and big-endian. However, the target board supports only SPI.

So, I'd like to swap little-endian to big-endian at drawing. Where code do I need to modify?

Please give me your advice. Thank you.

Best regards,

Kotetsu

14 REPLIES 14

Thank you very much. I‘m going to check your solution.

Best regards,

K. Yama

SCB_CleanDCache_by_Addr((uint32_t*)(((uint32_t)buff) & ~(uint32_t)(__SCB_DCACHE_LINE_SIZE - 1U)), buff_size + __SCB_DCACHE_LINE_SIZE);

https://github.com/ARM-software/CMSIS_5/commit/ab35be31712f978b8b031d6438ea180c107cf171#diff-448d517be4f3dc225d9eb1736d0d6fd78fb4c7b7196739592872bd01fb5ddc86

Those cache management functions have been fixed long ago and after years of ignorance even ST have updated those in firmware packages. Now that same address and size alignment is adjusted internally in the functions and therefore this is enough:

SCB_CleanDCache_by_Addr(buff, buff_size);

Hi Piranha​, thank you very much, I was not aware of that.

The version you linked is v5.2.5, 12 oktober 2018.

Oddly, mine was​ coming with CubeMX, and it states

v5.1.1, 28 march 2019.

So an older​ version at a more recent date.

I checked the code, and it appears to be fixed too.

Thanks a lot!

Now I am learning something when trying to help others. ​

FAlex.2
Associate

I'm trying to connect STM32F412 with SPI LCD (ILI9341. And, I'm trying to run TouchGFX on this combination.

The white and black color is correct. However, another colors are strange. I think that the endian is swapped. Might be, TouchGFX supports only little endian.

This ILI9341 device only support big-endian at using SPI port. If I use parallel port, it can choose both little-endian and big-endian. However, the target board supports only SPI.

Custom Bottled Water

Hi Piranha, thanks a lot, I didn't notice it yet.

I checked the code and although mine version that came with CubeMX is lower (5.1.1), it seems fixed. I tested and it works.