Touch operation not working on custom pcb using stm32u5a9
- February 13, 2025
- 5 replies
- 1273 views
Hello! I am struggling to get TouchGFX fully working on my custom PCB using a STM32u5A9ZJT (LQFP144). Everything compiles correctly and uploads. I can see my Screen1 background and button on my screen so at least that is working. But when I touch my button it does not transition to the next screen (as it does in the TouchGFX simulator when I run this code). Using my debugger i can see that the touch is triggering the external interrupt, and the coordinates are correct in STM32TouchController::sampleTouch but the expected screen transition never occurs. When comparing the IOC files between my working demo project and custom project, I noticed I did not have DCACHE enabled, but when I enable DCACHE I get a HardFault right after registering a touch.
Setup background -- I began development with the Riverdi_50STM32u5a9. This was available as a board option on TouchGFX so I was able to create my project through TouchGFX first. However, the STM32u5 used in our custom PCB was not a board option within TouchGFX and was not pin compatible with any of the options that did exist. So I created my project starting first with CubeMX then added TouchGFX as an add-on package.
I copied over the missing functions from STM32TouchController.cpp/hpp that TouchGFX generates in my Riverdi demo project over to my custom project. The screen we are using is the same as in the demo board so I was able to copy over all the configuration settings of the frame buffer, ltdc, etc. in CubeMX.
Is there a noticeable gap in my implementation or setup? Has anyone experienced a fault when mapping a touch into a GUI update? I'm new to the STM and TouchGFX realm. I can't even follow how SampleTouch triggers the button handler... any insight would be appreciated!
STMCubeIDE version: 1.16.0
TouchGFX version: 4.24.1
Board: STM32u5A9ZJT (LQFP144)


