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.

CC2642R: HCI_EXT_ModemTestTxCmd() Issue

Part Number: CC2642R

My application seems to be going off the rails when I try to enter one of the radio test modes. I'm using the exact same call to HCI_EXT_ModemTestTxCmd() as in our R2F application which doesn't have any issues and starts transmitting at the requested frequency. If the user requests a test mode, I check if a BLE connection is active and close it if necessary, then advertising is disabled, and lastly the call to HCI_EXT_ModemTestTxCmd() is made:

                if (connected)
                {
                    rVal = GAP_TerminateLinkReq(CONNHANDLE_ALL, 0);
                    Log(LOG_CONSOLE_LEVEL, "Connection closed for test mode: %d\n", rVal);
                    //connected = 0;
                }

                rVal = GapAdv_disable(advHandleLegacy);
                Log(LOG_CONSOLE_LEVEL, "GapAdv_disable: Advertising disabled: %d\n", rVal);

                hci_ret = HCI_EXT_SetTxPowerCmd(HCI_EXT_TX_POWER_0_DBM);
                Log(LOG_CONSOLE_LEVEL, "Tx Power Set to 0dBm, 0x%x\n", hci_ret);

                if (testModeCmd >= eTEST_MODE_CW_2402MHz_0dBm &&
                        testModeCmd <= eTEST_MODE_CW_2480MHz_0dBm)
                {
                    HCI_EXT_ModemTestTxCmd(HCI_EXT_TX_UNMODULATED_CARRIER,
                                           testChannelIdxLookup[testModeCmd - eTEST_MODE_CW_2402MHz_0dBm]);
                }
                else if (testModeCmd >= eTEST_MODE_MOD_2402MHz_0dBm &&
                        testModeCmd <= eTEST_MODE_MOD_2480MHz_0dBm)
                {
                    HCI_EXT_ModemTestTxCmd(HCI_EXT_TX_MODULATED_CARRIER,
                                           testChannelIdxLookup[testModeCmd - eTEST_MODE_MOD_2402MHz_0dBm]);
                }
                else if (testModeCmd == eTEST_MODE_TX_HOP)
                {
                    HCI_EXT_ModemHopTestTxCmd();
                }

The watchdog gets tripped and my application resets. I disabled the watchdog and halted the processor after the offending HCI_EXT_ModemTestTxCmd() call, and it's sitting at ROM_Spinlock() in rom_init.c.

Any advice on how to debug this further? The only difference between the code above and our R2F application is using that GAPRole API's are used to close the connection and disable advertising. 

  • Hello Joshua,

    I've confirmed this behaviour as well on my side. Let me discuss internally with the development team and update when I have more information.

    Best wishes
  • Hi Joshua,

    For the BLE5 stack you must used the "enhanced" test commands (HCI_EXT_EnhancedModemTestTxCmd()). Refer to the BLE Stack HCI API documentation for details.

    Cheers,
    Fredrik
  • Thanks for the info Fredrik. It seems like it might be good to remove the legacy API's that cause the issue from the BLE5 stack documenation, to avoid confusion. That's assuming there isn't some stack configuration they are still valid for...

    The enhanced commands work for entering the test modes. However, the same issue occurs when I call HCI_EXT_EndModemTestCmd() to try to end the test. We can work around this as these modes are used infrequently, but I'm curious if there is a solution? I don't see a "HCI_EXT_EnhancedEndModemTestCmd()" API, should there be one or is one coming in the future?

    Thanks,
    Josh

  • Hi Josh,

    Some good news of sorts to report. After further investigation, the issue you are seeing can be corrected on your local SIMPLELINK-CC26x2-SDK v1.60 installation by modifying \source\ti\ble5stack\rom\r2\rom_init.c. Refer to ROM_Flash_JT[] entries on lines 530 & 539:

    #if defined(CTRL_V50_CONFIG)
      (uint32)LL_EXT_EndModemTest,                               // ROM_JT_OFFSET[150]
    #else // !CTRL_V50_CONFIG
      (uint32)ROM_Spinlock,
    #endif // CTRL_V50_CONFIG
      (uint32)LL_EXT_ExtendRfRange,                              // ROM_JT_OFFSET[151]
      (uint32)LL_EXT_GetConnInfo,                                // ROM_JT_OFFSET[152]
      (uint32)LL_EXT_HaltDuringRf,                               // ROM_JT_OFFSET[153]
      (uint32)LL_EXT_MapPmIoPort,                                // ROM_JT_OFFSET[154]
    #if defined(CTRL_V50_CONFIG)
      (uint32)LL_EXT_ModemHopTestTx,                             // ROM_JT_OFFSET[155]
      (uint32)LL_EXT_ModemTestRx,                                // ROM_JT_OFFSET[156]
      (uint32)LL_EXT_ModemTestTx,                                // ROM_JT_OFFSET[157]

    In the lines with #if !defined(CTRL_V50_CONFIG) remove the "!" such that they are as listed above and the respective table entries are compiled when CTRL_V50_CONFIG is defined (it is for the ble5stack)

    This issue has been corrected in the next SDK which is tentatively scheduled to be released in early Q2. In terms of whether to use the enhanced vs. legacy ModemTestTX API, it may be best to use the Enhanced variant going forward. Both APIs currently exist, but the enhanced version is a superset of the legacy.

    Best wishes

  • Thanks for getting back to me JXS. I made the suggested changes and things are working well!