No heap space for incoming notifications

We have an application running on an nRF9160 development board (shortly to be ported to a production board), which listens on a serial link for sensor data, which is then sent via udp/dtls, via NB-IoT.

The development board is connected to a serial terminal for diagnostics.

After several messages have been sent there's a warning message printed out on the console:

"W: No heap space for incoming notification: +CSCON: 0"

or

"W: No heap space for incoming notification: +CSCON: 1"

I've tried doubling heap space and also system workqueue stack size in prj.conf 

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
However this has made no difference.
There is no apparent impact on the application itself, but I would of course prefer to properly handle whatever is causing the warning.
Help with this would be appreciated. Thanks.
Parents Reply Children
  • Running for more than 12 hours now with no warning messages. Clearly the problem is solved.

    Am including code here in case it helps others.

    #define TRANSMISSION_STACK_SIZE 1024
    #define TRANSMISSION_PRIORITY 5
    
    K_THREAD_STACK_DEFINE(transmission_stack_area, TRANSMISSION_STACK_SIZE); // define memory for application workqueue
    
    struct k_work_q transmission_work_q; // application workqueue
    
    static struct k_work server_transmission_work; // A work Q element - infinite loop that receives, parses and acts on message events
    
    ...
    
    
    k_work_queue_init(&transmission_work_q); // intialise workqueue
    
    // start workqueue
    k_work_queue_start(&transmission_work_q, transmission_stack_area,
                       K_THREAD_STACK_SIZEOF(transmission_stack_area), TRANSMISSION_PRIORITY,
                       NULL);
    
    k_work_init(&server_transmission_work, server_transmission_work_fn);  // initialise worker task - points to function that does the work
    
    // k_work_submit(&server_transmission_work);  // uses system workqueue
    k_work_submit_to_queue(&transmission_work_q, &server_transmission_work); // worker task uses application workqueue
    

    Initially when the stack size of the workqueue was set to 512 the device panicked. At 1024 it is running perfectly.

    Thanks again. Cheer Ron.

Related