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 this a Bug in ZASA code?

Hi All,

I have a doubt in implementation of zb_SystemReset function in ZASA application for eZ430-RF2480.

Please, suggest if I am missing anything and misunderstanding the code?

I seen CC2480 interface specification document, and there is no any SAPI AREQ request, with cmd0=0x46 and cmd1=0x09.

Please, find below the details.

==========================================================================

file : common/zaccel/sapi.c

void zb_SystemReset(void)
{
  sapiReq(MT_SAPI_SYS_RESET, 0, NULL, 0);
}

which decodes a call to sapiReq as
sapiReq(0x09, 0, NULL, 0);  //Refer to common/zaccel/cc2480.h #define MT_SAPI_SYS_RESET 0x09

Now if I decode this sapiReq() function it becomes as,(Refer to common/zaccel/sapi.c)

static void sapiReq(uint8 cmd, uint8 arg, uint8 *req, uint8 len)
{
  uint8 *pBuf = zaccelMsgBuf;

  *(pBuf+MT_RPC_POS_LEN) = 2 + 0;
  *(pBuf+MT_RPC_POS_CMD0) = 6;
  *(pBuf+MT_RPC_POS_CMD1) = 0x09;
  *(pBuf+MT_RPC_POS_DAT0) = 0;
  *(pBuf+MT_RPC_POS_DAT0+1) = 0;

  if (cmd == MT_SAPI_SYS_RESET)
  {
    *(pBuf+MT_RPC_POS_CMD0) |= 0x40;
  }
  else
  {
    *(pBuf+MT_RPC_POS_CMD0) |= MT_RPC_CMD_SREQ;
  }
  zaccelRPC(pBuf);
}

So the final result is a call with Request "len=2, cmd0=0x46, cmd1=0x09, data[0]=0, data[1]=0"
============================================================================
Which I beleive is This command does not exist's anyway?? OR Am I missing any thing or any document?

Thanks for your help.

Thanks and Regards,

Shivdas Gujare

  • Hi Shivdas Gujare,

    as far as I can tell, this code shouldn't comply to the given CC2480 specifications. Since I'm working on a project regarding the SYS API, I'm strongly interested in an explanation from the experts :)

    Regards

    Jan

  • Ya i also tested this thing, but i don't know how it's working in their code.....

    But i did in the way as mentioned in a data sheet. I got the response with the Reason field "0x02".  you try as in data sheet hope u'll get the response... Send a AREQ Reset_Req command and then send a poll command to Rx Sys_Reset_Ind.