Ranging Pixel 6 Pro AndroidX UWB to DWM3000EVB

We are trying to evaluate UWB ranging using the new AndroidX UWB JetPack library with a DWM3000EVB plugged into a Nordic nRF52840-DK.
The Android sample code is here.
To be honest, it’s not clear if the Pixel is an initiator or a responder, but we have tried examples ex_05a and ex_05b.
The Android api says:

        /**
         * Pre-defined unicast STATIC STS DS-TWR ranging.
         *
         * deferred mode,
         * ranging interval = 240 ms,
         * slot duration = 2400 RSTU,
         * slots per ranging round = 6
         *
         * All other MAC parameters use FiRa/UCI default values.
         *
         * <p> Typical use case: device tracking tags
         */
        @JvmField
        val UWB_CONFIG_ID_1 = 1

So we assume we need to use the DS_TWR examples.
The code needs to setup the UwbAddress and UwbComplexChannel.
The examples seem to be using channel 5 rather than 9, although we have yet to see where it selects CONFIG_OPTION_33 in the Qorvo code.
What we can’t see is where to get the actual UWB MAC address from. Should we be calling something to set it?

        val uwbDevice = UwbDevice.createForAddress("42:42") // What MAC Address?
        val uwbChannel = UwbComplexChannel(5,9) // Why channel 5 and should the preamble index be 9?
        // Create the ranging parameters.
        val partnerParameters = RangingParameters(
            uwbConfigType = RangingParamters.UWB_CONFIG_ID_1,
            sessionId = 0, // What should we use for session ID?
            // SessionKeyInfo is used to encrypt the ranging session.
            sessionKeyInfo = null, // Do we need to copy the cp_key from the examples, and what is the endian byte order?
            complexChannel = uwbChannel,
            peerDevices = listOf(uwbDevice),
            updateRateType = RangingParameters.RANGING_UPDATE_RATE_AUTOMATIC
        )

        val sessionFlow = clientSession.prepareSession(partnerParameters)

The examples don’t seem to be getting any data in Segger breakpoints, so we assume that we have yet to get the correct config to talk with the Pixel 6 Pro to/from the DWM3000.
So as Qorvo created the Android kernel support and chipset for the Pixel 6 Pro, it would be really good to get some more information from you…

I guess some progress, as I tried looking at any UWB tracing in Android.
Setting the UwbAddress to FF:FF seems to have actually got an error back. It is definitely coming from the DWM3000, as sitting on a Segger Studio breakpoint gives nothing.
Presumably some other STS config needed in the sessionId / sessionKeyInfo or I need to edit the ds_twr_initiator_sts.c code.

