![](https://stamssolution.com/wp-content/uploads/2022/09/image-14-1024x483.png)
TouchGFX
TouchGFX
- TouchGFX Designer:TouchGFX中易於使用的GUI建構工具,讓您可以建立TouchGFX應用程式的視覺外觀。
- TouchGFX Generator:STM32CubeMX外掛程式,讓使用者可以依據STM32硬體來設定並產生客製化的TouchGFX抽象層(AL)。
- TouchGFX Engine:一套用以驅動UI應用程式的TouchGFX C++框架。 包含螢幕更新(screen updates)、使用者事件(user events)和時序(timing)…等等的處理。 先進的TouchGFX技術針對STM32微控制器作最佳化,可在最低的CPU負荷及記憶體用量下達到最佳的性能。
![](https://stamssolution.com/wp-content/uploads/2022/09/image-15.png)
TouchGFX Key Features
TouchGFX provides support for
- DPI (parallel RGB), DBI (FMC/SPI), and DSI display interfaces
- 1bpp, 2bpp, 4bpp, 16bpp and 24bpp color displays
![](https://stamssolution.com/wp-content/uploads/2022/09/image-16-1024x480.png)
系統架構
![](https://stamssolution.com/wp-content/uploads/2022/09/image-17-1024x389.png)
前置作業安裝與配置
因這次使用H750,flash部分會需要外掛,因此在起步配置上會相對較複雜,這邊直接切入記憶體配置部分詳細說明
透過CubeMX安裝TouchGFX
![](https://stamssolution.com/wp-content/uploads/2022/09/image-18.png)
設定MPU(memory protection unit)
![](https://stamssolution.com/wp-content/uploads/2022/09/image-19-1024x386.png)
Enable FreeRTOSCMSIS_V2
![](https://stamssolution.com/wp-content/uploads/2022/09/image-20.png)
![](https://stamssolution.com/wp-content/uploads/2022/09/image-21.png)
![](https://stamssolution.com/wp-content/uploads/2022/09/image-22.png)
![](https://stamssolution.com/wp-content/uploads/2022/09/image-23.png)
![](https://stamssolution.com/wp-content/uploads/2022/09/image-24.png)
加入Queue傳遞Touch功能的指令
加入TouchGFXLibrary專案
![](https://stamssolution.com/wp-content/uploads/2022/09/image-25-1024x411.png)
設定TouchGFX參數
- Start Address與Start2 Address各需要一個Frame buffer
- 480x272x2(RBG565) = 0x3FC00
![](https://stamssolution.com/wp-content/uploads/2022/09/image-26.png)
設定CubeIDE增加Heap Stack
![](https://stamssolution.com/wp-content/uploads/2022/09/image-27.png)
程式主要跑在ExternalFlash所以要偏移中斷向量表
![](https://stamssolution.com/wp-content/uploads/2022/09/image-28-1024x413.png)
修改CubeIDEFLASH.ld檔
![](https://stamssolution.com/wp-content/uploads/2022/09/image-29.png)
![](https://stamssolution.com/wp-content/uploads/2022/09/image-30.png)
在外部Flash執行程式
務必留意事項,要先燒錄BootCodeJamp至APP Code
•BootCode與APPCode的Clock配置最好一樣不然程式不會執行
![](https://stamssolution.com/wp-content/uploads/2022/09/image-31-1024x190.png)
![](https://stamssolution.com/wp-content/uploads/2022/09/image-32.png)