Reading MAC address via nrfjprog --memrd vs sd_ble_gap_addr_get() gets different values

Hello, we have a goal of getting the BLE MAC address from out NRF52840 devices during manufacturing and printing it externally on the device. I was hoping the the MAC readout can be done right after the MCU is programmed via command line script. Looking through some examples I found nrfjprog --memrd 0x100000A4 --w 8 --n 6 as a command to do this. We also use a firmware command  - sd_ble_gap_addr_get() to read the MAC internally while the FW is running. The issue is that the MAC addresses differ by 1 nibble: 


sd_ble_gap_addr_get(): EF 96 BF 70 48 C5
nrfjprog --memrd 0x100000A4 --w 8 --n 6: EF 96 BF 70 48 05

I know that the sd_ble_gap_addr_get() address is valid as we use it for device pairing. So the question is where does the discrepancy between C and 0 come from? How can I use memrd to get an accurate MAC? Testing it on a different device, I got a similar result:

sd_ble_gap_addr_get(): 3E F0 EC 55 44 EC
nrfjprog --memrd 0x100000A4 --w 8 --n 6: 3E F0 EC 55 44 6C

Thanks in advance!

-K

Parents Reply Children
No Data
Related