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.

CC2640R2F: Encryption key doesn't seems to be stored during power cycles

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Hi

I having problem with pairings and encryption after power cycle.

My set up:

CC2640R2

sdk_1_00_00_22

Just works pairing
        uint8 pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
        uint8 mitm = FALSE;
        uint8 ioCap = GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT;
        uint8 bonding = TRUE;
        uint8 autoSyncWhitelist = TRUE;
        uint8 secureConnection = GAPBOND_SECURE_CONNECTION_NONE;

I build stack with this setting OSAL_SNV=1

Pairing and encryption works fine but after a power cycle of chip it seems like chip has forgotten about the encryption keys of pairing.

When I look on the air sniffer log I see that cc2640 sends LL_REJECT_IND with errorCode: PIN or Key missing. ( see frame 7707 in attached air sniffer)

If I ask the BLE stack of number of paired devices it says 1  (GAPBondMgr_GetParameter( GAPBOND_BOND_COUNT, &numPaired );) , so it has saved something at least.

Reconnecting without powercycle chip works fine and no new pairing is made everything seems saved.

My question is.

Is there any settings to get bondmanager to save encryption Keys, as is saves paired devices in Flash?

According to documentation everything should be handled by the stack an application shouldn't need to do anything to get this to work.

RMS3927_AdroidReconnectionAfterPowerCykle.zip

  • Hi harsmar,

    Which example project are you using? Can you recreate this behavior using simple_peripheral? Are you using a stack or a stack library? Are you using CCS or IAR?
    Have you verified that the bond was saved in SNV?

    I would like you to try the following procedure on a newly flashed device (app and stack):

    1. Using SmartRF Flash Programmer 2, select your device and click the "Edit" tab
    2. Read the SNV section (Page 30) - should be all FFs
    3. Disconnect from SmartRF Flash Programmer 2
    4. Connect and bond to your device
    5. Read the SNV section again - I would recommend using "Read Flash to File" so you can compare it to your results from step 6
    6. Power cycle your device
    7. Read the SNV section again
    8. Compare the SNV sections from step 4 and step 6. Are they the same?

    I will look into this on my end as well. Can you tell me a little about the peer you are connecting to and the procedure you are using to bond to the device?

  • Hi harsmar,

    After some investigation, it looks like this was a bug in CC2640R2 SDK v 1.00.00.22 that was fixed in CC2640R2 SDK v1.30.00.25. I would advise you to switch to using that SDK.
  • Thanks.
    Now it seems to work.
    Took a while to update SDK due to files that has been moved. (They had been moved to some better folders so its ok :) )