File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -350,9 +350,17 @@ void NRFCordioHCIDriver::start_reset_sequence()
350350
351351bool NRFCordioHCIDriver::get_random_static_address (ble::address_t & address)
352352{
353- PalCfgLoadData (PAL_CFG_ID_BD_ADDR, address.data (), sizeof (bdAddr_t));
353+ /* Load address from nRF configuration. */
354+ uint64_t address_int = (((uint64_t )NRF_FICR->DEVICEID [0 ]) << 0 ) |
355+ (((uint64_t )NRF_FICR->DEVICEID [1 ]) << 32 );
354356
355- MBED_ASSERT ((address[5 ] & 0xC0 ) == 0xC0 );
357+ unsigned int i = 0 ;
358+ while (i++ < BDA_ADDR_LEN) {
359+ address[i] = address_int >> (i * 8 );
360+ }
361+
362+ /* Top two bits of static address must be 11 (Vol C, Part 3, section 10.8.1) */
363+ address[5 ] |= 0xC0 ;
356364
357365 return true ;
358366}
You can’t perform that action at this time.
0 commit comments