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 "

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 "

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?
Hi
Any update?Thanks.
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, ¶m, 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.
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, ¶m, 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.