To read the MAC addresses defined I use the following code (with CONFIG_BT_ID_MAX=2 in prj.conf):::
In reply, count is set to 1 hence only one address is defined. addr[0] contains an address of type random.
I order to define a public MAC address I got inspired by the following post:
https://devzone.nordicsemi.com/f/nordic-q-a/99585/config-for-using-sdc_hci_cmd-functions
This uses an hci command similar to setting TX power. I had to adapt it for a later version of SDK/Toolchain.
My code is as follows:
[00:06:03.052,322] <err> os: Data Access Violation
[00:06:03.052,326] <err> os: MMFAR Address: 0x12c1d
[00:06:03.052,336] <err> os: r0/a1: 0x00000000 r1/a2: 0x00000004 r2/a3: 0x00012c1d
[00:06:03.052,342] <err> os: r3/a4: 0x200063c8 r12/ip: 0x00000000 r14/lr: 0x0002259f
[00:06:03.052,347] <err> os: xpsr: 0x29000000
[00:06:03.052,351] <err> os: Faulting instruction address (r15/pc): 0x00022ca0
[00:06:03.052,369] <err> os: >>> ZEPHYR FATAL ERROR 19: Unknown error on CPU 0
[00:06:03.052,384] <err> os: Current thread: 0x20002ee0 (unknown)
[00:06:03.129,332] <err> os: Halting system