nRF52832 stop(or restart?) after 'App requests accessory config data'

Hello,
I’m learning to use dw3000 and nordic chip for uwb test with apple nearby interaction. I had test for a month but can’t solve many unknown problems, so I’m here to ask for help. THANKS!

I can’t buy official develop kit easily so I started with simple modules and dupont line.
Software:

  • Phone: iPhone 13 mini with ios 17.3.1

  • IOS app:

    • Qorvo Nearby Interaction 1.3.4 in App Store
    • Qorvo Nearby Interaction built by xcode in “Qorvo_Nearby_Interaction_3_1_0” package
    • NIAccessory built by xcode in Apple’s Official Develop Documents
  • Windows:

    • SEGGER Embedded Studio for ARM v5.60a
    • JLINK V6.12a ( and use JLINK V9)

Hardware:

  • nRF52832 Third-part Module: nRF52832 + USB to UART chip + ONBOARD ANNENTA (is this did’t match?) + peripheral circuit such as crystal and decoupling capacitor
  • DW3000 Third-part Module: DW3220 + two ipex connector + peripheral circuit including dc-dc and xtal

I can’t buy official develop kit easily so I started with simple modules and dupont line.
Software:

  • Phone: iPhone 13 mini with ios 17.3.1

  • IOS app:

    • Qorvo Nearby Interaction 1.3.4 in App Store
    • Qorvo Nearby Interaction built by xcode in “Qorvo_Nearby_Interaction_3_1_0” package
    • NIAccessory built by xcode in Apple’s Official Develop Documents
  • Windows:

    • SEGGER Embedded Studio for ARM v5.60a
    • JLINK V6.12a ( and use JLINK V9)

Hardware:

  • nRF52832 Third-part Module: nRF52832 + USB to UART chip + ONBOARD ANNENTA (is this did’t match?) + peripheral circuit such as crystal and decoupling capacitor
  • DW3000 Third-part Module: DW3220 + two ipex connector + peripheral circuit including dc-dc and xtal

PROBLEMS:

  1. nRF52832 stop(?or restart) after ‘App requests accessory config data’.
    this is my rtt log and xcode log below.
nRF52832 Third-Part Module RTT LOG

Application: Nearby Interaction
BOARD: nRF52832DK       //Software and Hardware Details are before the problems
OS: FreeRTOS
Version: 3.0.0
DW3XXX Device Driver Version 06.00.14
MAC: cmsis_v1_R11.9.2
ACCESSORY_RANGING_ROLE: Initiator
<info> app: Slow advertising.
<info> app: Connected       //touch the "connect" buttom in qorvo NI app
<info> app: Notification is enabled
<info> app: App requests accessory config data      
<info> app: Slow advertising.
<info> app: Disconnected
<info> app: Connected     //touch the "connect" buttom in qorvo NI app again
<info> app: Notification is enabled
<info> app: App requests accessory config data
<info> app: Slow advertising.
<info> app: Disconnected
<info> app: Connected
<info> app: Notification is enabled
<info> app: App requests accessory config data
<info> app: Slow advertising.
<info> app: Disconnected

This is the Qorvo NI app log:

LOG for Qorvo Nearby Interaction built by xcode in  "Qorvo_Nearby_Interaction_3_1_0" package
//type for myself, isn't find a easy way to export the log in xcode windows.
//maybe have some type error.

CBManager is powered on
Scanning started.
Peripheral nRF52832DK (AD2E2402) included in qorvoDevices with unique ID
New device included at row 0
Connecting to Accessory
Connecting to Peripheral <CBPeripheral: 0x280664b60, identifier = D400F969-2863-6A57-32CD-674CECE18936, name = nRF52832DK (AD2E2402), mtu = 0, state = disconnected>
Action Button pressed for device 141499622
Peripheral Connected
discovered service. Now discovering characteristics.
discovered characteristic: <CBPeripheral: 0x2819426a0, UUID = 2E93998A-6A61-11ED-A1EB-0242AC120002, properties = 0xC, vaule = (null), notifying = NO>
discovered characteristic: <CBPeripheral: 0x2819426a0, UUID = 2E93998A-6A61-11ED-A1EB-0242AC120002, properties = 0x10, vaule = (null), notifying = NO>
Selecting device 141499622
Requesting configuration data from accessory
Sending Data to device 141499622
Getting TX Characteristics from device 141499622.
Writing 1 bytes: 0x0a,
Notification began on <CBPeripheral: 0x281942ac0, UUID = 2E939AF2-6A61-11ED-A1EB-0242AC120002, properties = 0x10, vaule = (null), notifying = YES>
Received 38 bytes: 0x01, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x01, 0x00, 0x01, 0x00, 0x3f, 0xf5, 0xe3, 0x00, 0xb8, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x48, 0x7a, 0x19, 0x00,
Received configuration data from 'nRF52832DK (AD2E2402)'. Running session.
Accessory Session configured.
Sending shareable configuration bytes: 0x0b, 0x01, 0x00, 0x01, 0x00, 0x19, 0x43, 0x4e, 0xbf, 0xf3, 0x00, 0x00, 0x0b, 0x09, 0x06, 0x00, 0x10, 0x0e, 0xa2, 0x00, 0x03, 0x79, 0x45, 0x29, 0x57, 0x6b, 0x94, 0x86, 0xd2, 0x64, 0x00,
Sending Data to device 141499622
Getting TX Characteristics from device 141499622.
Writing 31 bytes: 0x0b, 0x01, 0x00, 0x01, 0x00, 0x19, 0x43, 0x4e, 0xbf, 0xf3, 0x00, 0x00, 0x0b, 0x09, 0x06, 0x00, 0x10, 0x0e, 0xa2, 0x00, 0x03, 0x79, 0x45, 0x29, 0x57, 0x6b, 0x94, 0x86, 0xd2, 0x64, 0x00,
Sent shareable configuration data.
Received 1 bytes: 0x02,
Accessory Session started.
Session timed out          //why here timed out?Is the onboard annenta or program or dupont wire connection error?
Sending Data to device 141499622
Getting TX Characteristics from device 141499622.
Writing 1 bytes: 0x0c,
Sending Data to device 141499622
Getting TX Characteristics from device 141499622.
Writing 1 bytes: 0x0a,
Received 1 bytes: 0x03,
Accessory Session stopped.
Disconnecting from Peripheral <CBPeripheral: 0x280664b60, identifier = D400F969-2863-6A57-32CD-674CECE18936, name = nRF52832DK (AD2E2402), mtu =100, state = connected>
Peripheral Disconnected
Retrieve Peripheral

