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

NRF9160 MQTT Stack Overflow

Hi , I am working with NRF9160. I want to publish 3000 byte(char array) on mqtt server but I get Stack Overflow error. How can I solve these error? I tried these proj conf file:

CONFIG_NET_RX_STACK_SIZE=16384
CONFIG_NET_TX_STACK_SIZE=16384
CONFIG_MAIN_STACK_SIZE=32000
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_NET_BUF_DATA_SIZE=4096
CONFIG_NET_BUF_USER_DATA_SIZE=4096
CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE=8096
CONFIG_MQTT_MESSAGE_BUFFER_SIZE=4096
CONFIG_MQTT_PAYLOAD_BUFFER_SIZE=4096
But nothing change. It said same error.
Parents Reply Children
  • Hi, Thanks for your answer. Where can I find my log file ? 

    Thanks

    I think my log file:

    [00:02:48.578,460] 
    [1;31m<err> os: ***** USAGE FAULT *****
    
    
    
    
    
    
    [00:02:48.578,460] 
    [1;31m<err> os:   Stack overflow (context area not valid)
    
    
    
    
    
    
    [00:02:48.578,460] 
    [1;31m<err> os: r0/a1:  0x000292df  r1/a2:  0x2001c04d  r2/a3:  0x00000bb7
    
    
    
    
    
    
    [00:02:48.578,460] 
    [1;31m<err> os: r3/a4:  0x00000bb8 r12/ip:  0x00025036 r14/lr:  0x000128a9
    
    
    
    
    
    
    [00:02:48.578,491] 
    [1;31m<err> os:  xpsr:  0x61020000
    
    
    
    
    
    
    
    
    [1;31m<err> os: Faulting instruction address (r15/pc): 0x00012820
    
    
    
    
    
    
    [00:02:48.578,491] 
    [1;31m<err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
    
    
    
    
    
    
    [00:02:48.578,491] 
    [1;31m<err> os: Current thread: 0x20018a40 (sysworkq)
    
    
    
    
    
    
    [00:02:48.652,374] 
    [1;31m<err> fatal_error: Resetting system
  • The log shows that it is the system workqueue that runs out of stack. I assume you are sending the data from a work item?

    You can increase the stack size of the system workqueue with CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE.

  • Hi, I increased my WORKQUEUE stack size than It worked.

    Thanks

Related