DWM3000EVB demo doesn’t work from source code

Dear community, I’m investigating DWM3000EVB with nRF52840DK for Apple’s nearby interaction demo (Qorvo_Apple_Nearby_Interaction_Beta_release_1.0.0) And everything is working correctly when I’m using the included binary version „NRF52840DK_full.hex“. But when I build and run the app from source code in Segger, it doesn’t work properly:
I can establish a Bluetooth connection with the iPhone, but after I press the “Run Session” button, I first see the message “Accessory session started” and then “Session with ‘DWM3000EVB + nRF52840DK’ timed out”.
And most importantly, I’m not getting any UWB data (distance or direction).

After debugging the microcontroller code for a while, I noticed that in the fira_app.c file, the uwbmac_start() function returns the error code -5. But I can’t dig deeper because there is no source code for uwbmac.

Could you please help me to figure out why the binary version works and the version I’m building from source code doesn’t? How can I make the source code version also working properly?

I’m an iOS developer and don’t have much experience programming microcontrollers, so I might be missing something obvious.
I’m using SEGGER Embedded Studio for ARM V6.20a on macOS Monterey.
I would appreciate any help.

1 Like

I have the same problem but with nRF52833DK

Hello,

I could not reproduce your issue.
It’s working fine with me when either flashing the binary or debugging the souce code in Segger.
I’m using:
Target: DWM3000 EVB + nRF52840DK.
Application: Qorvo NI 3D.
iPhone 11: Version 15.4.1.

And uwbmac_start() returns 0 in my case.
Can you give more details about your setup?
what application are you using? iPhone version? etc…

1 Like

Target: DWM3000 EVB + nRF52833DK.
Application: Apple’s Implementing Spatial Interactions with Third-Party Accessories sample app.
iPhone 11: Version 15.4.1.

by the way, where did you get Qorvo NI 3D app, I can’t find it

Hi @iMan

In the downloaded pack (link), Qorvo has sources/iOs folder, and inside it has a “patch” file to apply to the stock Apple NI project and README.MD which describes “how to apply” that patch.

Then, you just re-build that project in XCode and deploy it to your test iPhone.

Let me check if I can reproduce the issue with Apple’s Implementing Spatial Interactions with Third-Party Accessories sample app.

I applied the patch, but no change on app. It didn’t have the arrow

Hi @iMan,

Please verify that you’re doing these steps:
1/copy/paste the patch file to the same level as the apple application

2/ Run this command to apply the patch

3/Close any running application in your iPhone wrt to this Demo.

4/Rebuild and run the project using Xcode

In this step, enusre that you’re selecting QorvoNIDemo and the iPhone you’re using.

I did these steps again at the moment, and It worked for me. So you should be missing one of these steps. Also verify that you’ve copied the patch file at the same level as the application as in the first step (This may be the issue).

I missed this step: enusre that you’re selecting QorvoNIDemo; it works now, thanks

Thank you for your reply, @wassim

My setup is as follows
Target: DWM3000EVB + nRF52840DK
iOS Device: iPhone 12 Pro (iOS 15.4.1)

I’ve tried both apps: „NIAccessory“ (Apple Demo app) & „Qorvo NI 3D“

And the result is the same for both: It works with prebuilt binary & doesn’t work when I’m building from source.

Here are my logs from RTTViewer.

Working binary version:

00> Application: Nearby Interaction Beta
00> Target: DWM3000EVB + nRF52840DK
00> OS: FreeRTOS
00> Version: 1.0.0-210722
00> DW3XXX Device Driver Version 06.00.00
00> MAC: R8.2.3_E
00> ACCESSORY_RANGING_ROLE: Responder
00> app: Fast advertising.
00> app: Connected
00> app: Notification is enabled
00> app: App requests accessory config data
00> {“TWR”: {“R”:0,“a16”:“0x8412”,“S”:“OK”,“D cm”:11}}
00> {“TWR”: {“R”:1,“a16”:“0x8412”,“S”:“OK”,“D cm”:13}}
00> {“TWR”: {“R”:2,“a16”:“0x8412”,“S”:“OK”,“D cm”:14}}
00> {“TWR”: {“R”:3,“a16”:“0x8412”,“S”:“OK”,“D cm”:13}}

Not working version built from source:
(I’ve changed on purpose Application → Application1)

00> Application1: Nearby Interaction Beta
00> Target: DWM3000EVB + nRF52840DK
00> OS: FreeRTOS
00> Version: 1.0.0-220411
00> DW3XXX Device Driver Version 06.00.00
00> MAC: R8.2.3_E
00> ACCESSORY_RANGING_ROLE: Responder
00> app: Fast advertising.
00> app: Connected
00> app: Notification is enabled
00> app: App requests accessory config data

Please let me know if I can give you some more infos, which could help to find the root of this issue.

Have you built the app with Segger on MacOS?
Do you know what the error code „-5“ from uwbmac_start() means?

Hi @volodya , @iMan

Initially, I had SEGGER Embedded Studio for ARM V5.60a on MacOS. I succeed to build the app and debug it correctly. I did not face your issue.

Then, I downloaded the SEGGER Embedded Studio for ARM V6.20a and I did not succeed to build the app ("__vfprintf.h: No such file or directory").
https://devzone.nordicsemi.com/f/nordic-q-a/85405/nrf5-sdk-17-1-0-examples-is-not-compiling-in-latest-ses-6-20a/ : This seems like a known issue in segger starting SES 6.20a. And the workaround to this is to remove “SEGGER_RTT_Syscalls_SES.c” file from the project.

This is problematic as it will remove some functions needed to output distance and angle.

So, I think you should downgrade your segger embedded studio to 5.60a (this is the version I tested) and maybe other recent version which is not 6.20a should also be ok. And this should resolve your issue.

Hope it helps,
Wassim

4 Likes

Hi @wassim, thank you very much for your time and help!
You are right, it works using the Segger v.5.60a

2 Likes

Yes, v.5.6a works, thanks