Skip to main content
karsparskambala
Associate II
September 17, 2026
Solved

Hard fault when integrating TouchGFX into Zephyr on STM32N65XX

  • September 17, 2026
  • 8 replies
  • 104 views

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

Best answer by karsparskambala

@mathiasmarkussen It appears the issue was caused by the driver for an IC on our board. The application started working after we disabled it. Thank you for your help, and sorry for taking up your time. I’ll close the topic now.

8 replies

ST Technical Moderator
September 17, 2026

Hello,

For the N6, the CRC does not work correctly, at least for TouchGFX purposes, unless you call __HAL_RCC_SYSCFG_CLK_ENABLE() before initializing it.

karsparskambala
Associate II
September 17, 2026

Thanks ​@mathiasmarkussen.

What role does __HAL_RCC_SYSCFG_CLK_ENABLE play for CRC? Why is this necessary?

I tried adding this at the beginning of the crc_stm32_init() zephyr/drivers/crc/crc_stm32.c and it did not make a change.

ST Technical Moderator
September 18, 2026

I do not remember the specifics, but I believe there are some registers in that clock domain that goes into the CRC computation.

I do not have any immediate ideas. Are you able to share your project?

Andrew Neil
Super User
September 17, 2026
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.