This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Hard Fault in SPM

Hi,

   I have an application demo using the latest nrf9160 sample lwm2m_client as its basis, and I'm getting a hard fault occasionally (after a few hours or days) in what I think is the SPM code.

    When the hard fault occurs, the SP and MSP are both at 0x20002668 and the PSP is at 0x20001C90.

    The Stack contents are 

0x20002668 : 0000CAB5 03D09000 0000CAB5 0001C200 00030100 00000000 0000F993 0000F997 0000F8D3 2000268C 2000268C 0000FDB0 00000000

which indicates to me, if I am reading it correctly, that the fault occurred with the PC at 0x0000F993

This doesn't appear to be in the application code space, and after looking into it further it seems to be in the SPM

Excerpt from the zephyr.map file for SPM:

.text.uarte_nrfx_poll_out
0x0000f964 0x2e spm/zephyr/drivers/serial/libspm_drivers__serial.a(uart_nrfx_uarte.c.obj)
.text.platform_calloc_uninit
0x0000f992 0x4 spm/zephyr/modules/nrfxlib/nrf_security/src/mbedtls/libspm_mbedcrypto_vanilla.a(platform.c.obj)
.text.platform_free_uninit
0x0000f996 0x2 spm/zephyr/modules/nrfxlib/nrf_security/src/mbedtls/libspm_mbedcrypto_vanilla.a(platform.c.obj)

Has anyone come across this before?

Am I looking in the correct place?

Any idea what might be causing this issue?

Thanks,

John

Parents
  • I'm thinking now that the Stack contents listed are not valid, as the SP is at the top of the interrupt stack, and what I am looking at are variables in the data ram.

    So there doesn't appear to be any context available for this fault.

    I also note that using the debugger, a similar fault sometimes occurs when resetting/restarting.

  • I'm sorry for the late reply. Try compiling the application without any optimization (if you aren't doing it already) and see if the call stack is valid then.

    Best regards,

    Simon

  • Hello,

    What does it mean to compile the application without any optimization?How to do that? Even I am getting the hard fault in UART.

  • Read more about optimize options in this link, Set CONFIG_NO_OPTIMIZATIONS=y to turn of most of the optimizations.

    If you have more questions, please open a new case and present your problem there.

    Best regards,

    Simon

Reply Children
No Data