Apple NI Configuration Data Frame

Thanks ; i got it the Qorvo NI demo app :hugs: :ok_man: :v:


Cheers :ok_man:, Matthew Gohen

Hi Matthew_gohen,

May I know how you execute the following commands in the terminal ?

I copy the patch to the same level as a root folder of the original application
and using the follow commands in terminal, but i still failed on this.

could you share some experience about it?

Thanks
Jimsen

1 Like

have u already done ?

Hi, can you tell us which Eval kit you bought?

To get back to the topic, can someone share what the expected configuration is for the UWBConfigData in the AccessorryConfigurationData struct? How does one retrieve it / generate it for the DW3000?

Hi, @Doe!

UWBConfigData is defined by Apple and is not open, the way to generate it is by using the NIQ library.
The niq_populate_accessory_uwb_config_data() function to be precise, like seen in send_accessory_config_data().

Best regards!

1 Like

Hi @carlos.silva , thank you for your reply!

My problem is that the library is incompatible with esp32. Are there source files one could use to work with the DW3000 on ESP32?

Here is the output of objdump:

In archive libniq-m4-hfp-1.1.0.0.a:

niq.c.obj:     file format elf32-little
architecture: UNKNOWN!, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000


In archive libniq-m4-sfp-1.1.0.0.a:

niq.c.obj:     file format elf32-little
architecture: UNKNOWN!, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000

Hi @Doe !

Unfortunately, Qorvo only has these libraries available for ARM Cortex M4 and M33. It doesn’t appear that customers are using Xtensa chips, which makes it harder to wait for a release for this platform.

If you have to stick with the ESP32, the only solution I see is to put an intermediate and cheap ARM Cortex chip to implement UWB and NIQ and leave the connectivity (BLE/WiFi) on the ESP32 side.

Best regards!

Hi Carlos, do you know where i can find the NIQ and UWBSTACK lib for the Cortex M33 ? I’ve only found the dwt_uwb_driver lib for the M33.

Best Regards.

have u already done ?Please share something.Thank YOU

Here is what i found out thru reverse engineering:

This is what we send to the iPhone at first, the last two bytes are the UWB MAC address we use, the rest is always the same:

// AccessoryConfigurationData uwbConfigData
// END: 0xAA, 0xAA = NIDiscoveryToken = MAC generated by device
static uint8_t ac_config[]
	= {0x01, 0x00, 0x00, 0x00, 0x3f, 0xf5, 0x03, 0x00, 0xb8, 0x0b,
	   0x00, 0x00, 0x01, 0x09, 0x09, 0x00, 0x00, 0xAA, 0xAA};

Then we receive from the iPhone:

struct as_conf_data {
	uint8_t _unk[2]; // UNKNOWN 0x45 0x55
	uint32_t session_id;
	uint8_t preamble_code;
	uint8_t channel;
	uint16_t num_slots; // ?
	uint16_t slot_duration_rstu;
	uint16_t block_duration_ms;
	uint8_t report; // ? 3 = TOF Report
	uint8_t sts_iv[6];
	uint16_t dst_addr;
} __attribute__((packed));

This is later used for configuring the FIRA session parameters

Hi Carlos,

May I know where I can find the NIQ library for m33, I only find library for m4 in dw3300q.

Hi, has anyone succeeded in making the dwm3000 communicate with the IOS using Apple’s NI framework.
I am stuck in the BLE handshake between the IOS and the dwm3000.
I am using ULM3 UWB module from haoru tech. (A stm32F103 with WDM3000).
The ULM3 anchors and tags are easily communicating, giving accurate distance but we need the IOS device to be an anchor and the ULM3 (DWM3000 with an stm32 as a tag). Is there anyone who could provide me with some support here?

static dwt_config_t config = {
.chan = 5, /* Channel number (Apple U1 uses this) /
.txPreambLength = DWT_PLEN_128, /
Preamble length /
.rxPAC = DWT_PAC8, /
Preamble acquisition chunk size /
.txCode = 10, /
FiRa standard TX preamble code /
.rxCode = 10, /
FiRa standard RX preamble code /
.sfdType = 3, /
4z SFD for FiRa compliance /
.dataRate = DWT_BR_6M8, /
Data rate /
.phrMode = DWT_PHRMODE_STD, /
PHY header mode /
.phrRate = DWT_PHRRATE_STD, /
PHY header rate /
.sfdTO = (129 + 8 - 8), /
SFD timeout /
.stsMode = DWT_STS_MODE_2, /
STS Mode 2 for FiRa /
.stsLength = DWT_STS_LEN_1024, /
Longer STS for better security /
.pdoaMode = DWT_PDOA_M1 /
Angle-of-arrival calculations */
};

this is the config of the DWM3000 and i guess this is compatible with FiRa standards , if not Kindly point it out. also i have diffucultis where i need to develop a handshake between ios and the module. What kind of DataFrame we are supposed to send, even someone told that above , but that wasn’t much clear (For me).
Kind Regards.
Obaid Tanveer

Hi @Obaidtanveer !

I recommend downloading the Qorvo Nearby Interaction Software Package and read the documentation there.
You’ll find more details on the Out-Of-Band “handshake”, but you’ll need to use the NIQ library to use the data from the iPhone packages to configure the DW3000 and FiRa session.

Kind regards!

Yes I have been successful with this.
If you don’t want to go into the details of the NI exchanges by bluetooth, then you are probably best off with using the library that was mentioned before.

Your config looks wrong. Here is what I use:

static dwt_config_t config = {
.chan = 9,
.txPreambLength = DWT_PLEN_64,
.rxPAC = DWT_PAC8,
.txCode = 11,
.rxCode = 11,
.sfdType = DWT_SFD_IEEE_4Z,
.dataRate = DWT_BR_6M8,
.phrMode = DWT_PHRMODE_STD,
.phrRate = DWT_PHRRATE_STD,
.sfdTO = (64 + 1 + 8 - 8), /* (plen + 1 + SFD length - PAC size) /
.stsMode = DWT_STS_MODE_OFF,
.stsLength = DWT_STS_LEN_64,
.pdoaMode = DWT_PDOA_M0, /
off */
};

so is it okay , if i simply achieve the handshake between the IOS and the esp32 (for BLE).
and then configure my DWM3000 with the above configs, will i be good to go then?

Also i will appreciate any other docs or support material you have got.

image

i have understood all the other configs other than this one can you elaborate please?

Thankyou Mr @carlos.silva .
I Found that really helpful.

No - its not so easy. But it is possible to do the BLE handshake (exchange the NI parameters) between IOS and ESP32, and use ESP32/DW3000 for ranging directly with the iPhone (i’m doing it). but its not just the dwt_config_t. There are several other parameter which have to be exchanged by NI before (as i have mentioned above) and which are used to configure the DW3000 phy (dwt_config_t) and the FIRA ranging.