This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

there is error code -22 whe using DF,how to solve it?

I use the DF example.In Rx.i use both nrf52833 boards as test.i use NCS 1.9.1.

In rx,i use the silab's 16 antenna array for receving antenna array.

because it has 16 antennas,i modify the configuation in nrf52833dk_nrf52833.overlay file.

&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 = <12>;*/
	dfe-antenna-num = <16>;
	/* 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 = <0x2>;*/
	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.
	 */
	dfegpio0-gpios = <&gpio0 3 0>;
	dfegpio1-gpios = <&gpio0 4 0>;
	dfegpio2-gpios = <&gpio0 28 0>;
	dfegpio3-gpios = <&gpio0 29 0>;

then i change the main.c file for new antenna partterns.

#if defined(CONFIG_BT_DF_CTE_RX_AOA)
/* Example sequence of antenna switch patterns for antenna matrix designed by
 * Nordic. For more information about antenna switch patterns see README.rst.
 */
/*切换顺序,11,12,1,2,10,3,9,4,8,7,6,5  12根天线*/
/*static const uint8_t ant_patterns[] = { 0x2, 0x0, 0x5, 0x6, 0x1, 0x4,
*					0xC, 0x9, 0xE, 0xD, 0x8, 0xA };*/
/*切换顺序,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16  16根天线*/
static const uint8_t ant_patterns[] = { 0x0, 0x8, 0x4, 0xC, 0x2, 0xA, 0x6, 0xE,
					0x1, 0x9, 0x5, 0xD, 0x3, 0xB, 0x7, 0xF };
/*切换顺序,4,8,12,16,3,7,11,15,,2,,6,10,14,1,5,9,13  16根天线*/
/*static const uint8_t ant_patterns[] = { 0x2, 0x0, 0x5, 0x6, 0x4, 0x9,
*					0xA, 0x8, 0xD, 0xE, 0xC, 0x1 };*/
#endif /* CONFIG_BT_DF_CTE_RX_AOA */

then i use Putty to get Rx's output,there is error.

success. Periodic sync established.

Enable receiving of CTE...

failed (err -22)

Scan disable...Success.

Waiting for periodic sync lost...

PER_ADV_SYNC[0]: [DEVICE]: 11:8A:AF:D5:82:F4 (random), tx_power 127, RSSI -58, CTE AOA, data length 0, data:

PER_ADV_SYNC[0]: [DEVICE]: 11:8A:AF:D5:82:F4 (random), tx_power 127, RSSI -63, CTE AOA, data length 0, data:

PER_ADV_SYNC[0]: [DEVICE]: 11:8A:AF:D5:82:F4 (random), tx_power 127, RSSI -51, CTE AOA, data length 0, data:

i use the gpio 3,4,28,29,then i use logical Analyzer to musure my io.They are allways zero.

