This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CC2652R: Aoa, Use Both Array

Part Number: CC2652R
Other Parts Discussed in Thread: CC2642R

Tool/software: Code Composer Studio

2x  SimpleLink™ CC26x2R LaunchPad™

SimpleLink CC13X2-26X2 SDK 3.40

Code Composer Studio
Version: 9.3.0.00012

In our application we intend to use both antenna arraays simultaneously. From python application, setting aoa_sampling_control parameter results in activation of only one antenna array.

We are using a single master device with BOOSTXL-AOA which will be connected to one or more slave devices without any passive nodes. i.e. "only master device provides the AOA measurement" scenario.

1. What actions do we need to take (both in python and embedded RTLS master code) in order to achieve this functionality?

2. Assuming using both antenna arrays simultaneously is not possible, are there any other workarounds to switch the working arrays from one to another while the bluetooth connection is active and we are gathering AOA angles from one or more slave devices?

below is what we currently set AOA parameters to be from python side:

aoa_params = {
    "aoa_run_mode": "AOA_MODE_ANGLE",  ## AOA_MODE_ANGLE, AOA_MODE_PAIR_ANGLES, AOA_MODE_RAW
    "aoa_cc2640r2": {
        "aoa_cte_scan_ovs": 4,
        "aoa_cte_offset": 4,
        "aoa_cte_length": 20,
        "aoa_sampling_control": int('0x00', 16),
        ## bit 0   - 0x00 - default filtering, 0x01 - RAW_RF no filtering - not supported,
        ## bit 4,5 - 0x00 - default both antennas, 0x10 - ONLY_ANT_1, 0x20 - ONLY_ANT_2
    },
    "aoa_cc26x2": {
        "aoa_slot_durations": 1,
        "aoa_sample_rate": 4,
        "aoa_sample_size": 16,
        "aoa_sampling_control": int('0x10', 16),
        ## bit 0   - 0x00 - default filtering, 0x01 - RAW_RF no filtering,
        ## bit 4,5 - default: 0x10 - ONLY_ANT_1, optional: 0x20 - ONLY_ANT_2
        "aoa_sampling_enable": 1,
        "aoa_pattern_len": 6,
        "aoa_ant_pattern": [0, 1, 2, 3, 4, 5]
    }
}


  • We would like to elaborate on our second question as follows:

    In the previous sdk version 3.20, we found out that using both antenna arrays sequentially was possible. In 3.40 however, it seems only one antenna array is possible to set for AOA parameters (as mentioned above)

    What we want is to be able to use both antenna arrays while acquiring AOA like it was the case in 3.20 SDK. What embedded and/or python modifications needs to be done in 3.40 SDK to achieve that?

  • Hi,

    We just noticed that in SDK 3.20 in rtls_ctrl_aoa.c into RTLSCtrl_postProcessAoa after switch block ends there is a function called AOA_setupNextRun which, as we understand, switches antenna arrays. Can we implement the code in a similar way? Is there any limitations to do so? Why the latest SDK wasn't implemented in a similar way?

    Best regards

  • Hi,

    As you said the possibility to switch between the two antenna-arrays has been removed since SDK 3.40. This has been done in order to simplify the user experience and to avoid some of the instabilities encountered while using the two antenna-arrays.

    You can definitely modify the code in order to sample once using the first array, once using the second array. The solution you offer (consisting in using a kind of AOA_setupNextRun() function) seems a good idea.

    To finish, the modification you have done in the python script (that you shared in your first message) wil **NOT** allow you to use the 6 antennas (i.e. the 2 arrays). A modification of the embedded code is absolutely required to be able to use the two antenna-arrays.

    Best regards,

  • Hi Clement,

    Thank you for the reply. We just looked deeper into the code and noticed that, in the latest SDK 3.40, when we set "aoa_sampling_control": int('0x00', 16), to enable default filtering for all antenna arrays it goes into RTLS_CONFIG_NOT_SUPPORTED status in RTLSCtrl_setAoaParams function. On the other hand, in the SDK 3.30 for aoa_sampling_control equal to 0x00 it goes into AOA_initAntArray function where it activates all pins from 27 to 30. Also, we couldn't find where the pins of the BOOSTXL-AOA are activated in SDK 3.40. How can we activate all BOOSXL-AOA pins and defaul filtering in SDK 3.40?

    Best regards

  • Hi,

    Using SDK 3.40 with CC2642R/CC2652R, you cannot use more than one antenna array at the time. As a result, setting "aoa_sampling_control" to "int('0x00', 16)" in the python code leads to an error ("RTLS_CONFIG_NOT_SUPPORTED").

    In other words, the values authorized for "aoa_sampling_control" are the following: 0x10, 0x20, 0x11 and 0x21.
    Bit 0 selects the filtering type => 0x00 for default filtering, 0x01 for RAW_RF / no filtering.
    Bit 4 and 5 selects the antenna array to use => 0x10 for ONLY_ANT_1, 0x20 for ONLY_ANT_2
    As you mentioned, on the embedded code side, the function RTLSCtrl_initAoa() is responsible to validate the parameters set by the python script. If the parameters are not supported, the status RTLS_CONFIG_NOT_SUPPORTED is returned. But don't get me wrong, you will have to modify more than only the function RTLSCtrl_initAoa() to be able to use the parameters you want.

    So, to use both antenna arrays you will be required to modify the embedded code. As you can see on the "AOA welcome page" (and more precisely on the truth table provided), only one pin need to be toggled to use one or the other antenna array. This toggling might be done in the function RTLSCtrl_postProcessAoa(). You will also be required to implement the logic to handle the fact that data are coming from two different antenna arrays.

    I hope this will help,

    Kind regards,

  • Hi Clement,

    Great explanation, thanks. Now, it looks like we have problems with switching between antenna arrays. In RTLSCtrl_postProcessAoa, after switch block ends, we added something like below:

      // Initialize ant array switch pin
      if (antenna == ANT_ARRAY_A1x)
      {
        // Start with A2 (ANT_ARRAY pin high is A1, low is A2)
        PINCC26XX_setOutputValue(ANT_ARRAY, 0);
      }
      else
      {
        // Start with A1 (ANT_ARRAY pin high is A1, low is A2)
        PINCC26XX_setOutputValue(ANT_ARRAY, 1);
      }

    and it didn't work. Then, we tried the same code with PIN_setOutputValue() instead and looked to the status returned. It was PIN_NO_ACCESS. After, we found a function called RTLSSrv_initAntArray() which was used in RTLSMaster_setAoaParamsReq(rtlsAoaConfigReq_t *pConfig). We looked into rtlsAoaConfigReq_t structure and compared its SDK 3.40 and SDK 3.30 versions and found that in the older version there is a variable antArraySwitch which is setted into RTLSMaster_setAoaParamsReq by RTLSSrv_initAntArray function. Moreover, in its python example there is

    "aoa_ant_array_switch": 27,

    line which, we think, does the job. Could you give us some details how to get work antenna switching on the run?

    Best regards

  • Hi,

    We understood why we were getting PIN_NO_ACCESS: we forgot to open pins in AOA_initAntArray into AOA.c. Actually, the corresponding code was under #ifdef RTLS_PASSIVE block. Now, n RTLSCtrl_postProcessAoa, after switch block ends, we added:

      uint8_t pinStatus;
    
      // Initialize ant array switch pin
      if (antenna == ANT_ARRAY_A1x)
      {
        // Start with A2 (ANT_ARRAY pin high is A1, low is A2)
        pinStatus = PIN_setOutputValue(gPinHandle, ANT_ARRAY, 0);
      }
      else
      {
        // Start with A1 (ANT_ARRAY pin high is A1, low is A2)
        pinStatus = PIN_setOutputValue(gPinHandle, ANT_ARRAY, 1);
      }

    but antenna array still seems like there is no any switching. We get printouts like these:

    [02:18:2020 15:31:32:431794] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 18, "rssi": -65, "antenna": 1, "channel": 25}}
    [02:18:2020 15:31:32:532620] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 18, "rssi": -63, "antenna": 1, "channel": 33}}
    [02:18:2020 15:31:32:633189] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 26, "rssi": -63, "antenna": 1, "channel": 4}}
    [02:18:2020 15:31:32:834538] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 19, "rssi": -65, "antenna": 1, "channel": 20}}
    [02:18:2020 15:31:32:934790] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 10, "rssi": -65, "antenna": 1, "channel": 28}}
    [02:18:2020 15:31:33:036267] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 12, "rssi": -62, "antenna": 1, "channel": 36}}
    [02:18:2020 15:31:33:138081] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 24, "rssi": -63, "antenna": 1, "channel": 7}}
    [02:18:2020 15:31:33:239717] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 38, "rssi": -63, "antenna": 1, "channel": 15}}
    [02:18:2020 15:31:33:339879] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 30, "rssi": -66, "antenna": 1, "channel": 23}}
    [02:18:2020 15:31:33:442387] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 31, "rssi": -63, "antenna": 1, "channel": 31}}
    [02:18:2020 15:31:33:543099] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 38, "rssi": -63, "antenna": 1, "channel": 2}}
    [02:18:2020 15:31:33:643084] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 48, "rssi": -64, "antenna": 1, "channel": 10}}
    [02:18:2020 15:31:33:744569] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 38, "rssi": -63, "antenna": 1, "channel": 18}}
    [02:18:2020 15:31:33:846148] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 27, "rssi": -65, "antenna": 1, "channel": 26}}
    [02:18:2020 15:31:33:947322] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 29, "rssi": -63, "antenna": 1, "channel": 34}}
    [02:18:2020 15:31:34:048128] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 38, "rssi": -62, "antenna": 1, "channel": 5}}
    [02:18:2020 15:31:34:150027] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 38, "rssi": -64, "antenna": 1, "channel": 13}}
    [02:18:2020 15:31:34:251081] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 28, "rssi": -65, "antenna": 1, "channel": 21}}
    [02:18:2020 15:31:34:452588] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 37, "rssi": -66, "antenna": 1, "channel": 0}}
    [02:18:2020 15:31:34:553945] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 46, "rssi": -63, "antenna": 1, "channel": 8}}
    [02:18:2020 15:31:34:655082] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 45, "rssi": -63, "antenna": 1, "channel": 16}}
    [02:18:2020 15:31:34:755047] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 36, "rssi": -66, "antenna": 1, "channel": 24}}
    [02:18:2020 15:31:34:957444] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 35, "rssi": -63, "antenna": 1, "channel": 3}}
    [02:18:2020 15:31:35:058616] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 46, "rssi": -66, "antenna": 1, "channel": 11}}
    [02:18:2020 15:31:35:160800] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 35, "rssi": -64, "antenna": 1, "channel": 19}}
    [02:18:2020 15:31:35:261415] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 26, "rssi": -65, "antenna": 1, "channel": 27}}
    [02:18:2020 15:31:35:362822] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 26, "rssi": -63, "antenna": 1, "channel": 35}}
    [02:18:2020 15:31:35:463681] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 36, "rssi": -63, "antenna": 1, "channel": 6}}
    [02:18:2020 15:31:35:566293] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 41, "rssi": -65, "antenna": 1, "channel": 14}}
    [02:18:2020 15:31:35:666085] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 29, "rssi": -66, "antenna": 1, "channel": 22}}
    [02:18:2020 15:31:35:767928] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 30, "rssi": -64, "antenna": 1, "channel": 30}}
    [02:18:2020 15:31:35:869821] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 36, "rssi": -65, "antenna": 1, "channel": 1}}
    [02:18:2020 15:31:35:970061] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 46, "rssi": -63, "antenna": 1, "channel": 9}}
    [02:18:2020 15:31:36:071532] : {"name": "CC26x2 Master", "type": "aoa", "identifier": "80:6F:B0:31:AE:77", "payload": {"connHandle": 0, "angle": 34, "rssi": -63, "antenna": 1, "channel": 17}}
    

    Best regards

  • Hi,

    Can you verify the three following points:

    • Can you observe the expected antenna and antenna-array switching on the boosterpack? Please refer to the "AOA welcome page" (and more precisely on the truth table provided) to do so.
    • Can you verify if the two branches of your if are accessed?
    • Can you verify the error is not only due to an error when displaying the data?

    Best regards,

  • Hi Clement,

    Right after our previous post, we changed the code like this:

      // Initialize ant array switch pin
      if (status == 0)
      {
        // Start with A2 (ANT_ARRAY pin high is A1, low is A2)
        PINCC26XX_setOutputValue(ANT_ARRAY, 0);
        status = 1;
      }
      else
      {
        // Start with A1 (ANT_ARRAY pin high is A1, low is A2)
        PINCC26XX_setOutputValue(ANT_ARRAY, 1);
        status = 0;
      }

    Later, we connected pins 27 and 28 to the oscilloscope and observed that antenna-array and antenna switching occurs. We think, only data parameters from the host weren't changing, that's why were observing only "antenna": 1,. Also, we observed that we enter both statements in if block.

    After we inspected the signals in the oscilloscope, we found that although pin 27 was switching, pin 28 was switching only when pin 27 was in the HIGH state (even when pin 27 supposed to be LOW at that moment).  Here are some pictures:

    At the pictures, yellow one is pin 27 and the blue one is pin 28. We solved this problem by sending new AoA parameters through NPI (like host does with passive/master nodes).

    Next, we noticed that pin 27's switching is not strict as it should be: sometimes switching from HIGH to LOW or vice versa takes more than one connection interval. In the upper part of the last picture there are 3 clear moments like this. We thought that, our implementation might be not healthy enough so we decided to reproduce default examples of SDK 3.30 and see whether we made something incorrectly. We found that there was the same problem. Here is a picture of the persistence image we obtained from our oscilloscope:

    In this case, we set connection interval to 10 ms. There is clear trace of 'extended/passed' HIGH states in the left upper of the yellow upper line. Probably this is the reason why switching between two antenna-arrays was removed from the latest SDK 3.40. Is there any workaround to this issue in the latest SDK?

    Best regards

  • Hi,

    First of all, thank you for this very interesting and well documented post.

    I have to say this is the first time the problem you are mentioning is reported. I will open an internal ticket to trace it and let you know as soon as a fix is found.

    Kind regards,

  • Hi Clement,

    Thank you. We're glad to be helpful.

    Best regards