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.

Does encryption work with CC2480?

I just enabled the encryption by adding the following lines and my application goes from working to not working.  All devices were programmed with the same key.

    // ZCD_NV_PRECFGKEY
    zb_WriteConfiguration(0x62, 16, securityKey);
        
    // ZCD_PRECFGKEYS_ENABLE
    val32 = 1; // all devices assumed to have same key
    zb_WriteConfiguration(0x63, 1, &val32);
        
    // ZCD_NV_SECURITY_MODE
    val32 = 1;  // enable security
    zb_WriteConfiguration(0x64, 1, &val32);

    zb_StartRequest();

  • According to this thread 

    http://community.ti.com/forums/p/3206/11833.aspx#11833

    AF_EN_SECURITY, AF_SKIP_ROUTING are not officially supported.

    These are options to AfDataRequest.  None of these options are documented.

  • I am bumping this thread.

    In another thread a TI employee stated that security does work.

    However, based upon my testing, it does not work.  Maybe I have done something wrong, which is why I posted what I changed in my code.  It took adding only a a few lines of code.

    I will note that my communication with over the SPI bus was affected dramatically by changing the security settings.  The ZASA code has a 10ms timeout waiting for SRDY to change state.  I log whenever this timeout is tripped.  It use to never trip, but with security on it can trip several times in a row and my coordinator never sees any messages from routers.

  • Hi Jeffrey,

    Could you let me know what kinds of problems you are seeing with security?

    Also, with security, there is about a 1.5x increase in latency penalty for the same effective payload. This could explain the different behavior for your ZASA timeout on SRDY.

    Let me know how you are testing it, what problems you see and I'll try to help.

    -Z

  • So I tested this and the best place to configure this stuff is here:

    case appWaiting:
        // The last step of the appIniting above was to reset the ZACCEL.
        {
          uint32 val32;
          uint8 securityKey[16];
          uint8 i;

          for ( i = 0; i < 15; i++ )
          {
            securityKey[i] = 0x11;
          }
          securityKey[15] = 0x0F;

          // Configure the Host Application-specific defaults from sample_app.cfg into the ZACCEL.
          val32 = ZACCEL_NV_PANID;
          zb_WriteConfiguration(ZCD_NV_PANID, 2, &val32);
          val32 = ZACCEL_NV_CHANLIST;
          zb_WriteConfiguration(ZCD_NV_CHANLIST, 4, &val32);

          val32 = APP_POLL_INTERVAL;
          zb_WriteConfiguration(ZCD_NV_POLL_RATE, 2, &val32);
          zb_WriteConfiguration(ZCD_NV_QUEUED_POLL_RATE, 2, &val32);

          // ZCD_NV_PRECFGKEY
          zb_WriteConfiguration(0x0062, 16, securityKey);

          // ZCD_NV_SECURITY_MODE
          val32 = 1;  // enable security
          zb_WriteConfiguration(0x0064, 1, &val32);

        }
        break;

    Please let me know and see if this works for you.

    --Z

  • And I confirm that AF_EN_SECURITY is a don't care. You should also not use AF_SKIP_ROUTING. Essentially both are a don't use, don't touch for CC2480.

  • I lengthened the timeout waiting for SRDY to change state and this fixed my problem.
    I now have encryption working.
    Thank you very much.

  • Excellent!!! Great news, thanks. Have a nice weekend.