Issue with k_sleep() in the ipt_initiator Sample.

Hello,

I am currently testing the `ipt_initiator` sample on the nRF54L15-DK v1.0.0 using nRF Connect SDK v3.3.1.

When I call `k_sleep()` inside the loop in the `main()` function, the following error occurs:


I: Distance estimates: median: 0.95m, update: 0.98m, time_delta: 1012ms
I: Distance estimates: median: 0.95m, update: 0.98m, time_delta: 1012ms
I: Distance estimates: median: 0.98m, update: 0.99m, time_delta: 1514ms
I: Distance estimates: median: 0.98m, update: 0.89m, time_delta: 510ms
I: Distance estimates: median: 0.98m, update: 0.93m, time_delta: 1011ms
E: SoftDevice Controller ASSERT: 142, 151
E: ***** HARD FAULT *****
E: Fault escalation (see below)
E: ARCH_EXCEPT with reason 3

E: r0/a1: 0x00000003 r1/a2: 0x00000001 r2/a3: 0x00000000
E: r3/a4: 0x00000003 r12/ip: 0x00000000 r14/lr: 0x0002bbf9
E: xpsr: 0x210000f5
E: s[ 0]: 0x00000097 s[ 1]: 0x00323431 s[ 2]: 0x00000000 s[ 3]: 0x00000000
E: s[ 4]: 0x0002bbd5 s[ 5]: 0x000008d9 s[ 6]: 0x0000008e s[ 7]: 0x00323431
E: s[ 8]: 0x000057e4 s[ 9]: 0x000057e4 s[10]: 0x200027e0 s[11]: 0x000057c5
E: s[12]: 0x20002700 s[13]: 0x200023b0 s[14]: 0x200027f8 s[15]: 0x20001658
E: fpscr: 0x00000000
E: Faulting instruction address (r15/pc): 0x0002bc06
E: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
E: Fault during interrupt handling

E: Current thread: 0x20003f38 (unknown)
*** Booting nRF Connect SDK v3.3.1-1d7a0b0e49b8 ***
*** Using Zephyr OS v4.3.99-37e6c28576ee ***
I: Starting Channel Sounding IPT Initiator Sample
I: SoftDevice Controller build revision:
I: fc 51 7a e9 58 2c 6f fb |.Qz.X,o.
I: 6d 35 9f 17 3e 08 c8 c1 |m5..>...
I: 7b e9 5b 95 |{.[.
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF54Lx (0x0005)
I: Firmware: Standard Bluetooth control

This issue does not occur if I do not call `k_sleep()`.

My goal is to send the Channel Sounding measurement results to a smartphone every 500 ms. Is there a recommended way to achieve this without causing the above error?

I have attached the project ZIP file for your reference.

Thank you in advance for your support.

Best regards.

Kenta


cs_ipt_initiator.zip

Parents
  • Hi Kenta! 

    If you just want to produce a single distance estimate every 500 ms you can change the connection interval and CS procedure interval that is being used in the ipt_initiator sample.

    Note that the CS procedure interval configured here https://github.com/nrfconnect/sdk-nrf/blob/b466e871ffdc67c6361a71012bbb706df971c51a/samples/bluetooth/channel_sounding/ipt_initiator/src/main.c#L645 is in units of connection intervals.

    The connection interval is configured here in the ipt_initiator: https://github.com/nrfconnect/sdk-nrf/blob/b466e871ffdc67c6361a71012bbb706df971c51a/samples/bluetooth/channel_sounding/ipt_initiator/src/main.c#L573 

    You could for example change the connection interval to 50 ms by setting

    .conn_param = BT_LE_CONN_PARAM(40, 40, 0, BT_GAP_MS_TO_CONN_TIMEOUT(4000))

    and the CS procedure interval to 10 by setting

    	uint16_t desired_procedure_interval = 10;

    This will give a resulting CS procedure interval of 10 * 50 ms = 500 ms. 

    The sample produces one distance estimate per CS procedure so you should see something like this in the logs:

    I: Distance estimates: median: 0.86m, update: 0.86m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.85m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.86m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.85m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.85m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.87m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.87m, update: 0.86m, time_delta: 500ms
    I: Distance estimates: median: 0.87m, update: 0.86m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.85m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.86m, time_delta: 500ms
    

    And note that the median estimate here might not make sense anymore if you are only estimating new distances every 500 ms unless you know both devices are stationary.

Reply
  • Hi Kenta! 

    If you just want to produce a single distance estimate every 500 ms you can change the connection interval and CS procedure interval that is being used in the ipt_initiator sample.

    Note that the CS procedure interval configured here https://github.com/nrfconnect/sdk-nrf/blob/b466e871ffdc67c6361a71012bbb706df971c51a/samples/bluetooth/channel_sounding/ipt_initiator/src/main.c#L645 is in units of connection intervals.

    The connection interval is configured here in the ipt_initiator: https://github.com/nrfconnect/sdk-nrf/blob/b466e871ffdc67c6361a71012bbb706df971c51a/samples/bluetooth/channel_sounding/ipt_initiator/src/main.c#L573 

    You could for example change the connection interval to 50 ms by setting

    .conn_param = BT_LE_CONN_PARAM(40, 40, 0, BT_GAP_MS_TO_CONN_TIMEOUT(4000))

    and the CS procedure interval to 10 by setting

    	uint16_t desired_procedure_interval = 10;

    This will give a resulting CS procedure interval of 10 * 50 ms = 500 ms. 

    The sample produces one distance estimate per CS procedure so you should see something like this in the logs:

    I: Distance estimates: median: 0.86m, update: 0.86m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.85m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.86m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.85m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.85m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.87m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.87m, update: 0.86m, time_delta: 500ms
    I: Distance estimates: median: 0.87m, update: 0.86m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.85m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.87m, time_delta: 500ms
    I: Distance estimates: median: 0.86m, update: 0.86m, time_delta: 500ms
    

    And note that the median estimate here might not make sense anymore if you are only estimating new distances every 500 ms unless you know both devices are stationary.

Children
Related