File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 2525#include " mbed_critical.h"
2626
2727// Cordio Includes
28+ #include " ll_math.h"
2829#include " ll_init_api.h"
2930#include " ll_defs.h"
3031#include " custom_chci_tr.h"
@@ -350,9 +351,17 @@ void NRFCordioHCIDriver::start_reset_sequence()
350351
351352bool NRFCordioHCIDriver::get_random_static_address (ble::address_t & address)
352353{
353- PalCfgLoadData (PAL_CFG_ID_BD_ADDR, address.data (), sizeof (bdAddr_t));
354+ /* Load address from nRF configuration. */
355+ uint64_t address_int = (((uint64_t )NRF_FICR->DEVICEID [0 ]) << 0 ) |
356+ (((uint64_t )NRF_FICR->DEVICEID [1 ]) << 32 );
354357
355- MBED_ASSERT ((address[5 ] & 0xC0 ) == 0xC0 );
358+ unsigned int i = 0 ;
359+ while (i++ < BDA_ADDR_LEN) {
360+ address[i] = address_int >> (i * 8 );
361+ }
362+
363+ /* Top two bits of static address must be 11 (Vol C, Part 3, section 10.8.1) */
364+ address[5 ] |= 0xC0 ;
356365
357366 return true ;
358367}
You can’t perform that action at this time.
0 commit comments