Antenna pattern AoD

I'm using nRF5340 DK for BLE, AoD (Connection). I am also using the TX example from nordic. I can add extra antennas to the ant_patterns[] (up to 17), with no errors. I also changed #define BLE_ANT_PATTERN to 17. But in reality, while connecting to the chip (through the terminal (Linux)), The maximum number I could change is 10. Is there a pre-defined number somewhere else? 

I also changed CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN to 17, as you mentioned for nrf52833dk_nrf52833.config for My board (nRF5340) [in the child image).

I am using zephyr and west directly on a Linux VM, without the SDK. When the length is longer than 10, it gives me an error that I'm passing too many arguments. 

Could you pls help me with the error? 

Best, 

  • Hi

    From your screenshot it seems like you've set the array size to include/support 10 elements yourself ( char elem [10]; ), and then you get this error of too many arguments when trying to write 11 elements in your array (since 40 is printed twice). Can't you just increase the size of this array on your end, as I don't know of a restriction in the Zephyr controller on the number of antennas you can use.

    Best regards,

    Simon

  • Dear Simon, 

    I've already changed this value to more than 10 (for example 14), yet I still receive the same Error. May I ask if the Zephyr has any limitations on this? 

    Thanks a lot, 

    Best,

  • Not as far as I know but I have asked the developers to make sure. I will get back to you when I know. In the meantime, can you confirm that you also get the "too many arguments" when the number of elements are set to more than 10?

    Best regards,

    Simon

  • Hello, 

    Yes, here is a screenshot of what I receive every time after changing the char size. U can see the sizeArg = 1 all the time. 


    As an alternative, do you think I can read the antenna pattern from a .text file? (Instead of inputting a pattern as a command? I actually tried reducing the size of my command, so that I can have larger strings, but still, I get the same message.) Therefore, I think the problem should be somewhere else. 

    I'm very sorry for such a time-consuming question. I truly appreciate your patience and your kind responses. 

    Best, 

  • Hi

    Got an update from our devs: The Kconfig value of BT_CTLR_DC_MAX_ANT_SW_PATTERN_LEN is used by the controller to check that the provided number of antenna IDs is not greater than the value used during building. By default it's 12 as seen below.

    config BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN
        int "Maximum length of antenna switch pattern"
        range 2 38 if SOC_COMPATIBLE_NRF
        range 2 75 if !SOC_COMPATIBLE_NRF
        default 12
        help
          Defines maximum length of antenna switch pattern that controller
          is able to store. For nRF5x-based controllers, the hardware imposes
          the value is within range 2 to 38, where last value is maximum.
          For general use cases Bluetooth Core 5.1 spec. required the value
          to be within range 2 up to 75.

    Best regards,

    Simon

Related