Direction finding connectionless rx "Waiting for periodic sync... failed (err -11)"

Hello,

I am working on direction finding connectionless locator/beacon (AoA). 

I ran into a problem in the locator. Everything works fine until  "Waiting for periodic sync... failed (err -11)"


RX console log:

*** Booting Zephyr OS build v3.1.99-ncs1  ***
Starting Connectionless Locator Demo
Bluetooth initialization...success
Scan callbacks register...success.
Periodic Advertising callbacks register...success.
Start scanning...success
Waiting for periodic advertising...
[DEVICE]: 37:90:22:59:FC:F1 (random), AD evt type 5, Tx Pwr: 127, RSSI -86 DF Connectionless Beacon C:0 S:0 D:0 SR:0 E:1 Prim: LE 1M, Secn: LE 2M, Interval: 0x0060 (120 ms), SID: 0
success. Found periodic advertising.
Creating Periodic Advertising Sync...success.
Waiting for periodic sync...
PER_ADV_SYNC[0]: [DEVICE]: 37:90:22:59:FC:F1 (random) sync terminated
failed (err -11)
Deleting Periodic Advertising Sync...success
Waiting for periodic advertising...


TX console log:

*** Booting Zephyr OS build v3.1.99-ncs1  ***
Starting Connectionless Beacon Demo
Bluetooth initialization...success
Advertising set create...success
Update CTE params...success
Periodic advertising params set...success
Enable CTE...success
Periodic advertising enable...success
Extended advertising enable...success
Started extended advertising as E4:40:51:F4:19:3C (random)
 

I use sample code NRF/direction_finding_connectionless from nRF connect SDK v2.1.1.
For locator I use custom antenna array 3x3 (8 segments) with ubx Nora B101 (nRF5340). 
Beacon is also custom with ubx Nora B101 (nRF5340).
Build board is based on nrf5340dk_nrf5340_cpuapp.

According to the readme file, I modified the files (locator)
boards/nrf5340dk_nrf5340_cpunet.overlay

&gpio_fwd {
    dfe-gpio-if {
        gpios = <&gpio0 29 0>,
            <&gpio0 28 0>,
            <&gpio0 30 0>,
            <&gpio0 31 0>;
        };
};

child_image/child_image/boards/nrf5340dk_nrf5340_cpuapp.overlay
&radio {
    status = "okay";
    /* This is a number of antennas that are available on antenna matrix
     * designed by Nordic. For more information see README.rst.
     */
    dfe-antenna-num = <8>;
    /* This is a setting that enables antenna 12 (in antenna matrix designed
     * by Nordic) for Rx PDU. For more information see README.rst.
     */
    dfe-pdu-antenna = <0x0>;

    /* These are GPIO pin numbers that are provided to
     * Radio peripheral. The pins will be acquired by Radio to
     * drive antenna switching when AoA is enabled.
     * Pin numbers are selected to drive switches on antenna matrix
     * desinged by Nordic. For more information see README.rst.
     *
     * NOTE: Make sure to select the same GPIOs in the application core DTS
     * overlay's gpio_fwd node.
     */
    dfegpio0-gpios = <&gpio0 29 0>;
    dfegpio1-gpios = <&gpio0 28 0>;
    dfegpio2-gpios = <&gpio0 30 0>;
    dfegpio3-gpios = <&gpio0 31 0>;
};
main
static const uint8_t ant_patterns[] = { 0x0, 0x4, 0x2, 0x6, 0x1, 0x5, 0x3, 0x7}; 
in beacon file I add AoD config into project config. 


Are there any other changes required, or what could cause this error?

Thank you.
  • Hi,

    Our direction finding expert is OoO and I am assigned to look into this. I would like to reproduce this at my end so that I get more insights on what the error is. Are you getting this error with an out of the box sample (apart from the overlay changes you made)? or do I need to get some other source files from you to be able replicate this at my desk?

  • Hi, 

    yes, it is out of the box sample with the changes described above. 
    One more thing i use internal 32kHz oscillator. Could this be the problem? 

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y
  • Hi

    Error message -11 stands for EAGAIN, and urges you to try again, maybe because one of the processes you're trying to start is not ready. Have you tried to do debugging to find out what function returns -11? 

    in beacon file I add AoD config into project config.

    It could be related to this, as you should not add the AoD config in an AoA project. Both the TX and RX applications have to be configured to use AoA to work correctly. Using the synthetic 32kHz oscillator should not cause issues here as far as I know. Are you certain that the pins P0.28-P0.31 are the ones the UBlox module use to physically connect to the antenna array you're using?

    Best regards,

    Simon

  • Hi 

    in beacon file I add AoD config into project config.

    Sorry I mean AoA config. 

    Are you certain that the pins P0.28-P0.31 are the ones the UBlox module use to physically connect to the antenna array you're using?

    Yes P0.28 - P0.31 are used to switch antennas. Antenna switching should work. I tied settup an inital antenna segment using "dfe-antenna-num = <8>; ... " and the state of the pins changes as it should.

    I don't know how exactly debbug it. Do you have any advice?
    I was looking at Beacon via  nRF sniffer and it looks like therewill be a problem. Beacon starts advertising with two/three messages and then nothing, but no error message appears in the console. 

    *** Booting Zephyr OS build v3.1.99-ncs1  ***
    Starting Connectionless Beacon Demo
    Bluetooth initialization...success
    Advertising set create...success
    Update CTE params...success
    Periodic advertising params set...success
    Enable CTE...success
    Periodic advertising enable...success
    Extended advertising enable...success
    Get extended advertising address...success
    Started extended advertising as E4:40:51:F4:19:3C (random)
    


    Only error appears in locator: 

    success. Found periodic advertising.
    Creating Periodic Advertising Sync...success.
    Waiting for periodic sync...
    PER_ADV_SYNC[0]: [DEVICE]: 03:2F:7D:3C:E8:D1 (random) sync terminated
    failed (err -11)
    

    wich makes sense if the beacon stop working the locator can't sync. 

     What needs to be modified to make direction finding connectionless tx work as a beacon?
    Just add AoA config or is there something else? 

    Thank you.

  • Hi

    On the transmitter side, you need to set the OVERLAY_CONFIG to overlay-aoa.conf. In addition, on the nRF5340 DK, you need to add the content of overlay-aoa.conf file to child_image/hcirpmsg.conf, that you might have missed.

    Best regards,

    Simon

Related