how to solve this problem?

  • Try using Zephyr SDK since it is in more advance state regarding this sample application.

  • i try as you describled. but it does't work.i think that my  device have some problem.

    i use the zephyr 3.0.0,my out put are here.

    0> [DEVICE]: 36:C7:34:13:E1:19 (random), AD evt type 3, Tx Pwr: 127, RSSI -62  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 33:E0:6E:A3:84:BE (random), AD evt type 3, Tx Pwr: 127, RSSI -52  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 4E:CC:59:21:52:1E (random), AD evt type 0, Tx Pwr: 127, RSSI -64  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 4E:CC:59:21:52:1E (random), AD evt type 4, Tx Pwr: 127, RSSI -64  C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 5C:73:72:4C:94:81 (random), AD evt type 4, Tx Pwr: 127, RSSI -65  C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 39:E9:5F:4A:05:87 (random), AD evt type 3, Tx Pwr: 127, RSSI -63  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: FC:E8:06:24:66:29 (public), AD evt type 0, Tx Pwr: 127, RSSI -56  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> --- 12 messages dropped ---
    00> [DEVICE]: FC:E8:06:24:66:29 (public), AD evt type 4, Tx Pwr: 127, RSSI -55 EDIFIER Lolli Pods Plus C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 74:9E:F9:77:AF:EA (random), AD evt type 3, Tx Pwr: 127, RSSI -62  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 14:15:D3:3D:3E:52 (random), AD evt type 3, Tx Pwr: 127, RSSI -87  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 70:61:EE:22:88:0C (public), AD evt type 0, Tx Pwr: 127, RSSI -70  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 70:61:EE:22:88:0C (public), AD evt type 4, Tx Pwr: 127, RSSI -70 M-Pencil C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> PER_ADV_SYNC[0]: [DEVICE]: 15:A5:56:3E:EE:9B (random) synced, Interval 0x0780 (2400 ms), PHY LE 2M
    00> 
    00> success. Periodic sync established.
    00> 
    00> Enable receiving of CTE...
    00> 
    00> failed (err -22)
    00> 
    00> Scan disable...Success.
    00> 
    00> Waiting for periodic sync lost...

    my antenna array is silab.but it can't connect with my board.i use a turn connector,themn i use it to connect  to board.but err is the same.in last,there is -22.

  • Hi

    Error -22 points to an invalid argument being used, so depending on what function returns it, it's an invalid argument somewhere. 

    When using 4 GPIOs for DFE then antenna pattern count cannot be greater than 16 and maximum allowed value is 15. So if you need 16 antennas you need to add another DFE-GPIO to connect to the antenna array. Please see the README.rst of the direction_finding_connectionless_rx sample project.

    Best regards,

    Simon

  • ok,i see that there are  m reduce a anenna.aximum 15 antennae.i change the antennae partterns,i reduce a antenna.so i use the first 15 antenna.i change the antenna numbers 15 too..

    the next is my sonfiguration.nrf52833dk_nrf52833.overlay file ia here.

    /*
     * Copyright (c) 2021 Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    &radio {
    	status = "okay";
    	/* This is an example number of antennas that may be available
    	 * on antenna matrix board.
    	 */
    	/*dfe-antenna-num = <10>;*/
    	dfe-antenna-num = <15>;
    	/* This is an example switch pattern that will be used to set an
    	 * antenna for Tx PDU (period before start of Tx CTE).
    	 */
    	/*dfe-pdu-antenna = <0x1>;*/
    	dfe-pdu-antenna = <0x0>;
    
    	/* These are example GPIO pin numbers that are provided to
    	 * Radio peripheral. The pins will be acquired by Radio to
    	 * drive antenna switching when AoD is enabled.
    	 */
    	dfegpio0-gpios = <&gpio0 3 0>;
    	dfegpio1-gpios = <&gpio0 4 0>;
    	dfegpio2-gpios = <&gpio0 28 0>;
    	dfegpio3-gpios = <&gpio0 29 0>;
    };
    

    The main.c file is here.

    #if defined(CONFIG_BT_DF_CTE_RX_AOA)
    /*切换顺序,11,12,1,2,3,4,5,6,7,8,9,10  12根天线*/
    /*static const uint8_t ant_patterns[] = { 0x2, 0x0, 0x5, 0x6, 0x4, 0x9,
    *					0xA, 0x8, 0xD, 0xE, 0xC, 0x1 };*/
    /*切换顺序,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15    15根天线  */
    static const uint8_t ant_patterns[] = { 0x0, 0x8, 0x4, 0xC, 0x2, 0xA, 0x6, 0xE,
    			           0x1, 0x9, 0x5, 0xD, 0x3, 0xB, 0x7};
    /*切换顺序,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16  16根天线*/
    /*static const uint8_t ant_patterns[] = { 0x0, 0x8, 0x4, 0xC, 0x2, 0xA, 0x6, 0xE,
    *					0x1, 0x9, 0x5, 0xD, 0x3, 0xB, 0x7, 0xF };*/
    #endif /* CONFIG_BT_DF_CTE_RX_AOA */

    but there is still a err -22 as the same.

    [DEVICE]: 70:61:EE:22:88:0C (public), AD evt type 0, Tx Pwr: 127, RSSI -73  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 70:61:EE:22:88:0C (public), AD evt type 4, Tx Pwr: 127, RSSI -73 M-Pencil C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 1A:16:4D:BE:38:D4 (random), AD evt type 3, Tx Pwr: 127, RSSI -56  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 78:4C:65:40:37:6C (random), AD evt type 0, Tx Pwr: 127, RSSI -66  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 78:4C:65:40:37:6C (random), AD evt type 4, Tx Pwr: 127, RSSI -66  C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 25[DEVICE]: D2:9A:E3:F4:F3:0D (random), AD evt type 0, Tx Pwr: 127, RSSI -85  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 07:E6:31:EC:B0:37 (random), AD evt type 3, Tx Pwr: 127, RSSI -50  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> [DEVICE]: 2D:8B:89:10:55:FA (random), AD evt type 3, Tx Pwr: 127, RSSI -53  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
    00> 
    00> PER_ADV_SYNC[0]: [DEVICE]: 10:45:E8:91:D5:5A (random) synced, Interval 0x0780 (2400 ms), PHY LE 2M
    00> 
    00> success. Periodic sync established.
    00> 
    00> Enable receiving of CTE...
    00> 
    00> failed (err -22)
    00> 
    00> Scan disable...Success.
    00> 
    00> Waiting for periodic sync lost...
    00> 

  • Hi

    Then you need to find out which function is returning this -22 error, as there must be an invalid argument somewhere else in your project as well.

    Best regards,

    Simon

Related