ant scan can't found any device

Hi 

I'm encountering a problem than the ANT device cannot be scanned. you can use project "ble_ant_app_hrm_v324"(ncs 324), and modify "

light_rx_open_head" to connect to your ant device, you will see the error "0x4015", and ant device cannot be scanned anymore. And, I use that project "ble_ant_app_hrm_v292" run with ncs 292(test code is same with "ble_ant_app_hrm_v324"), it does't report error.
Plase help me solve this issue. Thanks.


 ble_ant_app_hrm_v324.zipble_ant_app_hrm_v292.zip

Parents
  • Hello,

    If I remember correctly ant_channel_open() return 0x4015 means channel is in wrong state.

    Are you sure the channel is in closed state? E.g. wait for EVENT_CHANNEL_CLOSED before you open it again. When the issue occurs, what does sd_ant_channel_status_get() return?

    Kenneth

  • Hi,

    This issue occur then I do  ant_channel_close and can't get EVENT_CHANNEL_CLOSED response. And ant_channel_status_get() always is 2. 

  • Hi, root cause investigation is still pending. Support capacity is limited this week, so our response will be delayed until next week. We’ll update as soon as possible.

  • Hi,

    any update? Can we handle this issue this week?

  • Hello, we've spent some time analyzing the provided sample with the stack and were able to isolate a condition where the stack can stall if it is delayed long enough by another task.

    This is why CONFIG_LOG_MODE_IMMEDIATE Kconfig aggravates the issue, although there are scheduling context changes between sdk-nrf 2.9.2- and 3.2.4-aligned versions that also contribute. I still have not been able to reproduce this issue without CONFIG_LOG_MODE_IMMEDIATE. Please let me know if that does not match what you see.

    We are arranging to release an updated ANT version for sdk-nrf 3.2.4. The process will take a few weeks.

  • Hi,

    For now, I still config CONFIG_LOG_MODE_IMMEDIATE=y. But I don't do printfs in function antplus_evt_handler, all business operations are performed on another thread, and I am still receiving user feedback regarding this issue, and I can't reproduce it.

    err_code = ant_cb_register(&antplus_evt_handler);
    ...
    
    static void antplut_evt_post_event(async_param_t *param)
    {
        ant_evt_t *p_ant_evt = (ant_evt_t *)param->args.u.ptr;
        if (p_ant_evt == NULL)
        {
            logs_e("p_ant_evt is NULL\r\n");
            return;
        }
        background_scanner_process(p_ant_evt);
        ant_evt_handler(p_ant_evt, NULL);
        for (uint8_t i = 0; ant_dev_list[i].disp_evt_handler != NULL; i++)
        {
            if (p_ant_evt->channel == ant_dev_list[i].channel_num)
            {
                ant_dev_list[i].disp_evt_handler(p_ant_evt);
            }
        }
        vh_free(p_ant_evt);
        p_ant_evt = NULL;
    }
    
    static void antplus_evt_handler(ant_evt_t *p_ant_evt)
    {
        async_param_t param = {0};
        param.args.u.ptr = vh_malloc(0, sizeof(ant_evt_t));
        if (param.args.u.ptr == NULL)
        {
            return;
        }
        memcpy(param.args.u.ptr, p_ant_evt, sizeof(ant_evt_t));
        int ret = async_post(&async_ant, antplut_evt_post_event, &param, 0, false);
        if (ret)
        {
            vh_free(param.args.u.ptr);
            param.args.u.ptr = NULL;
        }
    }

    As you said, this problem is caused by other tasks taking over the time, It sounds like even if I configure CONFIG_LOG_MODE_IMMEDIATE=n, this problem might still be triggered, because there are other tasks in my project. Is this correct?

    Also, I will close the printfs, and then observe the situation on the user side.

Reply
  • Hi,

    For now, I still config CONFIG_LOG_MODE_IMMEDIATE=y. But I don't do printfs in function antplus_evt_handler, all business operations are performed on another thread, and I am still receiving user feedback regarding this issue, and I can't reproduce it.

    err_code = ant_cb_register(&antplus_evt_handler);
    ...
    
    static void antplut_evt_post_event(async_param_t *param)
    {
        ant_evt_t *p_ant_evt = (ant_evt_t *)param->args.u.ptr;
        if (p_ant_evt == NULL)
        {
            logs_e("p_ant_evt is NULL\r\n");
            return;
        }
        background_scanner_process(p_ant_evt);
        ant_evt_handler(p_ant_evt, NULL);
        for (uint8_t i = 0; ant_dev_list[i].disp_evt_handler != NULL; i++)
        {
            if (p_ant_evt->channel == ant_dev_list[i].channel_num)
            {
                ant_dev_list[i].disp_evt_handler(p_ant_evt);
            }
        }
        vh_free(p_ant_evt);
        p_ant_evt = NULL;
    }
    
    static void antplus_evt_handler(ant_evt_t *p_ant_evt)
    {
        async_param_t param = {0};
        param.args.u.ptr = vh_malloc(0, sizeof(ant_evt_t));
        if (param.args.u.ptr == NULL)
        {
            return;
        }
        memcpy(param.args.u.ptr, p_ant_evt, sizeof(ant_evt_t));
        int ret = async_post(&async_ant, antplut_evt_post_event, &param, 0, false);
        if (ret)
        {
            vh_free(param.args.u.ptr);
            param.args.u.ptr = NULL;
        }
    }

    As you said, this problem is caused by other tasks taking over the time, It sounds like even if I configure CONFIG_LOG_MODE_IMMEDIATE=n, this problem might still be triggered, because there are other tasks in my project. Is this correct?

    Also, I will close the printfs, and then observe the situation on the user side.

Children
No Data
Related