2022-06-16 15:30:10.113 8141-8274/com.example.app D/MainActivity: Got UWB local address 6C:8A ranging capabilities: distance true, azimuth true, elevation false
2022-06-16 15:30:10.166 2553-7870/? I/NearbyUWB: UWB Ranging Device start ranging [CONTEXT service_id=49 ]
2022-06-16 15:30:10.168 2553-7870/? I/NearbyUWB: Local UWB address is 0X6C8A [CONTEXT service_id=49 ]
2022-06-16 15:30:10.168 2553-7870/? I/NearbyUWB: Opens UWB session with bundle parameters: [CONTEXT service_id=49 ]
2022-06-16 15:30:10.168 2553-7870/? I/NearbyUWB: UWB parameter: aoa_result_request, value: 1 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.168 2553-7870/? I/NearbyUWB: UWB parameter: range_data_ntf_proximity_near, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.168 2553-7870/? I/NearbyUWB: UWB parameter: is_tx_adaptive_payload_power_enabled, value: false [CONTEXT service_id=49 ]
2022-06-16 15:30:10.168 2553-7870/? I/NearbyUWB: UWB parameter: rframe_config, value: 3 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.168 2553-7870/? I/NearbyUWB: UWB parameter: max_ranging_round_retries, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.169 2553-7870/? I/NearbyUWB: UWB parameter: psdu_data_rate, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.169 2553-7870/? I/NearbyUWB: UWB parameter: fcs_type, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.169 2553-7870/? I/NearbyUWB: UWB parameter: device_role, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: device_type, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: block_stride_length, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: prf_mode, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: slot_duration_rstu, value: 2400 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: protocol_version, value: 1.1 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: slots_per_ranging_round, value: 6 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: vendor_id, value: [7, 8] [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: ranging_interval_ms, value: 240 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: dest_address_list, value: [-281474976710656] [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: sfd_id, value: 2 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: num_of_msrmt_focus_on_range, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: channel_number, value: 5 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: session_priority, value: 50 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: is_key_rotation_enabled, value: false [CONTEXT service_id=49 ]
2022-06-16 15:30:10.170 2553-7870/? I/NearbyUWB: UWB parameter: sts_config, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.171 2553-7870/? I/NearbyUWB: UWB parameter: num_of_msrmt_focus_on_aoa_elevation, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.171 2553-7870/? I/NearbyUWB: UWB parameter: in_band_termination_attempt_count, value: 3 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.171 2553-7870/? I/NearbyUWB: UWB parameter: range_data_ntf_proximity_far, value: 20000 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.171 2553-7870/? I/NearbyUWB: UWB parameter: bprf_phr_data_rate, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.171 2553-7870/? I/NearbyUWB: UWB parameter: sts_length, value: 1 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.171 2553-7870/? I/NearbyUWB: UWB parameter: initiation_time_ms, value: 100 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.172 2553-7870/? I/NearbyUWB: UWB parameter: aoa_type, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.172 2553-7870/? I/NearbyUWB: UWB parameter: has_time_of_flight_report, value: true [CONTEXT service_id=49 ]
2022-06-16 15:30:10.172 2553-7870/? I/NearbyUWB: UWB parameter: has_angle_of_arrival_figure_of_merit_report, value: false [CONTEXT service_id=49 ]
2022-06-16 15:30:10.172 2553-7870/? I/NearbyUWB: UWB parameter: has_angle_of_arrival_azimuth_report, value: false [CONTEXT service_id=49 ]
2022-06-16 15:30:10.173 2553-7870/? I/NearbyUWB: UWB parameter: mac_address_mode, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.173 2553-7870/? I/NearbyUWB: UWB parameter: preamble_duration, value: 1 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.173 2553-7870/? I/NearbyUWB: UWB parameter: key_rotation_rate, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.174 2553-7870/? I/NearbyUWB: UWB parameter: bundle_version, value: 1 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.174 2553-7870/? I/NearbyUWB: UWB parameter: has_angle_of_arrival_elevation_report, value: false [CONTEXT service_id=49 ]
2022-06-16 15:30:10.174 2553-7870/? I/NearbyUWB: UWB parameter: static_sts_iv, value: [1, 2, 3, 4, 5, 6] [CONTEXT service_id=49 ]
2022-06-16 15:30:10.174 2553-7870/? I/NearbyUWB: UWB parameter: range_data_ntf_config, value: 1 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.174 2553-7870/? I/NearbyUWB: UWB parameter: ranging_round_usage, value: 2 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.174 2553-7870/? I/NearbyUWB: UWB parameter: protocol_name, value: fira [CONTEXT service_id=49 ]
2022-06-16 15:30:10.174 2553-7870/? I/NearbyUWB: UWB parameter: has_result_report_phase, value: true [CONTEXT service_id=49 ]
2022-06-16 15:30:10.175 2553-7870/? I/NearbyUWB: UWB parameter: device_address, value: 7821063702882287616 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.175 2553-7870/? I/NearbyUWB: UWB parameter: measurement_report_type, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.175 2553-7870/? I/NearbyUWB: UWB parameter: preamble_code_index, value: 9 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.176 2553-7870/? I/NearbyUWB: UWB parameter: session_id, value: 1832243397 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.176 2553-7870/? I/NearbyUWB: UWB parameter: multi_node_mode, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.176 2553-7870/? I/NearbyUWB: UWB parameter: num_of_msrmt_focus_on_aoa_azimuth, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.176 2553-7870/? I/NearbyUWB: UWB parameter: hopping_mode, value: 0 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.177 2553-7870/? I/NearbyUWB: UWB parameter: sts_segment_count, value: 1 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.177 2553-7870/? I/NearbyUWB: exec UWB operation Open session [CONTEXT service_id=49 ]
2022-06-16 15:30:10.180 3382-31216/? V/UwbService: DefaultSessionManager: Opening fira ranging
2022-06-16 15:30:10.181 775-775/? I/qorvo.uwb.FiraController: initNewTwrSession:FiraTwrSession{id: 1832243397, deviceType: CONTROLEE, deviceRole: RESPONDER, rangingRoundUsage: DS_TWR, multiNodeMode: UNICAST, deviceAddress: UwbAddress{address: [108, 138]}, destAddressList: [UwbAddress{address: [255, 255]}], initiationTimeMs: 100, slotDurationRstu: 2400, slotsPerRangingRound: 6, rangingBlockDurationMs: 240, blockStridingValue: 0, maxRangingRoundRetries: 0, isHoppingEnabled: false, isBlockStridingEnabled: false, sessionPriority: 50, rangingRoundControl: RangingRoundControl{hasResultReportPhase: true, measurementReportType: INITIATOR_TO_RESPONDER, hasDeferredMode: true}, inBandTerminationAttemptCount: 3, channelNumber: 5, preambleCodeIndex: 9, rframeConfig: SP3, prfMode: BPRF, preambleDuration: T64_SYMBOLS, sfdId: 2, stsSegmentCount: 1, psduDataRate: RATE_6M81, bprfPhrDataRate: RATE_850K, fcsType: CRC_16, isTxAdaptivePayloadPowerEnabled: false, aoaType: AZIMUTH, stsConfig: STATIC, subSessionId: 0, vendorId: [7, 8], staticStsIV: [1, 2, 3, 4, 5, 6], isKeyRotationEnabled: false, keyRotationRate: 0, aoaResultRequest: REQ_AOA_RESULTS, resultReportConfig: ResultReportConfig{hasTimeOfFlightReport: true, hasAngleOfArrivalAzimuthReport: false, hasAngleOfArrivalElevationReport: false, hasAngleOfArrivalFigureOfMeritReport: false}}
2022-06-16 15:30:10.181 775-775/? I/qorvo.uwb.FiraController: CheckTwrSessionFields
2022-06-16 15:30:10.181 775-775/? I/qorvo.uwb.IeeeUtils: GetPhyInfo
2022-06-16 15:30:10.182 775-775/? I/qorvo.uwb.NlSocket: SendAndAwaitResponse
2022-06-16 15:30:10.182 775-775/? I/qorvo.uwb.NlSocket: SendAndAwaitResponse: Read message
2022-06-16 15:30:10.182 775-775/? I/qorvo.uwb.IeeeUtils: SetChannel: Set channel to 5
2022-06-16 15:30:10.182 775-775/? I/qorvo.uwb.NlSocket: SendAndAwaitAck: Received ACK
2022-06-16 15:30:10.182 775-775/? I/qorvo.uwb.UwbIface: OnPreSessionOpen fira
2022-06-16 15:30:10.182 775-775/? I/qorvo.uwb.McpsUtils: SetRegion
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.NlSocket: SendAndAwaitAck: Received ACK
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: InitSession
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: CreateSessionStateMsg
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.NlSocket: SendAndAwaitAck: Received ACK
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: ConfigTwrSession
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: PutMainSessionParams
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: PutTimingsParams
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: PutBehaviorParams
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: PutRadioParams
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: PutAntennaParams
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: PutCryptoParams
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.FiraRegionUtils: PutReportParams
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.NlSocket: SendAndAwaitAck: Received ACK
2022-06-16 15:30:10.183 775-775/? I/qorvo.uwb.UwbIface: OnSessionChanged
2022-06-16 15:30:10.184 775-775/? I/qorvo.uwb.FiraController: setSessionCallback
2022-06-16 15:30:10.184 3382-11798/? D/UwbService: UwbRangingSession: Sending ranging opened callback
2022-06-16 15:30:10.186 2553-7872/? I/NearbyUWB: UWB session opened: 1832243397 [CONTEXT service_id=49 ]
2022-06-16 15:30:10.186 2553-7870/? I/NearbyUWB: exec UWB operation Start ranging [CONTEXT service_id=49 ]
2022-06-16 15:30:10.187 3382-31216/? V/UwbService: DefaultSessionManager: Starting session 4
2022-06-16 15:30:10.187 775-775/? I/qorvo.uwb.FiraController: startRangingSession
2022-06-16 15:30:10.187 775-775/? I/qorvo.uwb.UwbIface: OnPreSessionStart
2022-06-16 15:30:10.250 775-775/? I/qorvo.uwb.FiraRegionUtils: SubscribeCallback
2022-06-16 15:30:10.250 775-775/? I/qorvo.uwb.FiraRegionUtils: StartSession
2022-06-16 15:30:10.250 775-775/? I/qorvo.uwb.FiraRegionUtils: CreateSessionStateMsg
2022-06-16 15:30:10.254 775-775/? I/qorvo.uwb.NlSocket: SendAndAwaitAck: Received ACK
2022-06-16 15:30:10.254 775-775/? I/qorvo.uwb.UwbIface: OnSessionChanged
2022-06-16 15:30:10.255 3382-11798/? D/UwbService: UwbRangingSession: Sending ranging started callback
2022-06-16 15:30:10.256 2553-7872/? I/NearbyUWB: UWB ranging started [CONTEXT service_id=49 ]
2022-06-16 15:30:10.257 2553-7872/? I/NearbyUWB: Local UWB address is 0X6C8A [CONTEXT service_id=49 ]
2022-06-16 15:30:10.258 2553-7872/? I/NearbyUWB: Local UWB address is 0X6C8A [CONTEXT service_id=49 ]
2022-06-16 15:30:10.264 8141-8141/com.example.app I/UwbClientSessionScope: Started UWB ranging.
2022-06-16 15:30:10.308 3382-31216/? V/UwbService: FiraSessionsProxy: Fira TwrResult received for session 1832243397
2022-06-16 15:30:10.308 3382-11798/? D/UwbService: UwbRangingSession: Sending ranging result callback
2022-06-16 15:30:10.311 2553-7870/? I/NearbyUWB: UWB Ranging Data from peer 0XFFFF Status -1 [CONTEXT service_id=49 ]

It appears that part of the problem is that the Android side is using “Static STS” which I see referred to on FiRa but as we don’t want to pay $5000 for a spec, then it doesn’t help much:

At minimum, for a device to be FiRa Certified and display the FiRa Certified logo, the device must meet the FiRa-specified MAC and PHY Conformance Test Specifications and the MAC/PHY Interoperability Test Specification, including **static STS** parameters.

So how do we enable Static STS on the DWM3000?

We have also created an issue on the AndroidX Jetpack library asking for more information.

I found that the source code to the Qorvo Apple Nearyby demo from nearly a year ago includes the FiRa params, so it looks like a better bet: “Qorvo_Apple_Nearby_Interaction_Beta_release_1.0.0-1”.
No idea why the latest DWM3000 examples don’t include the FiRa params…

Of course the Apple demo uses “proprietary” NIQ libs, so no source to work out what it needs in terms of UWBConfig.
I got to the same point by ignoring the error from niq_configure_and_start_uwb and passing the full fira_config data from Android which in theory matches the Android FiraController trace of the settings.
Obviously not quite, as I get:

2022-06-23 16:39:15.329 3572-26074/? V/UwbService: FiraSessionsProxy: Fira TwrResult received for session 286331153
2022-06-23 16:39:15.330 3572-25348/? D/UwbService: UwbRangingSession: Sending ranging result callback
2022-06-23 16:39:15.332 2531-19922/? I/NearbyUWB: UWB Ranging Data from peer 0XFFFF Status -1 [CONTEXT service_id=49 ]

On the nRF side I see the error from _reportTask tracing, so at least it’s consistent…ly wrong.

1 Like

Having worked out most of the structure we can at least get the Dst Addr / channel / preamble from the initial config and generate a packet->payload that matches what the NIQ library expects ( we can set sessionId / preamble / channel / num slots / slot duration / block duration / STS IV / dest addr ).
However even though the fira_config now matches what Android traces in the FiraController (apart from UWB_Init_Time_ms - hard code to 5 in NIQ and Android says 100), we are still seeing the Status -1 error on the Android side when it gets the Tx packet.

2022-06-25 10:27:22.289 3380-9436/? V/UwbService: FiraSessionsProxy: Fira TwrResult received for session 35684
2022-06-25 10:27:22.289 3380-2022/? D/UwbService: UwbRangingSession: Sending ranging result callback
2022-06-25 10:27:22.291 2542-14941/? I/NearbyUWB: UWB Ranging Data from peer 0X5194 Status -1 [CONTEXT service_id=49 ]

So we are out of ideas until someone from Qorvo who actually wrote the Android driver can tell us what Status -1 actually means!

It appears that the iOS has the same initial timeout error that just repeats, but perhaps rather than ignore the bad message it sends a timing response, whereas Android just has an error with no response.
Of course the code that creates the tx_frame is part of the pre-compiled libs, so no easy way of working out what is going wrong, although the packet data looks wrong after the Header IE.
So iOS start up:

Application: Nearby Interaction Beta
Target: DWM3000EVB + nRF52840DK
OS: FreeRTOS
Version: 1.0.0-220625
DW3XXX Device Driver Version 06.00.00
MAC: R8.2.3_E
ACCESSORY_RANGING_ROLE: Initiator
<info> app: Fast advertising.
<info> app: Connected
<info> app: Notification is enabled
<info> app: App requests accessory config data
<info> app: Sending config data len: 19
Tx: len 67 
 flag 1 
 delayed 18cfc1c 
 rx delay -1 
 rx timeout pac 0 
buff: 
49 2b d2 34 26 13 0 ff 18 
5a 8 8 8 8 8 8 8 
8 19 ee 0 0 fc d7 72 
7a 0 3f 93 52 27 ff eb 
38 d0 63 22 29 22 84 2d 
de 33 b9 20 73 74 19 5d 
95 17 57 af 7b 72 43 a7 
55 49 f5 c3 fa 9f 23 a7 

<info> app: Apple Start UWB tasks with address D2:34 with local addr: 5E:AF
Tx: no buff flag 1 
 delayed 198691c 
 rx delay -1 
 rx timeout pac 0 
Tx: len 67 
 flag 1 
 delayed 43a881c 
 rx delay -1 
 rx timeout pac 0 
buff: 
49 2b d2 34 26 13 0 ff 18 
5a 8 8 8 8 8 8 8 
8 19 ee 0 0 38 d8 72 
7a 0 3f 93 52 27 ff eb 
38 d0 63 22 29 22 84 2d 
de 33 b9 20 73 74 19 5d 
95 17 57 af 7b 72 43 a7 
72 bb 54 94 52 1d e8 6f 

{"TWR": {"R":0,"a16":"0x34d2","S":"ERR","D cm":0}}
Tx: no buff flag 1 
 delayed 445f51c 
 rx delay -1 
 rx timeout pac 0 
Rx: len 0 
 flags 202 
 ranging f3 
 pdoa 0 
data: 

Tx: no buff flag 1 
 delayed 45ccf1c 
 rx delay -1 
 rx timeout pac 0 
Tx: len 57 
 flag 1 
 delayed 4683c1c 
 rx delay -1 
 rx timeout pac 0 
buff: 
49 2b d2 34 26 13 0 ff 18 
5a 8 8 8 8 8 8 8 
8 19 ee 0 0 3c d8 72 
7a 0 3f f1 a0 6b 4f af 
a1 21 14 98 61 de 85 a6 
67 57 d3 75 e 36 36 95 
4c 21 f5 88 2c db 

The same TWR ERR, but it also sees an Rx frame.
Looking at the initial 67 byte packet, it looks like this, with the data looking strange after the IE header termination 1:

49 2b // 0010 1011 0100 1001
// 001 frame type = data 
// 1 security = enabled
// 0 frame pending = none
// 0 ack req = none
// 1 PAN id = compress
// 0 reserved
// 1 suppress seq no = true
// 1 IE present
// 10 dest addr mode = 16 bit
// 10 frame version
// 00 src addr mode = no src addr

57 ed // dest addr- 2

26 // security control 0010 0110
// 110 - security level = ENC-MIC-64 / data confidentiality / data auth / MIC len 8
// 00 - key identifier mode = determined implicitly
// 1 - frame counter suppression
// 0 - ASN in nonce
// 0 - Reserved

13 00  // IE header 0000 0000 0001 0011 
// 0010011 length = 19
// 00000000 = Element ID
// 0 Type = 0

ff 18 5a // Vendor OUI 
 8 8 8 8 8 8 8 8 - 11 byte vendor specific header IE
64 8b 0 0 // SessionId - 18

ae af 4f 34 // 32 bit counter? - 22
// end IE header

0 3f // IE header 0011 1111 0000 0000 - 26
// 0000000 length = 0
// 0111 1110 = Element id 0x7e = header termination 1
// 0 Type 0

e8 d4 // Payload IE 1101 0100 1110 1000 - 28  // hack 1000 0000 0010 0011
// 100 1110 1000 = length 1256 ???
// 1010 = Group Id Reserved ???
// Type = 1

a4 e0 3e 1b
65 d8 9d a6 b5 37 e4 c5
58 d5 b8 68 10 6 c8 4a 
a8 74 8e 23 c5 60 25 

2a 76 42 ea 55 db e9 d6 // changing every Tx - 57 

I really hope someone from Qorvo actually reads this forum…

I did not try Qorvo with Google Pixel, but I can confirm I was able to use the Nearby Interaction example from Qorvo to do a manual FiRa ranging in between 2 Qorvo devices :slight_smile:

The trick is to manually fill the “struct fira_device_configure_s” and then manually start the Controller or Controlee.

see “construct_fira_param_from_config()”

  1. working parameters set you can get from debugging with iPhone and pausing the accessory (responder) on the line fira_helper_controllee()…

here you can get the example values of struct fira_param.

  1. what I did next is to configure the accessory manually to start it as a Controller and I was using the “Listener 1” application from XR6.0C to sniff the RCM packets.

@meavydev FiRa Payload IE are encoded.

@meavydev

I think the problem is that using both the Estimote UWB beacons and the Qorvo EVB Apple Nearby demo need to use the super secret initialisation process, which I have mostly worked out the data, but Android needs the Static STS IV and Vendor ID as well as a session Id.
Given the errors on the Android side, it appears that either the STS IV / Session Id or both are wrong, so when the ranging packet arrives on the Android side it gives an error.
However working out what it doesn’t like is not easy given the complete lack of tracing detail from the Qorvo driver and the complete lack of any response from Qorvo. Almost like they don’t care about supporting UWB.

vUpper64 = StaticStsIV followed by vendorID

I do not remember the order, but VUpper64 ia an array of 8;

StaticSTS -array of 6
VendorID array of 2.

For the start Set them to 0 and that is it.

Look to the structure i gave you - you can see SessionID, and the above.

I agree with you that Qorvo should release an example for Android, no questions, but afaik the issue is an initial BLE handshake. Apple defined that pretty well!

I have set them all to zero (including the session Id) and still the error from Android:
2022-07-26 10:17:32.311 768-768/? W/qorvo.uwb.NlSocket: ReceiveMessage: Error reading message: Try again
As far as Apple goes, I have yet to find anything in their documentation that describes the format other than:

|AppleUWBConfigData|Bytes|Variable length|Parameter selection intended to be consumed by the UWB middleware.|
So not exactly well defined.

The Bluetooth incoming data is in this format:
// 0x01, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Fixed data
// 0x13, // configLen - 15

// 0x01, 0x00, 0x00, 0x00, 0x3f, 0xf5, 0x03, 0x00, 0xb8, // Fixed data
// 0x0b, 0x00, // Preamble - 25
// 0x00, 0x01, 0x09, // Fixed Data
// 0x09, 0x00, // Channel - 30
// 0x01,
// 0x7c, 0xd2, // Dest Addr - 33

So we get the Preamble / Channel / Dest Addr from the Bluetooth data.

The outgoing Bluetooth packet data is in this format:
// Android timings
val packetPayload = byteArrayOf(
0x01, 0x00, 0x00, 0x00, 0x17, 0x45, 0x55, // Fixed data
0x11.toByte(), 0x22.toByte(), 0x00, 0x00, // SessionID - 7
0x0b, // preamble - 11
0x09, // channel - 12
0x06, 0x00, // num slots - 13
0x60, 0x09, // slot duration - 15
0xf0.toByte(), 0x00, // block duration - 17
0x03, Fixed Data
0x11.toByte(), 0x22.toByte(), 0x33.toByte(), 0x44.toByte(), 0x55.toByte(), 0x66.toByte(), // STS IV - 20
0x46, 0x59.toByte(), // SRC_ADDR - 26
)
If you have somewhere that documents the AppleUWBConfigData then feel free to point me at it, as we have Apple Developer Accounts as well as Android.

Pixel 6 Pro updated to Android 13 and AndroidX UWB Alpha 3 with Controller support…
New low level messages from the Android Qorvo driver layer, but it still times out!

2022-08-26 11:28:41.295 1750-3646/? I/UwbSessionManager: initSession() : Enter - sessionId : 1
2022-08-26 11:28:41.297 1750-32530/? I/uwb: uwb_uci_jni_rust: Java_com_android_server_uwb_jni_NativeUwbManager_nativeSessionInit: enter
2022-08-26 11:28:41.297 1750-27465/? D/uwb: uwb_uci_rust::uci: Received blocking cmd UciSessionInit(1, 0)
2022-08-26 11:28:41.297 1750-27465/? D/uwb: uwb_uci_rust::uci: Sending HAL UCI message UciCommandPacket { uci_packet: UciPacketData { group_id: SessionConfig, message_type: Command, opcode: 0, child: UciCommand(UciCommandData { child: SessionCommand(SessionCommandData { child: SessionInitCmd(SessionInitCmdData { session_id: 1, session_type: FiraRangingSession }) }) }) }, uci_command: UciCommandData { child: SessionCommand(SessionCommandData { child: SessionInitCmd(SessionInitCmdData { session_id: 1, session_type: FiraRangingSession }) }) } }
2022-08-26 11:28:41.297 1750-27465/? I/uwb: uwb_uci_rust::uci: UWB state change from Ready to W4UciResp
2022-08-26 11:28:41.297 904-904/? I/qorvo.uwb.UciBackendAndroidCCC: SessionInit: MT/GID/OID 2100 CMD
2022-08-26 11:28:41.298 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_session_init: MT/GID/OID 2100 CMD
2022-08-26 11:28:41.298 904-904/? I/qorvo.uwb.fira_helper: call_fira: call_id 1 session_id 1
2022-08-26 11:28:41.298 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.298 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_session_init: MT/GID/OID 2100 RSP 0
2022-08-26 11:28:41.298 904-904/? I/qorvo.uwb.uci_backend_fira: state_notification_with_code: MT/GID/OID 6102 NTF 0 (0)
2022-08-26 11:28:41.298 1750-27465/? D/uwb: uwb_uci_rust::uci: Received HAL UCI message SessionInitRsp(SessionInitRspPacket { uci_packet: UciPacketData { group_id: SessionConfig, message_type: Response, opcode: 0, child: UciResponse(UciResponseData { child: SessionResponse(SessionResponseData { child: SessionInitRsp(SessionInitRspData { status: UciStatusOk }) }) }) }, uci_response: UciResponseData { child: SessionResponse(SessionResponseData { child: SessionInitRsp(SessionInitRspData { status: UciStatusOk }) }) }, session_response: SessionResponseData { child: SessionInitRsp(SessionInitRspData { status: UciStatusOk }) }, session_init_rsp: SessionInitRspData { status: UciStatusOk } })
2022-08-26 11:28:41.298 1750-27465/? I/uwb: uwb_uci_rust::uci: UWB state change from W4UciResp to Ready
2022-08-26 11:28:41.298 1750-32530/? V/uwb: uwb_uci_rust::uci: SessionInitRsp(SessionInitRspPacket { uci_packet: UciPacketData { group_id: SessionConfig, message_type: Response, opcode: 0, child: UciResponse(UciResponseData { child: SessionResponse(SessionResponseData { child: SessionInitRsp(SessionInitRspData { status: UciStatusOk }) }) }) }, uci_response: UciResponseData { child: SessionResponse(SessionResponseData { child: SessionInitRsp(SessionInitRspData { status: UciStatusOk }) }) }, session_response: SessionResponseData { child: SessionInitRsp(SessionInitRspData { status: UciStatusOk }) }, session_init_rsp: SessionInitRspData { status: UciStatusOk } })
2022-08-26 11:28:41.298 1750-27465/? D/uwb: uwb_uci_rust::uci: Received hal notification SessionStatusNtf(SessionStatusNtfPacket { uci_packet: UciPacketData { group_id: SessionConfig, message_type: Notification, opcode: 2, child: UciNotification(UciNotificationData { child: SessionNotification(SessionNotificationData { child: SessionStatusNtf(SessionStatusNtfData { session_id: 1, session_state: SessionStateInit, reason_code: StateChangeWithSessionManagementCommands }) }) }) }, uci_notification: UciNotificationData { child: SessionNotification(SessionNotificationData { child: SessionStatusNtf(SessionStatusNtfData { session_id: 1, session_state: SessionStateInit, reason_code: StateChangeWithSessionManagementCommands }) }) }, session_notification: SessionNotificationData { child: SessionStatusNtf(SessionStatusNtfData { session_id: 1, session_state: SessionStateInit, reason_code: StateChangeWithSessionManagementCommands }) }, session_status_ntf: SessionStatusNtfData { session_id: 1, session_state: SessionStateInit, reason_code: StateChangeWithSessionManagementCommands } })
2022-08-26 11:28:41.298 1750-27465/? I/uwb: uwb_uci_rust::uci: Session 1 initialized, invoking session init HAL API
2022-08-26 11:28:41.299 1750-27465/? D/NativeUwbManager: onSessionStatusNotificationReceived(1, 0, 0)
2022-08-26 11:28:41.299 1750-27465/? I/UwbSessionManager: onSessionStatusNotificationReceived - Session ID : 1, state : INIT reasonCode:0
2022-08-26 11:28:41.299 1750-32530/? D/UwbConfManager: setAppConfigurations for protocol: fira
2022-08-26 11:28:41.300 1750-32530/? I/uwb: uwb_uci_jni_rust: Java_com_android_server_uwb_jni_NativeUwbManager_nativeSetAppConfigurations: enter
2022-08-26 11:28:41.300 1750-27465/? D/uwb: uwb_uci_rust::uci: Received blocking cmd UciSetAppConfig { session_id: 1, no_of_params: 44, app_config_param_len: 153, app_configs: [0, 1, 1, 1, 1, 2, 2, 1, 0, 3, 1, 0, 4, 1, 9, 5, 1, 1, 6, 2, 240, 242, 7, 2, 253, 183, 8, 2, 96, 9, 9, 4, 240, 0, 0, 0, 11, 1, 0, 12, 1, 3, 13, 1, 1, 14, 1, 1, 15, 2, 0, 0, 16, 2, 32, 78, 17, 1, 1, 18, 1, 3, 20, 1, 10, 21, 1, 2, 22, 1, 0, 23, 1, 1, 27, 1, 6, 28, 1, 0, 31, 1, 0, 35, 1, 0, 36, 1, 0, 37, 1, 50, 38, 1, 0, 39, 2, 0, 76, 40, 6, 0, 0, 0, 0, 0, 0, 41, 1, 1, 42, 2, 0, 0, 43, 4, 0, 0, 0, 0, 44, 1, 0, 45, 1, 0, 46, 1, 1, 47, 1, 3, 48, 4, 0, 0, 0, 0, 49, 1, 0, 53, 1, 1, 227, 1, 0, 228, 1, 0, 229, 1, 0] }
2022-08-26 11:28:41.300 1750-27465/? D/uwb: uwb_uci_rust::uci: Sending HAL UCI message UciCommandPacket { uci_packet: UciPacketData { group_id: SessionConfig, message_type: Command, opcode: 3, child: UciCommand(UciCommandData { child: SessionCommand(SessionCommandData { child: SessionSetAppConfigCmd(SessionSetAppConfigCmdData { session_id: 1, tlvs: [AppConfigTlv { cfg_id: DeviceType, v: [1] }, AppConfigTlv { cfg_id: RangingRoundUsage, v: [2] }, AppConfigTlv { cfg_id: StsConfig, v: [0] }, AppConfigTlv { cfg_id: MultiNodeMode, v: [0] }, AppConfigTlv { cfg_id: ChannelNumber, v: [9] }, AppConfigTlv { cfg_id: NoOfControlee, v: [1] }, AppConfigTlv { cfg_id: DeviceMacAddress, v: [240, 242] }, AppConfigTlv { cfg_id: DstMacAddress, v: [253, 183] }, AppConfigTlv { cfg_id: SlotDuration, v: [96, 9] }, AppConfigTlv { cfg_id: RangingInterval, v: [240, 0, 0, 0] }, AppConfigTlv { cfg_id: MacFcsType, v: [0] }, AppConfigTlv { cfg_id: RangingRoundControl, v: [3] }, AppConfigTlv { cfg_id: AoaResultReq, v: [1] }, AppConfigTlv { cfg_id: RngDataNtf, v: [1] }, AppConfigTlv { cfg_id: RngDataNtfProximityNear, v: [0, 0] }, AppConfigTlv { cfg_id: RngDataNtfProximityFar, v: [32, 78] }, AppConfigTlv { cfg_id: DeviceRole, v: [1] }, AppConfigTlv { cfg_id: RframeConfig, v: [3] }, AppConfigTlv { cfg_id: PreambleCodeIndex, v: [10] }, AppConfigTlv { cfg_id: SfdId, v: [2] }, AppConfigTlv { cfg_id: PsduDataRate, v: [0] }, AppConfigTlv { cfg_id: PreambleDuration, v: [1] }, AppConfigTlv { cfg_id: SlotsPerRr, v: [6] }, AppConfigTlv { cfg_id: TxAdaptivePayloadPower, v: [0] }, AppConfigTlv { cfg_id: PrfMode, v: [0] }, AppConfigTlv { cfg_id: KeyRotation, v: [0] }, AppConfigTlv { cfg_id: KeyRotationRate, v: [0] }, AppConfigTlv { cfg_id: SessionPriority, v: [50] }, AppConfigTlv { cfg_id: MacAddressMode, v: [0] }, AppConfigTlv { cfg_id: VendorId, v: [0, 76] }, AppConfigTlv { cfg_id: StaticStsIv, v: [0, 0, 0, 0, 0, 0] }, AppConfigTlv { cfg_id: NumberOfStsSegments, v: [1] }, AppConfigTlv { cfg_id: MaxRrRetry, v: [0, 0] }, AppConfigTlv { cfg_id: UwbInitiationTime, v: [0, 0, 0, 0] }, AppConfigTlv { cfg_id: HoppingMode, v: [0] }, AppConfigTlv { cfg_id: BlockStrideLength, v: [0] }, AppConfigTlv { cfg_id: ResultReportConfig, v: [1] }, AppConfigTlv { cfg_id: InBandTerminationAttemptCount, v: [3] }, AppConfigTlv { cfg_id: SubSessionId, v: [0, 0, 0, 0] }, AppConfigTlv { cfg_id: BprfPhrDataRate, v: [0] }, AppConfigTlv { cfg_id: StsLength, v: [1] }, AppConfigTlv { cfg_id: NbOfRangeMeasurements, v: [0] }, AppConfigTlv { cfg_id: NbOfAzimuthMeasurements, v: [0] }, AppConfigTlv { cfg_id: NbOfElevationMeasurements, v: [0] }] }) }) }) }, uci_command: UciCommandData { child: SessionCommand(SessionCommandData { child: SessionSetAppConfigCmd(SessionSetAppConfigCmdData { session_id: 1, tlvs: [AppConfigTlv { cfg_id: DeviceType, v: [1] }, AppConfigTlv { cfg_id: RangingRoundUsage, v: [2] }, AppConfigTlv { cfg_id: StsConfig, v: [0] }, AppConfigTlv { cfg_id: MultiNodeMode, v: [0] }, AppConfigTlv { cfg_id: ChannelNumber, v: [9] }, AppConfigTlv { cfg_id: NoOfControlee, v: [1] }, AppConfigTlv { cfg_id: DeviceMacAddress, v: [240, 242] }, AppConfigTlv { cfg_id: DstMacAddress, v: [253, 183] }, AppConfigTlv { cfg_id: SlotDuration, v: [96, 9] }, AppConfigTlv { cfg_id: RangingInterval, v: [240, 0, 0, 0] }, AppConfigTlv { cfg_id: MacFcsType, v: [0] }, AppConfigTlv { cfg_id: RangingRoundControl, v: [3] }, AppConfigTlv { cfg_id: AoaResultReq, v: [1] }, AppConfigTlv { cfg_id: RngDataNtf, v: [1] }, AppConfigTlv { cfg_id: RngDataNtfProximityNear, v: [0, 0] }, AppConfigTlv { cfg_id: RngDataNtfProximityFar, v: [32, 78] }, AppConfigTlv { cfg_id: DeviceRole, v: [1] }, AppConfigTlv { cfg_id: RframeConfig, v: [3] }, AppConfigTlv { cfg_id: PreambleCodeIndex, v: [10] }, AppConfigTlv { cfg_id: SfdId, v: [2] }, AppConfigTlv { cfg_id: PsduDataRate, v: [0] }, AppConfigTlv { cfg_id: PreambleDuration, v: [1] }, AppConfigTlv { cfg_id: SlotsPerRr, v: [6] }, AppConfigTlv { cfg_id: TxAdaptivePayloadPower, v: [0] }, AppConfigTlv { cfg_id: PrfMode, v: [0] }, AppConfigTlv { cfg
2022-08-26 11:28:41.300 1750-27465/? D/uwb: _id: KeyRotation, v: [0] }, AppConfigTlv { cfg_id: KeyRotationRate, v: [0] }, AppConfigTlv { cfg_id: SessionPriority, v: [50] }, AppConfigTlv { cfg_id: MacAddressMode, v: [0] }, AppConfigTlv { cfg_id: VendorId, v: [0, 76] }, AppConfigTlv { cfg_id: StaticStsIv, v: [0, 0, 0, 0, 0, 0] }, AppConfigTlv { cfg_id: NumberOfStsSegments, v: [1] }, AppConfigTlv { cfg_id: MaxRrRetry, v: [0, 0] }, AppConfigTlv { cfg_id: UwbInitiationTime, v: [0, 0, 0, 0] }, AppConfigTlv { cfg_id: HoppingMode, v: [0] }, AppConfigTlv { cfg_id: BlockStrideLength, v: [0] }, AppConfigTlv { cfg_id: ResultReportConfig, v: [1] }, AppConfigTlv { cfg_id: InBandTerminationAttemptCount, v: [3] }, AppConfigTlv { cfg_id: SubSessionId, v: [0, 0, 0, 0] }, AppConfigTlv { cfg_id: BprfPhrDataRate, v: [0] }, AppConfigTlv { cfg_id: StsLength, v: [1] }, AppConfigTlv { cfg_id: NbOfRangeMeasurements, v: [0] }, AppConfigTlv { cfg_id: NbOfAzimuthMeasurements, v: [0] }, AppConfigTlv { cfg_id: NbOfElevationMeasurements, v: [0] }] }) }) } }
2022-08-26 11:28:41.300 1750-27465/? I/uwb: uwb_uci_rust::uci: UWB state change from Ready to W4UciResp
2022-08-26 11:28:41.300 904-904/? I/qorvo.uwb.UciBackendAndroidCCC: SessionSetAppConfig: MT/GID/OID 2103 CMD
2022-08-26 11:28:41.300 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_session_set_app_config: MT/GID/OID 2103 CMD
2022-08-26 11:28:41.300 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_session_set_app_config: session_id=1
2022-08-26 11:28:41.300 904-904/? I/qorvo.uwb.fira_helper: call_fira: call_id 10 session_id 1
2022-08-26 11:28:41.300 904-904/? I/qorvo.uwb.uwbmac: report_nl_cb
2022-08-26 11:28:41.300 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.300 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_session_set_app_config: mac_state=3
2022-08-26 11:28:41.300 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_session_set_app_config: uci_state=0
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.fira_helper: call_fira: call_id 12 session_id 1
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.fira_helper: call_fira: call_id 10 session_id 1
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uwbmac: report_nl_cb
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_session_set_app_config: mac_state=3
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.fira_helper: call_fira: call_id 9 session_id 1
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uwbmac: report_nl_cb
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.fira_helper: call_fira: call_id 5 session_id 1
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_session_set_app_config: MT/GID/OID 4103 RSP 0
2022-08-26 11:28:41.301 904-904/? I/qorvo.uwb.uci_backend_fira: state_notification_with_code: MT/GID/OID 6102 NTF 3 (0)
2022-08-26 11:28:41.302 1750-27465/? D/uwb: uwb_uci_rust::uci: Received HAL UCI message SessionSetAppConfigRsp(SessionSetAppConfigRspPacket { uci_packet: UciPacketData { group_id: SessionConfig, message_type: Response, opcode: 3, child: UciResponse(UciResponseData { child: SessionResponse(SessionResponseData { child: SessionSetAppConfigRsp(SessionSetAppConfigRspData { status: UciStatusOk, cfg_status: [] }) }) }) }, uci_response: UciResponseData { child: SessionResponse(SessionResponseData { child: SessionSetAppConfigRsp(SessionSetAppConfigRspData { status: UciStatusOk, cfg_status: [] }) }) }, session_response: SessionResponseData { child: SessionSetAppConfigRsp(SessionSetAppConfigRspData { status: UciStatusOk, cfg_status: [] }) }, session_set_app_config_rsp: SessionSetAppConfigRspData { status: UciStatusOk, cfg_status: [] } })
2022-08-26 11:28:41.302 1750-27465/? I/uwb: uwb_uci_rust::uci: UWB state change from W4UciResp to Ready
2022-08-26 11:28:41.302 1750-27465/? D/uwb: uwb_uci_rust::uci: Received hal notification SessionStatusNtf(SessionStatusNtfPacket { uci_packet: UciPacketData { group_id: SessionConfig, message_type: Notification, opcode: 2, child: UciNotification(UciNotificationData { child: SessionNotification(SessionNotificationData { child: SessionStatusNtf(SessionStatusNtfData { session_id: 1, session_state: SessionStateIdle, reason_code: StateChangeWithSessionManagementCommands }) }) }) }, uci_notification: UciNotificationData { child: SessionNotification(SessionNotificationData { child: SessionStatusNtf(SessionStatusNtfData { session_id: 1, session_state: SessionStateIdle, reason_code: StateChangeWithSessionManagementCommands }) }) }, session_notification: SessionNotificationData { child: SessionStatusNtf(SessionStatusNtfData { session_id: 1, session_state: SessionStateIdle, reason_code: StateChangeWithSessionManagementCommands }) }, session_status_ntf: SessionStatusNtfData { session_id: 1, session_state: SessionStateIdle, reason_code: StateChangeWithSessionManagementCommands } })
2022-08-26 11:28:41.302 1750-27465/? D/NativeUwbManager: onSessionStatusNotificationReceived(1, 3, 0)
2022-08-26 11:28:41.302 1750-27465/? I/UwbSessionManager: onSessionStatusNotificationReceived - Session ID : 1, state : IDLE reasonCode:0
2022-08-26 11:28:41.302 1750-32530/? V/uwb: uwb_uci_rust::uci: SessionSetAppConfigRsp(SessionSetAppConfigRspPacket { uci_packet: UciPacketData { group_id: SessionConfig, message_type: Response, opcode: 3, child: UciResponse(UciResponseData { child: SessionResponse(SessionResponseData { child: SessionSetAppConfigRsp(SessionSetAppConfigRspData { status: UciStatusOk, cfg_status: [] }) }) }) }, uci_response: UciResponseData { child: SessionResponse(SessionResponseData { child: SessionSetAppConfigRsp(SessionSetAppConfigRspData { status: UciStatusOk, cfg_status: [] }) }) }, session_response: SessionResponseData { child: SessionSetAppConfigRsp(SessionSetAppConfigRspData { status: UciStatusOk, cfg_status: [] }) }, session_set_app_config_rsp: SessionSetAppConfigRspData { status: UciStatusOk, cfg_status: [] } })
2022-08-26 11:28:41.302 1750-32530/? I/UwbConfManager: setAppConfigurations respData: UwbConfigStatusData {  status = 0 length = 0, tlvs = [[]] }
2022-08-26 11:28:41.303 1750-32530/? I/UwbSessionNotiManager: IUwbRangingCallbacks - onRangingOpened
2022-08-26 11:28:41.304 1750-2025/? I/UwbSessionManager: sessionInit() : finish - sessionId : 1
2022-08-26 11:28:41.305 2692-31836/? I/NearbyUWB: UWB session opened: 1 [CONTEXT service_id=49 ]
2022-08-26 11:28:41.305 2692-29735/? I/NearbyUWB: exec UWB operation Start ranging [CONTEXT service_id=49 ]
2022-08-26 11:28:41.305 1750-3646/? I/UwbSessionManager: startRanging() - Session ID : 1
2022-08-26 11:28:41.306 1750-32531/? I/uwb: uwb_uci_jni_rust: Java_com_android_server_uwb_jni_NativeUwbManager_nativeRangingStart: enter
2022-08-26 11:28:41.306 1750-27465/? D/uwb: uwb_uci_rust::uci: Received blocking cmd UciStartRange(1)
2022-08-26 11:28:41.306 1750-27465/? D/uwb: uwb_uci_rust::uci: Sending HAL UCI message UciCommandPacket { uci_packet: UciPacketData { group_id: RangingSessionControl, message_type: Command, opcode: 0, child: UciCommand(UciCommandData { child: RangingCommand(RangingCommandData { child: RangeStartCmd(RangeStartCmdData { session_id: 1 }) }) }) }, uci_command: UciCommandData { child: RangingCommand(RangingCommandData { child: RangeStartCmd(RangeStartCmdData { session_id: 1 }) }) } }
2022-08-26 11:28:41.306 1750-27465/? I/uwb: uwb_uci_rust::uci: UWB state change from Ready to W4UciResp
2022-08-26 11:28:41.306 904-904/? I/qorvo.uwb.UciBackendAndroidCCC: RangingStart: MT/GID/OID 2200 CMD
2022-08-26 11:28:41.306 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_ranging_start: MT/GID/OID 2200 CMD
2022-08-26 11:28:41.306 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_ranging_start: session_id=1
2022-08-26 11:28:41.306 904-904/? I/qorvo.uwb.fira_helper: call_fira: call_id 10 session_id 1
2022-08-26 11:28:41.306 904-904/? I/qorvo.uwb.uwbmac: report_nl_cb
2022-08-26 11:28:41.306 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.306 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.310 1093-1093/? D/AOC: A3:MSG: controller.cc, 811: CNTRL: ipc: uwb_service, cmd ID: 0x00cd, tag: 0x3e, rc: 0
2022-08-26 11:28:41.310 1093-1093/? D/AOC: A3:MSG: controller.cc, 811: CNTRL: ipc: uwb_service, cmd ID: 0x00cb, tag: 0x3f, rc: 0
2022-08-26 11:28:41.311 1093-1093/? D/AOC: A3:MSG: controller.cc, 811: CNTRL: ipc: uwb_service, cmd ID: 0x00cd, tag: 0x40, rc: 0
2022-08-26 11:28:41.324 1093-1093/? D/AOC: A3:MSG: controller.cc, 811: CNTRL: ipc: uwb_service, cmd ID: 0x00cd, tag: 0x41, rc: 0
2022-08-26 11:28:41.334 904-904/? I/qorvo.uwb.fira_helper: call_fira: call_id 2 session_id 1
2022-08-26 11:28:41.336 904-904/? I/qorvo.uwb.uwbmac: ack_handler
2022-08-26 11:28:41.336 904-904/? I/qorvo.uwb.uci_backend_fira: uci_backend_fira_ranging_start: MT/GID/OID 2200 RSP 0
2022-08-26 11:28:41.337 904-904/? I/qorvo.uwb.uci_backend_fira: state_notification_with_code: MT/GID/OID 6102 NTF 2 (0)
2022-08-26 11:28:41.337 1750-27465/? D/uwb: uwb_uci_rust::uci: Received HAL UCI message RangeStartRsp(RangeStartRspPacket { uci_packet: UciPacketData { group_id: RangingSessionControl, message_type: Response, opcode: 0, child: UciResponse(UciResponseData { child: RangingResponse(RangingResponseData { child: RangeStartRsp(RangeStartRspData { status: UciStatusOk }) }) }) }, uci_response: UciResponseData { child: RangingResponse(RangingResponseData { child: RangeStartRsp(RangeStartRspData { status: UciStatusOk }) }) }, ranging_response: RangingResponseData { child: RangeStartRsp(RangeStartRspData { status: UciStatusOk }) }, range_start_rsp: RangeStartRspData { status: UciStatusOk } })
2022-08-26 11:28:41.337 1750-27465/? I/uwb: uwb_uci_rust::uci: UWB state change from W4UciResp to Ready
2022-08-26 11:28:41.337 1750-32531/? V/uwb: uwb_uci_rust::uci: RangeStartRsp(RangeStartRspPacket { uci_packet: UciPacketData { group_id: RangingSessionControl, message_type: Response, opcode: 0, child: UciResponse(UciResponseData { child: RangingResponse(RangingResponseData { child: RangeStartRsp(RangeStartRspData { status: UciStatusOk }) }) }) }, uci_response: UciResponseData { child: RangingResponse(RangingResponseData { child: RangeStartRsp(RangeStartRspData { status: UciStatusOk }) }) }, ranging_response: RangingResponseData { child: RangeStartRsp(RangeStartRspData { status: UciStatusOk }) }, range_start_rsp: RangeStartRspData { status: UciStatusOk } })
2022-08-26 11:28:41.337 1750-27465/? D/uwb: uwb_uci_rust::uci: Received hal notification DeviceStatusNtf(DeviceStatusNtfPacket { uci_packet: UciPacketData { group_id: Core, message_type: Notification, opcode: 1, child: UciNotification(UciNotificationData { child: CoreNotification(CoreNotificationData { child: DeviceStatusNtf(DeviceStatusNtfData { device_state: DeviceStateActive }) }) }) }, uci_notification: UciNotificationData { child: CoreNotification(CoreNotificationData { child: DeviceStatusNtf(DeviceStatusNtfData { device_state: DeviceStateActive }) }) }, core_notification: CoreNotificationData { child: DeviceStatusNtf(DeviceStatusNtfData { device_state: DeviceStateActive }) }, device_status_ntf: DeviceStatusNtfData { device_state: DeviceStateActive } })
2022-08-26 11:28:41.338 1750-27465/? D/NativeUwbManager: onDeviceStatusNotificationReceived(2)
2022-08-26 11:28:41.338 1750-27465/? I/UwbServiceCore: handleDeviceStatusNotification = ACTIVE
2022-08-26 11:28:41.338 1750-27465/? D/uwb: uwb_uci_rust::uci: Received hal notification SessionStatusNtf(SessionStatusNtfPacket { uci_packet: UciPacketData { group_id: SessionConfig, message_type: Notification, opcode: 2, child: UciNotification(UciNotificationData { child: SessionNotification(SessionNotificationData { child: SessionStatusNtf(SessionStatusNtfData { session_id: 1, session_state: SessionStateActive, reason_code: StateChangeWithSessionManagementCommands }) }) }) }, uci_notification: UciNotificationData { child: SessionNotification(SessionNotificationData { child: SessionStatusNtf(SessionStatusNtfData { session_id: 1, session_state: SessionStateActive, reason_code: StateChangeWithSessionManagementCommands }) }) }, session_notification: SessionNotificationData { child: SessionStatusNtf(SessionStatusNtfData { session_id: 1, session_state: SessionStateActive, reason_code: StateChangeWithSessionManagementCommands }) }, session_status_ntf: SessionStatusNtfData { session_id: 1, session_state: SessionStateActive, reason_code: StateChangeWithSessionManagementCommands } })
2022-08-26 11:28:41.339 1750-27465/? D/NativeUwbManager: onSessionStatusNotificationReceived(1, 2, 0)
2022-08-26 11:28:41.339 1750-27465/? I/UwbSessionManager: onSessionStatusNotificationReceived - Session ID : 1, state : ACTIVE reasonCode:0
2022-08-26 11:28:41.339 1750-32531/? I/UwbSessionNotiManager: IUwbRangingCallbacks - onRangingStarted
2022-08-26 11:28:41.340 2692-31836/? I/NearbyUWB: UWB ranging started [CONTEXT service_id=49 ]
2022-08-26 11:28:41.341 2692-31836/? I/NearbyUWB: Local UWB address is 0XF2F0 [CONTEXT service_id=49 ]
2022-08-26 11:28:41.341 2692-31836/? I/NearbyUWB: Local UWB address is 0XF2F0 [CONTEXT service_id=49 ]
2022-08-26 11:28:41.345 32373-32373/com.example.app I/UwbClientSessionScope: Started UWB ranging.
2022-08-26 11:28:41.391 904-904/? I/qorvo.uwb.uwbmac: report_nl_cb
2022-08-26 11:28:41.392 1750-27465/? D/uwb: uwb_uci_rust::uci: Received hal notification ShortMacTwoWayRangeDataNtf(ShortMacTwoWayRangeDataNtfPacket { uci_packet: UciPacketData { group_id: RangingSessionControl, message_type: Notification, opcode: 0, child: UciNotification(UciNotificationData { child: RangingNotification(RangingNotificationData { child: RangeDataNtf(RangeDataNtfData { sequence_number: 0, session_id: 1, rcr_indicator: 0, current_ranging_interval: 240, ranging_measurement_type: TwoWay, mac_address_indicator: ShortAddress, child: ShortMacTwoWayRangeDataNtf(ShortMacTwoWayRangeDataNtfData { two_way_ranging_measurements: [ShortAddressTwoWayRangingMeasurement { mac_address: 47101, status: UciStatusRangingRxTimeout, nlos: 0, distance: 0, aoa_azimuth: 0, aoa_azimuth_fom: 0, aoa_elevation: 0, aoa_elevation_fom: 0, aoa_destination_azimuth: 0, aoa_destination_azimuth_fom: 0, aoa_destination_elevation: 0, aoa_destination_elevation_fom: 0, slot_index: 2 }] }) }) }) }) }, uci_notification: UciNotificationData { child: RangingNotification(RangingNotificationData { child: RangeDataNtf(RangeDataNtfData { sequence_number: 0, session_id: 1, rcr_indicator: 0, current_ranging_interval: 240, ranging_measurement_type: TwoWay, mac_address_indicator: ShortAddress, child: ShortMacTwoWayRangeDataNtf(ShortMacTwoWayRangeDataNtfData { two_way_ranging_measurements: [ShortAddressTwoWayRangingMeasurement { mac_address: 47101, status: UciStatusRangingRxTimeout, nlos: 0, distance: 0, aoa_azimuth: 0, aoa_azimuth_fom: 0, aoa_elevation: 0, aoa_elevation_fom: 0, aoa_destination_azimuth: 0, aoa_destination_azimuth_fom: 0, aoa_destination_elevation: 0, aoa_destination_elevation_fom: 0, slot_index: 2 }] }) }) }) }, ranging_notification: RangingNotificationData { child: RangeDataNtf(RangeDataNtfData { sequence_number: 0, session_id: 1, rcr_indicator: 0, current_ranging_interval: 240, ranging_measurement_type: TwoWay, mac_address_indicator: ShortAddress, child: ShortMacTwoWayRangeDataNtf(ShortMacTwoWayRangeDataNtfData { two_way_ranging_measurements: [ShortAddressTwoWayRangingMeasurement { mac_address: 47101, status: UciStatusRangingRxTimeout, nlos: 0, distance: 0, aoa_azimuth: 0, aoa_azimuth_fom: 0, aoa_elevation: 0, aoa_elevation_fom: 0, aoa_destination_azimuth: 0, aoa_destination_azimuth_fom: 0, aoa_destination_elevation: 0, aoa_destination_elevation_fom: 0, slot_index: 2 }] }) }) }, range_data_ntf: RangeDataNtfData { sequence_number: 0, session_id: 1, rcr_indicator: 0, current_ranging_interval: 240, ranging_measurement_type: TwoWay, mac_address_indicator: ShortAddress, child: ShortMacTwoWayRangeDataNtf(ShortMacTwoWayRangeDataNtfData { two_way_ranging_measurements: [ShortAddressTwoWayRangingMeasurement { mac_address: 47101, status: UciStatusRangingRxTimeout, nlos: 0, distance: 0, aoa_azimuth: 0, aoa_azimuth_fom: 0, aoa_elevation: 0, aoa_elevation_fom: 0, aoa_destination_azimuth: 0, aoa_destination_azimuth_fom: 0, aoa_destination_elevation: 0, aoa_destination_elevation_fom: 0, slot_index: 2 }] }) }, short_mac_two_way_range_data_ntf: ShortMacTwoWayRangeDataNtfData { two_way_ranging_measurements: [ShortAddressTwoWayRangingMeasurement { mac_address: 47101, status: UciStatusRangingRxTimeout, nlos: 0, distance: 0, aoa_azimuth: 0, aoa_azimuth_fom: 0, aoa_elevation: 0, aoa_elevation_fom: 0, aoa_destination_azimuth: 0, aoa_destination_azimuth_fom: 0, aoa_destination_elevation: 0, aoa_destination_elevation_fom: 0, slot_index: 2 }] } })
2022-08-26 11:28:41.393 1750-27465/? D/NativeUwbManager: onRangeDataNotificationReceived : UwbRangingData {  SeqCounter = 0, SessionId = 1, RcrIndication = 0, CurrRangingInterval = 240, RangingMeasuresType = 1, MacAddressMode = 0, NoOfRangingMeasures = 1, RangingTwoWayMeasures = [UwbTwoWayMeasurement {  MacAddress = FDB7, RangingStatus = 33, NLoS = 0, Distance = 0, AoaAzimuth = 0.0, AoaAzimuthFom = 0, AoaElevation = 0.0, AoaElevationFom = 0, AoaDestAzimuth = 0.0, AoaDestAzimuthFom = 0, AoaDestElevation = 0.0, AoaDestElevationFom = 0, SlotIndex = 0x02000000}]}
2022-08-26 11:28:41.394 1750-27465/? I/UwbSessionNotiManager: IUwbRangingCallbacks - onRangingResult
2022-08-26 11:28:41.396 2692-32532/? I/NearbyUWB: UWB Ranging Data from peer 0XB7FD Status 33 [CONTEXT service_id=49 ]

Setting breakpoints in Qorvo cdw3000_mcps_mcu.c, I see a mcps_rxerror_cb.
The status is set to 0x3001307 which I think decodes the SYS_STATUS as:
PLLHILO Clock PLL Losing Lock
RCINIT
RXPHE Receiver PHY Header Error
RXSFDD Receiver SFD Detected
RXPRD Receiver Preamble Detected
SPICRCE SPI CRC Error
CPLOCK Clock PLL lock
IRQS
The important ones seem to be PLLHILO and RXPHE.
Not sure about PLLHILO, as perhaps the breakpoints are getting in the way, but PHR demod sounds bad.
Any ideas from Qorvo would be welcome…

For reference iOS gets a successful mcps_rx_cb with the SYS_STATUS set to 0x3006f07, which seems to confirm the RXPHE is the problem.

PHR demodulation
The main role of the PHY Header (PHR) is to convey the length of the data portion of the packet, and to indicate the data rate being employed for data demodulation. See paragraph 2.9 - PHY header and paragraph 2.10 for details of the PHY header. For data rates of 850 kb/s and 6.8 Mb/s the PHR is modulated / demodulated as per the 850 kb/s data rate (note that because Reed Solomon encoding is not applied to the PHR, its bit rate is approximately 1 Mb/s). If the PHR is indicating 850 kb/s then the data demodulation continues at this rate, but if the PHR is indicating 6.8 Mb/s then the demodulation changes to this rate at the end of the PHR as data demodulation begins.
It is also possible to configure the PHR rate to be the same as the data rate, i.e. to use 6.8 Mbit/s with PHR_6M8 configuration bit in SYS_CFG, 8.2.2.4.

hi ; meavydev

as your thread and your mentioned link which you asked and discussed to google android developer support as your link → Google Issue Tracker

i think google android UWB engineer team , they are recently developing something as you wish , but i am not sure it will relate to what your problem or not ,however , you can check this link and read the demo code, even not publish (completely ) yet on android documentation ( maybe not available yet , not sure ) , but soon they will publish it :slightly_smiling_face:

this is the link – > https://android-review.googlesource.com/q/owner:rpius%2540google.com

please let me know the link , i sent you , is the one or solution that you need to fix your problem in this topic thread ?? :thinking:

I’m not sure what you are pointing me at…
I am using AndroidX UWB on a Pixel 6 Pro and have raised issues on both here and against AndroidX UWB.
The problem is that is doesn’t work :wink:
So I am well aware that Google are implementing something…
But no your links don’t help fix it.

Just for info, a bit more progress on the Android side, as it appears that NearbyUWB is setting the channel and preamble index and ignoring the RangingParameters.
Unfortunately NearBy seems to be using different values, as I have seen 10 / 12 in the last two runs, so I can’t just hard code the preamble index!
https://issuetracker.google.com/issues/238964161

@meavydev
Hi, I am facing the exact same issue.

I checked what you shared.

I can’t find UWB settings about Android.
my question :Android and DWM3000EVB UWB Settings Inquiry

Could you please share how you solved it?

We are still waiting for a solution that works on Android.
Google say Qorvo are “working on it”, but nothing yet…
The only UWB kit Google knows of that actually supports Android at the moment is MK UWB Kit Mobile edition 2.0, a €650 kit.
Hopefully Qorvo and / or Estimote (who use Qorvo UWB internally in their beacons) will come up with an Android solution soon…

I have checked the MK UWB Kit as well.

I will share with you if I solved it.

Thanks for your reply

1 Like