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.

CC2538: How to manage Response time for every incoming Request for CC2538.

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

Hello E2E community,

I am working on CC2538 Zigbee Z-stack Embedded firmware.

I am trying to send the Write Attribute command from Zigbee Linux Gateway Application 3.0 to a CC2538 Device.

If I am sending a write attribute command to a device & It was sent successfully over the network.

Device is immediately Responding it with status as SUCCESS.

But on the Gateway Application side, I am not able to receive any kind of indication or response related to it.

After predefined timer interval it will invoke the time out condition.

i.e. 

#define DEVICE_TIMEOUT                            5000                             // default = 9 seconds (ms)
#define APP_TRANSACTION_TIMEOUT      5000                             // 15 seconds (app needs to respond to server cmd requests within this time)

I am not getting why this is happening. so I go through logs on gateway application & sniffer data.

& found that my gateway application little bit slower than the hardware device. (i.e. CC2538 router/end device).

Will you please help to solve this problem....

1. how I put some response time delay for the each incoming request?...

 2. is there any another way to handle this condition?...

NOTE : Find the attachment given below for sniffer data & Zigbee logs.

Thanks & Regard's

Shiv Patil.

 

  • Hi,

    In general I would not recommend artificially introducing a latency to Zigbee response messages.
    For example, what if this happened with an off-the-shelf Zigbee compliant device? Is it feasible to try and change the firmware on this third-party device?

    Recall you were interested in modifying the architecture of the gateway: e2e.ti.com/.../760336
    Have you modified the servers in anyway besides DEVICE_TIMEOUT and APP_TRANSACTION_TIMEOUT?


    Regards,
    Toby
  • Hi shiv patil,

    I haven’t heard from you for a while, so I’m assuming you were able to resolve your issue. If this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information. If this thread locks, please click the "Ask a related question" button and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.


    Regards,
    Toby
  • Yes..
    I have modified the DEVICE_TIMEOUT and APP_TRANSACTION_TIMEOUT.
    I have tested it for the default values also.

    I am using sniffer to trace the request response sent over the network.
    I am able to see both reports & response for a particular request on sniffer before timeout occur.
    & still gateway server response with the time out condition.
    even I am not able to see any data packet or something information on gateway server console until timeout doesn't occur.

    how can i debug that, Is data received successfully on RF receiving part of ZNP either on UART of beaglebone?...

  • Compare the MAC sequence number of the Write Attributes Response to the MAC sequence number of the ACK following the response.
    If they match, this means the ZNP has received the the Write Attributes Response.
  • Part Number: CC2538

    Hello,

    We are using Z-Stack 3.0 with CC2538, here we are using CC2538 based ZNP with Beagle Bone, in this when we do write attribute Request from ZNP/Coordinaotor we have a dropage of packets on ZNP due to fast response.

    We have checked on Sniffer where we can see a Success Response for the Write Attribute, but we dont recieve that data on UART of ZNP. We think this problem is due to very fast Success reponse of Attribute Write.

    To check this we have added a small hardcode delay for Write Attribute Response on Router device which recieves the attribute write request and after delay the ZNP recieves the commands properly.

    Can any one help me resolve this issue.

  • Hi,

    We added the some kind for hard coded delay on the end device application code to which we are sending attribute write request.
    & we got the response on the znp & on gateway application too.

    Now, I have 2 questions in my mind that,

    1. How to debug the ZNP runtime while it will connected to BBB?.
    2. How TI's application code managed for Packet received on the RF part of the ZNP?. Is that possible znp may drop packages,
    If too many packages arrived simultaneously or its busy in serving the first packet & due to this next will be dropped.

    3. Is that uart communication between BBB & ZNP (i.e. CC2538) making the request responses slower?.
    How to increase the baud rate above 115200?.


    Thanks & Regard's
    Shiv Patil.
  • You're sending commands in 50 ms intervals (e2e.ti.com/.../788119).
    Does it work if you send commands less frequently (100 ms, 200 ms, etc)?

    Also, have you confirmed that you can send successfully commands every 50 ms on only the CC2538 (for example, using a sample application, without the gateway)?
    If not, perhaps try that first.

    Have you tried adjusting the following:
    - MT_UART_TX_BUFF_MAX
    - MT_UART_RX_BUFF_MAX
    - MT_UART_THRESHOLD
    - MT_UART_IDLE_TIMEOUT

    See this post related to baudrate: e2e.ti.com/.../436833
    If you do attempt to increase the baud rate, make sure "speed" in NPI_Gateway.cfg matches the baudrate.

  • Hi,

    No, In this case we are only sending this write attribute command over the network.

    sending multiple commands @ 50ms interval will cause an other issue. which I have posted separately on ti's forum

    How we can configure SPI on Beagle Bone/gateway application & on ZNP Coordinator.

    I have tried to do something like given below.

    On Beaglebone side,

    1. I have enabled SPIDEV1 in /boot/uEnv.txt by adding following entry.

    uboot_overlay_addr1=/lib/firmware/BB-SPIDEV1-00A0.dtbo

    2. Made the following changes in NPI_Gateway.cfg file

    uncommented the following lines.

    deviceKey=1 ; SPI

    devPath="/dev/ttyO4" ; SPI
    On ZNP Coordinator device.
    1. I have just verified the xHAL_SPI=TRUE added in c/c++ compiler->preprocessor tab. for that I have referring " Z-stack ZNP Interface Specification.pdf. "
    I am not able to figure out, how to set the the SPI clock speed, modes & chip select pin settings.
    How should I know SPI is set to the gateway application?. 
    Am I missing something?. 
    Regards,
    Shiv Patil.
  • Please refer to "ZNP Interface Specification".
    SPI is not supported for the ZNP interface.
  • As I mentioned above ,

    "Z-stack ZNP Interface Specification.pdf. " this document clearly mentioned the SPI configurations for the ZNP.

    even if you look at NPI_Gateway.cfg you will able to know there is also a provision to configure the SPI.

    Why you say that SPI is not supported for the ZNP interface.


    So What dose it means?...

  • Please refer to the following:

    e2e.ti.com/.../
    e2e.ti.com/.../

    Regards,
    Ryan
  • Hey Ryan,

    I go through the links you have been shared above.

    But this did not resolve my issue. I am not getting responses as fast as they sent over the network.

    How can I make gateway application faster if SPI is not supported to CC2538 ZNP.

    115200 is good enough when we are testing single device.

    suppose multiple devices operated at same time & they will be reporting their status simultaneously some packet will get dropped,

    so that  will be very slow rate of data transfer.

    Now we are very close to finalize our product. but if this is not capable to handle this request responses what should we do?..

    Regards, 

    Shiv Patil

  • Hey Shiv,

    You can modify _hal_uart_isr.c from Components\hal\target\CC2538 to accept baud rates greater than 115200, as Toby mentioned you will need to change the gateway application as well. You can reference the Z-STACK-ARCHIVE's Z-STACK-LINUX-GATEWAY (using Z-Stack HA 1.2.2a) to implement a SPI solution if required.

    Regards,
    Ryan
  • Hello Ryan,

    I have gone through the Components\hal\target\CC2538 & able to found that there is max limit to BR set to 115200,

    In function ( uint8 HalUARTOpenIsr(uint8 port, halUARTCfg_t *config) ) it is mentioned that,

    if (config->baudRate > HAL_UART_BR_115200)

    {

       return HAL_UART_BAUDRATE_ERROR;

    }

    I will try for it make a test case for this,

    But,  I also wants to know a justified answer for, Why CC2538 ZNP with new Z-stack version 3.0.2 dose not support SPI????.

    Today I have make a case study over it, found that "Z-stack ZNP Interface Specification.pdf" Documentation clearly mentioned that SPI is supported for CC2530 & CC2538.

    In  " Projects\zstack\ZNP\CC2538\Source\znp_spi.c  "  file you will be able to find SPI pin configuration for BB-ZNP.

     

    #elif BB_ZNP /* BeagleBone-ZNP connected */

    #define HAL_SPI_MRDY_BASE GPIO_D_BASE

    #define HAL_SPI_MRDY_PIN GPIO_PIN_3

    #define HAL_INT_MRDY INT_GPIOD

     

    #define HAL_SPI_SRDY_BASE GPIO_B_BASE

    #define HAL_SPI_SRDY_PIN GPIO_PIN_0

     

    I am sending you some screenshot's & document Please go through it to help me understand this.

      3731.Z-Stack ZNP Interface Specification.pdf

    Regards,

    Shiv Patil

  • Hello Shiv,

    You are referring to documentation from Z-Stack 1.2.2a, the updated version in Z-Stack 3.0 clearly states that SPI communication has been removed inside the Document History. It was decided to no longer support SPI communication moving forward but some remnants of the old solution still remain. I do not know the reason this decision was made beyond the E2E posts I've already provided.

    Regards,
    Ryan
  • Hey Ryan,

    Thanks for your help,


    Today I have worked on How to increase baudrate values on ZNP CC2538 device & gateway application.

    By doing some minor changes in both side I am able to test UART for different baud rates successfully.

    I would Like to say that Both application code & hardwares are suitable for following baud rates.

    230400, 460800, 921600, 1500000.

    I have tested all of them.

    But I wants to know,

    Which is most suitable baud rate for the application?.

    &

    WIll you please share me a link or any reference,

    How I get  New 3.0.2 version ZNP Interface documents?

     

    Regards

    Shiv Patil.

  • Glad to hear that you got it working. Use whatever baud rate is suitable for your application. The updated ZNP Interface User's Guide is provided in the downloaded Z-Stack 3.0.2 software package.

    Regards,
    Ryan
  • We are using 921600 in our case,
    we almost getting stable & reliable responses upon it.