Hard fault when integrating TouchGFX into Zephyr on STM32N65XX
Hello,
I am getting a hard fault while trying to integrate TouchGFX into a Zephyr application.
The application is secure-only and the screen design is very simple: it contains a single screen with one box. When I debug the application, the hard fault occurs in the touchgfx::Application constructor (so I cannot debug), which is called indirectly through:
FrontendHeap& heap = FrontendHeap::getInstance();
I have already tried increasing the following Zephyr configuration values (CONFIG_MAIN_STACK_SIZE and CONFIG_HEAP_MEM_POOL_SIZE).
CRC is enabled. DMA2D is disabled for now — the “Use DMA2D Accelerator” option is set to No in the X-CUBE-TOUCHGFX package, to keep the setup simple and eliminate one possible source of issues.
The framebuffers are aligned and placed across AXISRAM3, AXISRAM4, and AXISRAM5
The setup is as custom board with:
MCU: STM32N65XX
Zephyr version: 4.4
TouchGFX version: 4.26.1
Zephyr SDK: 1.0.1
I would appreciate any help, suggestions, or debugging directions.
Thanks in advance.
It is not my first time integrating TouchGFX with Zephyr. I was able to make TouchGFX 4.24 work with older Zephyr versions on an H7-family MCU.
ERROR LOGS ARE:
project-name:~$ [00:00:00.447,000] <err> os: ***** HARD FAULT *****
[00:00:00.447,000] <err> os: ***** HARD FAULT *****
project-name:~$ [00:00:00.460,000] <err> os: Bus fault on vector table read
[00:00:00.460,000] <err> os: Bus fault on vector table read
project-name:~$ [00:00:00.476,000] <err> os: r0/a1: 0x00000002 r1/a2: 0x3401f4e0 r2/a3: 0x000001e0
[00:00:00.476,000] <err> os: r0/a1: 0x00000002 r1/a2: 0x3401f4e0 r2/a3: 0x000001e0
project-name:~$ [00:00:00.496,000] <err> os: r3/a4: 0x00000320 r12/ip: 0xaaaaaaaa r14/lr: 0x708325b9
[00:00:00.496,000] <err> os: r3/a4: 0x00000320 r12/ip: 0xaaaaaaaa r14/lr: 0x708325b9
project-name:~$ [00:00:00.516,000] <err> os: xpsr: 0x61000000
[00:00:00.516,000] <err> os: xpsr: 0x61000000
project-name:~$ [00:00:00.529,000] <err> os: No EXC_RETURN available; assuming extended FP stack frame
[00:00:00.529,000] <err> os: No EXC_RETURN available; assuming extended FP stack frame
project-name:~$ [00:00:00.548,000] <err> os: s[ 0]: 0x00000000 s[ 1]: 0x032001e0 s[ 2]: 0x00000400 s[ 39
[00:00:00.548,000] <err> os: s[ 0]: 0x00000000 s[ 1]: 0x032001e0 s[ 2]: 0x00000400 s[ 3]: 0x7083259
project-name:~$ [00:00:00.572,000] <err> os: s[ 4]: 0x70848b8c s[ 5]: 0x3401c970 s[ 6]: 0x3401c96c s[ 78
[00:00:00.572,000] <err> os: s[ 4]: 0x70848b8c s[ 5]: 0x3401c970 s[ 6]: 0x3401c96c s[ 7]: 0x3401c88
project-name:~$ [00:00:00.595,000] <err> os: s[ 8]: 0x3401c8b8 s[ 9]: 0x708308cd s[10]: 0x3401c970 s[110
[00:00:00.595,000] <err> os: s[ 8]: 0x3401c8b8 s[ 9]: 0x708308cd s[10]: 0x3401c970 s[11]: 0x3401c90
project-name:~$ [00:00:00.619,000] <err> os: s[12]: 0x3401c958 s[13]: 0x708309e1 s[14]: 0x3401c8b4 s[15b
[00:00:00.619,000] <err> os: s[12]: 0x3401c958 s[13]: 0x708309e1 s[14]: 0x3401c8b4 s[15]: 0x708305b
project-name:~$ [00:00:00.642,000] <err> os: fpscr: 0x00000000
[00:00:00.642,000] <err> os: fpscr: 0x00000000
project-name:~$ [00:00:00.655,000] <err> os: Faulting instruction address (r15/pc): 0x70833800
[00:00:00.655,000] <err> os: Faulting instruction address (r15/pc): 0x70833800
project-name:~$ [00:00:00.674,000] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:00.674,000] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
project-name:~$ [00:00:00.692,000] <err> os: Current thread: 0x340190c8 (tid_ui)
[00:00:00.692,000] <err> os: Current thread: 0x340190c8 (tid_ui)
project-name:~$ [00:00:00.708,000] <err> os: Halting system
[00:00:00.708,000] <err> os: Halting system