I’m following the definition in “pca10040.h” and “custom_board.h” and connect the BLE module and UWB module with dupont line. Two 3.3v power supply to different modules and connect the GND together. RST, WUP, IRQ, CLK, MOSI, MISO, CS are connected correctly.

Is the 15 or 20 cm dupont wire wrong? Is impedance matching compulsorily ( I didn’t know the essential reason but saw an opinion that we need consider the impedance matching when the whole SPI time / raising time > 10%)? I didn’t matching the impedance for SPI.

Is the detection of IMU error? I didn’t connect the IMU module in this system.

Is the power supply isn’t stable?

Is the decoupling capacitor lose or wrong?

Is two annenta of my DW3000 Module made error?

Is the J-LINK Software version incorrectly? I used JLINK-OB but same.

I just thought about these. Hope for your help or discussion sincerely. If I lose some details please contact me.

  1. If I want to use DWM1000 Module to test, I must porting the ‘QANI-All-FreeRTOS_QNI_3_0_0’ code to DW1000 ver.?

I’m learning the UWB co-operation system. And English isn’t my native language. If there’s some error in grammar or expression. Please forgive and ask me for explain.

Thanks for your help! There’s a very nice forum. Nice to discussion with you.

Welcome @sakuranda !

The board is not resetting, you would have the application header printed again (and maybe LEDs blinking) if that was the case. Your logs look good, the OOB part of Nearby Interaction is done fine, the problem seems to be after “niq_configure_and_start_uwb()”, when your device should start TWR with the configuration provided by the iPhone.
At least your basic wiring is ok, otherwise, you won’t get to the application header (uwb_init() would fail before).
I recommend you put some breakpoints in “niq_configure_and_start_uwb()” and check what is failing. If it started TWR it may have some fail-ranging rounds before timeout, but it seems to not be started at all.

Kind regards!

Thanks! Sorry for reply lately. I’ll check the function you said. Have a good day!

There’s another question. I can’t put breakpoints in “niq_configure_and_start_uwb()” in UWB high-speed connection. The XCode said my nrf52832 device is timed-out, is there any convenient way to debug this high-speed program?

If I stop the program manually, it will enter “app_error_weak.c” and put error “ app: SOFTDEVICE: ASSERTION FAILED”, there’s my SEGGER log.

Application: Nearby Interaction
BOARD: nRF52832DK
OS: FreeRTOS
Version: 3.0.0
DW3XXX Device Driver Version 06.00.14
MAC: cmsis_v1_R11.9.2
ACCESSORY_RANGING_ROLE: Initiator
<info> app: Slow advertising.
<info> app: Connected
<info> app: Notification is enabled
<info> app: App requests accessory config data
<error> app: SOFTDEVICE: ASSERTION FAILED

And “niq_configure_and_start_uwb()” is an unopen source code, so I just can read the assembly language to try to find the error.

And I found that I can’t find nRF52832 in iPhone’s bluetooth queue. But I saw the ESP32 devices in my queue when I tested connection between ESP32 and iPhone with project from github. Is this cause the board connection timed-out?
I found nRF52832DK in my android phone, but there’s nothing in iPhone. I changed init.advdata.include_appearance to be true in “advertising_init()” and also changed “sd_ble_gap_appearance_set()” in “gap_params_init()”. But it doesn’t worked. I’ll test it next time.

I paired successfully with nRF Tools App, but it still unvisiable in iphone’s bluetooth queue when I disconnected in nRF’s App. I tried to connect with nRF’s App and pair in Qorvo’s App but failed, because nRF’s App grab the connection of bluetooth. I can’t find anything in Qorvo’s App.
When I disconnected from nRF’s App, the iPhone should be known for my device, but the log in xcode is the same. “Accessory Session started.” and next “Session timed out”.

Should I buy a usb dongle to debug nrf chip? I can’t debug from line to line easily in BLE, it’s not as same as STM32.

Is there ACCESSORY_RANGING_ROLE error? When I use Qorvo and Apple’s NI Framework, is iPhone as Responder or nRF52832 and DW3000 as Responder?

Best Regard.

Is there any way to download Qorvo_Nearby_Interaction package before? such as 3.0 or 1.0

Hi @sakuranda !

Yes, I mean put breakpoints after “niq_configure_and_start_uwb()” because this is when the FiRa session starts, and I believe it’s crashing. To save you some time, this function will call “ResumeUwbTasks()” and “fira_niq_helper()”, so you can go straight to “fira_niq_helper()” and put some breakpoints there. For a better debug experience you may need to change the project optimization to 0, it may make the app fail TWR, but you can at least check where it is failing.

Kind regards!