This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Is it possible (and how) to increase the messages buffers in a CC2538 ZNP?

Other Parts Discussed in Thread: Z-STACK, CC2520, CC2538

Hi,

I'm working with the CC2538 Mesh 1.0.0 ZNP project, as a coordinator/concentrator for a large and heavy traffic network. I'm pretty new to the CC2538 platform and have limited access to the ARM IAR compiler, so my testing capabilities are limited. I've got pretty good experience with the MSP430+CC2520+Z-stack platform, though.

We have observed that, under heavy traffic, the CC2538 ZNP quickly returns ZBufferFull and ZMemError errors in the ZB_SEND_DATA_CONFIRMATION when issuing ZB_SEND_DATA_REQUEST commands.

We have implemented some mechanisms for throttling down the rate of messages when this happens and throttling up after  successful ZB_SEND_DATA_CONFIRMATION messages. It's working but, as I said, the buffer seems to fill up very quickly, so this is my question: is there a way to increase the buffers/available memory for increasing the ZNPs capacity/delaying the errors?

My first guess is increasing the HEAP size, but, as I said I know little about the cc2538 platform and have few testing capabilities, so I would like to have some orientation first. So is that the knob to tweak? And if so, which practical limits may I have in this platform?

Thanks a lot,

Asier

  • Hi Asier,

    You can modify the parameters in the file nwk_globals.c to increase the number of packets that the network layer will buffer to transmit.

    Following are the parameters that you can modify for this purpose. Please note may have to increase the heap size if you increase the number data messages that network layer can buffer. 

    #define NWK_MAX_DATABUFS_WAITING 8 // Waiting to be sent to MAC
    #define NWK_MAX_DATABUFS_SCHEDULED 5 // Timed messages to be sent 
    #define NWK_MAX_DATABUFS_CONFIRMED 5 // Held after MAC confirms 
    #define NWK_MAX_DATABUFS_TOTAL 12 // Total number of buffers

    Hepe this helps. 

    Regards

  • Hi Suyash,

    Sorry for the so long delay in answering, but other priorities where above this issue....

    I'm reviewing these parameters now and they seem to improve the behavior, although I still have to carry on testing with more devices and traffic.

    In the meantime, do the buffers have to add up in the _TOTAL define taking into account only the _WAITING and either the _SCHEDULED or the _CONFIRMED? or I should be adding all three (doesn't seem to be the case)? or maybe they are not really related...

    I would like to reach relatively high number of buffers, so I wonder what the limit could be...

    Thanks for your help,
    Asier.
  • Hi,

    I've found a partial answer to one of my own questions, just for the record:
    NWK_MAX_DATABUFS_TOTAL is later assigned to a "CONST uint8" so the max is 255, which arises a new question, is this uint8 something that can be changed to uint16 for instance without "breaking" anything in the stack?

    And the question about how the waiting, scheduled and confirmed are related to the total, still remains unanswered, volunteers? ;-)

    Thanks, cheers,
    Asier