This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to monitor the size of a thread stack in ncs?

In ncs1.7.1, I’m struggling with a problem about hard fault on nRF9160, but I have no idea to slove the problem.

nRF52840 transmits data to nRF9160 via UART0, the baudrate is 1000000 with flow control, After running a few minutes, nRF9160 crash.

The following pictures are the detailed error message.

I guess occurred stack overflow, but not sure. How to monitor stack usage in real time?

Parents
  • Here are the config options I typically use:

    # Debugging configuration
    CONFIG_THREAD_NAME=y
    CONFIG_THREAD_ANALYZER=y
    CONFIG_THREAD_ANALYZER_AUTO=y
    CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
    CONFIG_THREAD_ANALYZER_USE_PRINTK=y

    # add asserts
    CONFIG_ASSERT=y
    CONFIG_ASSERT_VERBOSE=y
    CONFIG_ASSERT_NO_COND_INFO=n
    CONFIG_ASSERT_NO_MSG_INFO=n
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_THREAD_NAME=y
Reply
  • Here are the config options I typically use:

    # Debugging configuration
    CONFIG_THREAD_NAME=y
    CONFIG_THREAD_ANALYZER=y
    CONFIG_THREAD_ANALYZER_AUTO=y
    CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
    CONFIG_THREAD_ANALYZER_USE_PRINTK=y

    # add asserts
    CONFIG_ASSERT=y
    CONFIG_ASSERT_VERBOSE=y
    CONFIG_ASSERT_NO_COND_INFO=n
    CONFIG_ASSERT_NO_MSG_INFO=n
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_THREAD_NAME=y
Children
No Data
Related