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.

LAUNCHXL-CC26X2R1: Icall Aborting in Bluetooth Files

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I’m using CC26x2 Launchpad with SDK v4.40 and BLE 5. (XDC tools: 3.62; SysConfig: version 1.7). I am facing a serious issue with ICall abort in the tasks I've created. Here is the problem: 

  • I created two tasks (named sensor_thread and Bluetooth_thread) with associated priorities
  • Both are ICall registered. However, OSAL SNV api calls in the task “Init function” work only in one of the two tasks
  • In the task where OSAL SNV API does not work, ICall_abort is being called by "GGS_SetParameter()" & "osal_snv_read()" API calls
  • After debugging by using breakpoints and the "step into tool" in CCS, we think that ICall_abort() is being called due to a timeout through the "icall_directAPI()" in Icall.c.
  • This is leading to the task situation shown in the below below, which shows the ROV view I'm seeing in CCS:

Icall is being used in the sensor_thread, where it works correctly. The ICall part of the code in this task is coded in the following way:

static void SensorThread_init(void)
{
    // ******************************************************************
    // NO STACK API CALLS CAN OCCUR BEFORE THIS CALL TO ICall_registerApp
    // ******************************************************************
    // Register the current thread as an ICall dispatcher application
    // so that the application can send and receive messages via ICall to Stack.
    ICall_registerApp(&selfEntity, &syncEvent);

    // Create an RTOS queue for message from profile to be sent to app.
    appMsgQueue = Util_constructQueue(&appMsg);

    // Wait for 0.5s for the bluetooth_interface thread to fully start
    Task_sleep(50000);

    // Read SNV data
    if (osal_snv_read(FLASH_NVID_SNV_DATA, sizeof(snv_data_t), &snv_data) != SUCCESS
            || snv_data.commissionFlag == 0) {
        snv_data.commissionFlag = 0;
        if (pAppCBs && pAppCBs->pfnCommissionCb) {
            pAppCBs->pfnCommissionCb(0);
        }
        Log_warning0("Not commissioned yet!");
    }
    else {
        if (pAppCBs && pAppCBs->pfnCommissionCb) {
            pAppCBs->pfnCommissionCb(1);
        }
        Log_info0("Device has been commissioned");
        pulseCounter = snv_data.pulseCounter;
        Log_info1("Pulse counter restored to %u", pulseCounter);
    }

    // Read RTC
    if (osal_snv_read(FLASH_NVID_RTC, sizeof(timestampOffset), &timestampOffset) != SUCCESS) {
        timestampOffset = 0;
        Log_warning0("RTC initialized to 0");
    }
    else {
        Log_warning1("RTC restored to %u", timestampOffset);
    }

Icall is also being used in the bluetooth_thread, where it does not work as expected. The ICall part of the code in this task is coded in the following way:

static void BLEThread_init(void)
{
    // ******************************************************************
    // NO STACK API CALLS CAN OCCUR BEFORE THIS CALL TO ICall_registerApp
    // ******************************************************************
    // Register the current thread as an ICall dispatcher application
    // so that the application can send and receive messages.
    ICall_registerApp(&selfEntity, &syncEvent);
    Log_info1("PRODUCTION firmware version %s", (IArg) VERSION);

    #ifdef USE_RCOSC
        RCOSC_enableCalibration();
    #endif // USE_RCOSC
    Log_info0("Check: BT 721");
    // Initialize queue for application messages.
    // Note: Used to transfer control to application thread from e.g. interrupts.
    Queue_construct(&appMsgQueue, NULL);
    appMsgQueueHandle = Queue_handle(&appMsgQueue);
    Log_info0("Check: BT 726");
    
    if (osal_snv_read(FLASH_NVID_GLOBAL_PACKET_ID, sizeof(globalPacketID), &globalPacketID) != SUCCESS) {
        globalPacketID = 0;
        Log_warning0("Global packet ID initialized to 0");
    }
    else {
        Log_warning1("Global packet ID restored to %u", globalPacketID);
    }

I have checked that ICALL_MAX_NUM_ENTITIES and ICALL_MAX_NUM_TASKS are 6 and 3. I tried increasing this to 10 and 5, respectively but the same error persists.

We are totally lost as to why Icall() is aborting. Could we please get some help?