nRF5340 XIP crash in debug build

Hi Nordic Team, 

When using the nRF5340 with XIP enabled, a release build with -Os runs perfectly, but a debug build with -Og crashes on the first function located in the XIP, nrf_wifi_fmac_dev_add_zep(). We are using NCS 3.2.3. We made sure the wifi function is called after the XIP is initialized. The crash happens in the middle of the function, so it looks like some instructions are executed from XIP. 

At the moment we do not know how to proceed so we would appreciate any help on the issue.

Map file snippet

*fmac_main.c.obj(SORT_BY_ALIGNMENT(.text.nrf_wifi_fmac_dev_add_zep))
*fill* 0x00000000100e5156 0x2
.text.nrf_wifi_fmac_dev_add_zep
0x00000000100e5158 0x384 zephyr/drivers/wifi/nrf_wifi/libnrf_wifi.a(fmac_main.c.obj)
0x00000000100e5158 nrf_wifi_fmac_dev_add_zep
*fmac_main.c.obj(SORT_BY_ALIGNMENT(.text.nrf_wifi_fmac_dev_rem_zep))
.text.nrf_wifi_fmac_dev_rem_zep
0x00000000100e54dc 0x30 zephyr/drivers/wifi/nrf_wifi/libnrf_wifi.a(fmac_main.c.obj)
0x00000000100e54dc nrf_wifi_fmac_dev_rem_zep

Hardfault

[00:00:00.811,035] <err> os: ***** USAGE FAULT *****
[00:00:00.811,035] <err> os: Attempt to execute undefined instruction
[00:00:00.811,065] <err> os: r0/a1: 0x03bbf000 r1/a2: 0x00000000 r2/a3: 0x00000000
[00:00:00.811,096] <err> os: r3/a4: 0x00000001 r12/ip: 0x492273c0 r14/lr: 0x000067cf
[00:00:00.811,096] <err> os: xpsr: 0x01000000
[00:00:00.811,096] <err> os: Faulting instruction address (r15/pc): 0x100e5402
[00:00:00.811,157] <err> os: >>> ZEPHYR FATAL ERROR 36: Unknown error on CPU 0
[00:00:00.811,187] <err> os: Current thread: 0x2001e810 (main)
[00:00:00.911,743] <err> os: Halting system

Parents
  • Hi Nordic Team,

    The error seems to be caused by not using the errata 159 fix for the nrf5340. The file zephyr/modules/nrf_wifi/bus/CMakeLists.txt explicitely disables the workaround for this errate, when the nrf70x series wifi chip is used.

    Both CONFIG_NRF70_BUSLIB and CONFIG_NORDIC_QSPI_NOR are set, leading to the errate workaround being disabled, even when using regular spi for the nrf70.

Reply
  • Hi Nordic Team,

    The error seems to be caused by not using the errata 159 fix for the nrf5340. The file zephyr/modules/nrf_wifi/bus/CMakeLists.txt explicitely disables the workaround for this errate, when the nrf70x series wifi chip is used.

    Both CONFIG_NRF70_BUSLIB and CONFIG_NORDIC_QSPI_NOR are set, leading to the errate workaround being disabled, even when using regular spi for the nrf70.

Children
No Data
Related