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.

CC2530 throws unknown status 0x1A

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

Hi,

when trying to send some data using the AF_DATA_REQUEST 0x2401, I get following AF_DATA_CONFIRM:

msg received, command: 0x4480, msg len: 3
recv buff: 1a 02 12

The 0x1A in the recv buffer is status. It is obviously not an OK status. However, I cannot find it's true meaning. On my sniffer I can see no message is transmitted from CC2530 to zigbee network. After several attempts with the same result, I get another bad status message as response for ZDO_NWK_ADDR_REQ 0x2500:

msg received, command: 0x6500, msg len: 1
recv buff: 10

Where 0x10 means - ZMemError

Any ideas?

  • Hello Ota Fejfar,

    The status 0x1A is the MAC_NO_RESOURCES. Typically this would be the return value when the mac layer is not able to allocate memory from the Heap. 

    Are you sending too many messages back to back or working in a heavy traffic environment.? What version of Z-Stack are you using? Are you using the CC2530 programmed with ZNP image?

  • Hi,

    Yes, the module we are using does have CC2530 with programmed ZNP image. I am using just the API to control it.

    The system version data:

    • transport rev: 2
    • Product: 0
    • MajorRel: 2
    • MinorRel: 5
    • MaintRel: 1

    I am testing it on 1 coordinator and 2 routers setup. I do not have any constraints in the communication so once there is the need in the system, the messages are sent to routers and back. There is currently no other ZigBee network in the area, though there might be in the future.


    From the (failing) communication pattern in the current setup.

    1. The ZDO_NWK_ADDR_REQ 0x2500 is sent to both routers every 5 seconds. Valid response comes back.
    2. Approx 10 "read" messages are sent to each router every five minutes as the device status "poll". Valid response comes back.
    3. Approx. 10 "command" messages are sent to one of the routers whenever the system needs.

    In the most strenuous testing I initiate the command sequence (3) almost continuously. However, I could see the problem occures even after a longer time of "inactivity" when only (1) and (2) applies.

  • Hi,

    There could be multiple reasons for this failure - you might have to put breakpoints and see where the system is returning this error. Did you modify the ZNP code, allocate large memory block of memory  or modify linker file etc ? thanks,

    Saurabh

  • Hi Saurabh,

    I didn't modify anything. I am using CC2530 with programmed ZNP image on it. All what I do is that I use API as described in swra312.pdf. I can read following system information from the chip:

    • transport rev: 2
    • Product: 0
    • MajorRel: 2
    • MinorRel: 5
    • MaintRel: 1

    Thank you for any help.

    Ota

     

  • Hi Saurabh,

    I suspect now that the problem might be in the use of broadcast messages. I am using ZDO_NWK_ADDR_REQ 0x2500 as described in swra312.pdf. The questions are:

    1. How long does it take before the broadcast message is released from the stack?
    2. Can I send another broadcast message before the previous one has been released from the stack?

    My configuration for broadcast messages is:

    #define ZB_CONF_ZCD_NV_BCAST_RETRIES                       1    //default: 2
    #define ZB_CONF_ZCD_NV_PASSIVE_ACK_TIMEOUT          3    //default: 5     (* 100ms) = 300ms
    #define ZB_CONF_ZCD_NV_BCAST_DELIVERY_TIME          15  //default: 30, (* 100ms) = 1.5sec

    Ota

  • Hi Suyash 

    I have the same problem.

    I am using the CC2538 with the Z-Stack that comes with the Z-Stack Home 1.1.0. 

    I am really hammering the ZigBee network, sending large packets (160 bytes which are obviously broken into smaller packets) from the coordinator to a router device. The router device responds with a single small packet and then the coordinator sends another large packet, After about 200 or so of these packets the send fails with the  result  MAC_NO_RESOURCES in the AF_INCOMING_MSG_CMD event. Eventually it recovers but it renders the ZigBee network inoperable for about 5 seconds or more. 

    If I put a 100ms delay between receiving the response from the router and sending the next large, this basically fixes the problem. 

    What can I do to solve this problem? Will increasing the size of the heap help at all ? 

    Regards Kelvin 

  • Hi Suyash, Saurabh,

    any idea?

    Thanks

    Ota

  • Hi Suyash, 

    I have made considerable progress regarding this issue. 

    Basically if I increase the size of the heap from the default 6K to 10K the problem no longer occurs. By that I mean the 0x1A response of MAC_NO_RESOURCES stops happening. 

    What I then did, while under debugger, after I had finished the intensive exchange of messages, I had a look at the following two values :-

    BlocksFree = osal_heap_block_free();
    MemInUse = osal_heap_mem_used();

    The MemInUse figure before and after the intense exchange of messages was about the same 1100 or thereabouts, which is way less than the 10240 that the heap now has. The figure that changed was the BlocksFree, which went from 13 to 224 !!!

    In other words the problem is not a lack of memory in the heap, but heap fragmentation. When the heap was smaller maybe there was not a block of sufficient size to attend a request, and hence the MAC_NO_RESOURCES response. 

    Is there an osal_??? function to compact the heap and join together adjacent blocks ? 

    Regards Kelvin Ussher