cancel
Showing results for 
Search instead for 
Did you mean: 

Trustzone & TouchGFX/GPU2D support

Tobiasvb
Associate

Hi!

Trying to get a TouchGFX working with Trustzone has shown itself to be quite the hassle. Although I have worked through a lot of issues already, my latest one has deemed real stubborn.

When enabling GPU2D in a trustzone enabled project, the code throws a securefault when trying to use LCDGPU2D::fillbuffer(). My BBMPC is set correctly as the LTDC is able to create and change the framebuffer without issues. Due to the precompiled nature of the GPU2D library i am unable to figure out what buffer GPU2D is trying to access which is throwing this error.

I'm running the STM32u5G7 on a custom board. Everything works in a non-trustzone project.

My non-secure project has a flash offset of 0x20000 (starts at 0x08020000) and a RAM offset of 0x40000 (starts at 0x20040000). Everything before that is part of the secure code. Maybe GPU2D is trying to access a default address somewhere?

 

Aside from this I've found other issues in my path to this point so far:

  • TouchGFX Designer post generate target command ("touchgfx update_project") looks for .cproject file in the same folder as the .ioc file. For normal projects this is fine, but for Trustzone enabled projects, this completely breaks the post-process script unless you manually copy the file back and forth as the .cproject is in the secure/nonsecure folder
  • Even when setting the LTDC to non-secure, and enabling the NVIC global interrupt in non-secure context, you still need to manually set the interrupt to the non-secure context in your secure code otherwise the interrupt never happens.
/* Place in secure main.c */
NVIC->ITNS[(uint32_t)LTDC_IRQn >> 5] |= 1UL << ((uint32_t)LTDC_IRQn & 31);

 

 

I would love to hear some feedback about my particular issue.

 

Kind regards

 

0 REPLIES 0