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.

CC2640: Setting the device IRK

Part Number: CC2640


Hello,

I have used two projects simple_peripheral and simple_central from BLE5-Stack (CC2640R2) and I have encountered an issue which I cannot understand.

When I set central's device IRK to custom IRK it stops receiving advertising from the peripheral device.

static uint8_t thisIrk[16] = {
   0x0, 0x1, 0x2, 0x3, 0x4,
   0x5, 0x6, 0x7, 0x8, 0x9,
   0xa, 0xb, 0xc, 0xd, 0xe, 0xf
};

// Initialize this device's IRK and SRK
#if 1 // TODO: Why is this wrong? Central does not receive advertisements from peripheral
  GapConfig_SetParameter(GAP_CONFIG_PARAM_IRK, &thisIrk[0]);
#endif

// Initialize GAP layer for Central role and register to receive GAP events
GAP_DeviceInit(GAP_PROFILE_CENTRAL, selfEntity, addrMode, NULL);

What is the reason of such central divice's behaviour?

Br,

Krzysztof

  • The GapConfig_SetParameter(GAP_CONFIG_PARAM_IRK, &thisIrk[0]) returns SUCCESS (0).
  • Hi Kaeraz,

    Can you help me understand why you are wanting to assign your own IRK? Our stack will randomly generate the IRK at runtime per BLE Specification recommendations. Just curious.

    If you don't set it and the device generates it's own random IRK, does the device respond to the peripheral? I'm curious because I'm wondering if there have been other changes that have been made that could be influencing behavior.
  • Actually, I don't think your arguments are correct. Please change it to the following:

    GapConfig_SetParameter(GAP_CONFIG_PARAM_IRK, thisIrk)

    When you reference it with &thisIrk[0] you're passing in the address of the byte 0 and that's it.
  • Hi,

    If I don't set my own IRK, the central device sees the peripheral's advertisements.

    Why I need? Because it is a part of my security concept.
  • I don't think there is a difference between &thisIrk[0] and thisIrk, as both points to the same location and both in function are casted to void*.

    Can you please describe what could be an issue?

  • Kaeraz,

    Can you expand on your security concept?

    Does randomly generating the IRK at run time not suffice for your requirements?

    I'm curious as what you're trying to do because I want to make sure you're not trying to do something outside the recommended specifications by the BLE Spec.

    In the meantime, I will run a test with assigning my own IRK but won't be able to test this until the end of the week.
  • Hello Evan Wakefield,

    The security concept requires to set peripheral's and central's IRKs. I cannot tell you more details due to internal reasons.
    Be sure, that my concept does not violates the BLE spec recommendation. My own key generation will be done according to suggested rules.

    Did you find the reason for the issue? Meybe the BLE5-Stack performs some kind of randomness quality check for given IRK and my own simple one {0,1,2,...} does not fit the requirements?

    I appreciate your feedback.
    Krzysiek
  • Hi Krzysiek,

    I was not able to follow up on this before the close of the week due to a some unexpected matters. I will be sure to look into this ASAP this week and provide more detailed feedback. You should absolutely be able to set your own IRK as you know and I do want to commit to finding the root cause of this. Right now some of our staff is out of the office for holidays and so we are duty cycling a bit :) 

  • Hi,

    With the holidays we are running low on staff and support right now is slower than normal. I do want to look into this as I see this as a valid thing to look into. Wanted to update you with the status. happy holidays!