This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Manually set resolvable address.

I am using S132V3 on NRF52832 device. In my application we need to set a static, non-rotating, private resolvable address. I can't get into why that is here. In theory this should be easy, just compute a valid address and call sd_ble_gap_addr_set(), however that function checks the MSB's for the type and won't accept private resolvable as an address type. So no dice there.

Then I turned MWU off, and located the MAC address in softdevice memory and swapped it out with the right one. Something like (volatile uint8_t)0x200001be&=0x7F; plus a couple more addresses.

Strangely enough, I got this to work in peripheral mode, I can bond to it from a phone. However I need simultaneous central/peripheral and things are a bit hairy. Certain calls to SD seem to require that high bit to be set or they crash, and other calls need the MAC address "restored" or bonds don't work.

I've yet to get everything working 100% in central. Is there some other way to work around this?

Parents
  • I afraid this is restricted by the spec that the resolvable address shouldn't be set manually. This is due to the main purpose of the random resolvable address, to provide privacy.

    Modifying RAM may not be a good idea, as you already experienced, in some functions, we do check the first bit.

    Why do you need a static resolvable address ?

  • Hi Jon,

    How exactly did you set the sd_ble_gap_privacy_set() ? I just tested here with S132 v5.0.0 on SDK v14, it worked fine, I have new address everytime I called it and updated every minute. Here what I used:

    privacy_param.privacy_mode=BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY;
    privacy_param.private_addr_cycle_s=60;
    privacy_param.private_addr_type=BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
    privacy_param.p_device_irk= NULL;
    err_code = sd_ble_gap_privacy_set(&privacy_param);
    
Reply
  • Hi Jon,

    How exactly did you set the sd_ble_gap_privacy_set() ? I just tested here with S132 v5.0.0 on SDK v14, it worked fine, I have new address everytime I called it and updated every minute. Here what I used:

    privacy_param.privacy_mode=BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY;
    privacy_param.private_addr_cycle_s=60;
    privacy_param.private_addr_type=BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
    privacy_param.p_device_irk= NULL;
    err_code = sd_ble_gap_privacy_set(&privacy_param);
    
Children
No Data
Related