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.