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.

CC2340R5: Issue facing in Code is going in icall abord mode

Part Number: CC2340R5

Tool/software:

Hi ,

We are using the CC2340R5 device, which works as a peripheral in event-based mode. When we press a button on the device, it starts advertising for 1 second. However, if we press another button or the same button within 1 second, it enters an iCall abort state. Could you kindly inform us of the possible cause of this issue?"

please kindly see the image I have attached and please provide solution.

Thanks, and Regards

Balaji Wankhede

  • Hi Balaji Wankhede,

    Its possible that if the buttons are pressed too quickly some processing is still being done during the first button press that is causing the issue. Can you share what you are doing in your GPIO/Button interrupt/callback?

    Best Regards,

    Jan

  • Hello Jan,

    Thanks for your response.

    I would like to say that after button press, we are doing advertising for 1sec of duration but still it's going on within that time if we have to do some operation in that case it's going in icall_abord state so please provide recommended solution on this other wise we have to use watchdog to release from this state is there any way release from abord state provide your response on this issue.

    I have attached the changes done in my code please check it and let me know if any mistake i had done in that.

    Button Init and callback:

    bStatus_t ButtonModule_init(void)
    {
    Button_Params params;

    Button_init();
    Button_Params_init(&params);

    // Set the buttons parameters
    params.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
    params.buttonCallback = Button_Callback_func;
    params.debounceDuration = BUTTON_DEBOUNCE_DURATION;

    // Button2_handle = Button_open(CONFIG_BUTTON_1, &params); //CONFIG_SW1
    // Button1_handle = Button_open(CONFIG_BUTTON_0, &params);
    Button2_handle = Button_open(CONFIG_SW2, &params);
    Button3_handle = Button_open(CONFIG_SW3, &params);
    Button1_handle = Button_open(CONFIG_SW1, &params);

    if(Button2_handle == NULL || Button3_handle == NULL || Button1_handle == NULL )
    {
    return FAILURE;
    }

    return SUCCESS;
    }

    button callback:

    void Button_Callback_func(Button_Handle buttonHandle, Button_EventMask buttonEvents)
    {

    buttonpresstime = Button_getLastPressedDuration(buttonHandle);

    if (buttonHandle == Button1_handle)
    {
    Battery_Voltage = BatteryMonitor_getVoltage();
    if (buttonpresstime > 100 && buttonpresstime < 2000)
    {
    BLEAppUtil_invokeFunctionNoData((InvokeFromBLEAppUtilContext_t) start_adv_for_find_me);
    }
    if (buttonpresstime > 2000 && buttonpresstime < 15000)
    {
    BLEAppUtil_invokeFunctionNoData((InvokeFromBLEAppUtilContext_t) start_adv_for_follow_me);
    }
    }

    }

    void start_adv_for_find_me(void)

    {

    BLEAppUtil_advStart(peripheralAdvHandle_1, &advSetStartParamsSet_1);
    BLEAppUtil_advStart(peripheralAdvHandle_2, &advSetStartParamsSet_2);


    }

  • Hi,

    Looking at your code, it seems that if the button is pressed again within that 1 second, you call advStart() is that correct?

    Best Regards,

    Jan

  • Hi Jan,

    I suspect that when he presses the button within one second, the previously triggered advertisement set is still active. As a result, calling BLEAppUtil_advStart again without properly stopping the ongoing advertisement may be causing conflicts.

    To address this, I recommend calling BLEAppUtil_advStop before invoking BLEAppUtil_advStart. This ensures that any active advertising handles are closed before initiating a new advertisement, preventing overlapping advertisement sessions.

    Implementing this change has resolved the issue. Let me know if you have any other suggestions or if a different approach would be more suitable.

    Marking this as resolved.

    Regards,

    Megh