Do the nRF51822 has valid Mac address on it, or we have to write our own Mac address into the chip?
Do the nRF51822 has valid Mac address on it, or we have to write our own Mac address into the chip?
If you are using normal BLE you don't need to set the Mac Address, its handled by the SoftDevice
But Up to I I know, the Bluetooth device should have a unique Mac address. Do we need to purchase Mac address from IEEE and write to nRF51822
Hi Fiske,
we program a random MAC address to the FICR registerers( specifically DEVICEADDRTYPE, DEVICEADDR[0], DEVICEADDR[1]) of the nRF51822 during production.
The SoftDevice will read out the address and use it as the MAC address. You can retrieve and set the sd_ble_gap_address_get() and sd_ble_gap_address_set() APIs. However, you should not that sd_ble_gap_address_set() will not alter the FICR registers, it must therefore be called every time you initialize the SoftDevice.
Best regards
Bjørn
How can we save own own Mac address to the nRF51822 permanently
You can store it in one of the UICR registers, then read it out after you have initialized the SoftDevice and use sd_ble_gap_address_set() to change the address.