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.
Hello,
Sorry, not had time to try this yet.
Kenneth
Hi Kenneth
Briefly, the main test in this project is to repeatedly ANT scan open and close
I have reworked this project to make it more rigorous. To ensure that each close operation is successful, after executing ant_channel_close(ANT_BS_CHANNEL_NUMBER); I use a semaphore and continuously monitor for the callback below. The semaphore is released only after receiving the signal that the channel has been closed.

From the test results, everything runs normally at the beginning, but after about 2-3 minutes, the following exception occurs.

It can be seen that the ANT channel can no longer be closed normally, and this log continues indefinitely. It looks like the ANT thread can no longer recover and is permanently stuck in the logic that reports the channel close failure.
This example can be easily reproduced by using the following standard ANT device for testing. The test device is shown below:



Also, this issue seems to occur only on SDK-ANT 2.1.0; older versions do not have this issue.
Below it is reproduce project:
BR
Hello, we're looking into your issue now. I was able to reproduce it with your sample.
What was the reasoning behind introducing prints into the event handler? Have you seen this issue without the prints/sleep in place? I was not able to see it in that case, the scan loop runs to completion. It also seems that the issue doesn't occur using CONFIG_LOG_MODE_DEFERRED=y instead of CONFIG_LOG_MODE_IMMEDIATE. Since the ANT work queue that handles events is cooperative, blocking in the handler starves event dispatch and is discouraged by Zephyr's work queue constraints.
I hope one of those options can unblock your development while we look for a root cause.
Hi,
I have moved my bussiness code in "antplus_evt_handler" to another thread, including the printfs, and the issue not happen for now. But we still hope to know the root cause, and fix it.
Thank you.
Hi,
About this issue, have any update? I have no printfs in "antplus_evt_handler", but I get some feedback that still report 0x4015.
Hi,
About this issue, have any update? I have no printfs in "antplus_evt_handler", but I get some feedback that still report 0x4015.
Hi,
This issue is affecting our project schedule. Please assist in resolving it and provide the expected repair time. Thank you.
Thanks for checking in, we're working to reproduce this issue now. Is the ANT traffic still the same as the sample project? How frequent are the 0x4015 errors? If you have a log with the latest code we can take a look.
Hi,
The project ble_ant_app_hrm_v324.zip and ble_ant_app_hrm_v292.zip that I have provide before, the code is the same, but it has issuse running on V324, while it runs normally on V292. It seems to be unrelated to the printfs? Can you check the differences between the ncs v324 and v292?
HI
Did you find the reason why version 292 doesn't have this problem?
We're still attempting to reproduce the issue on our side with v3.2.4 and the modified handler. If you're able to share a log from that build, even a short one showing the first occurrence, that would be helpful.
As far as the v2.9.2 differences, there were no changes to event dispatch in the ANT components. We are evaluating SDK dependencies between versions to determine if timing and context changes exposed an issue. I will update you as soon as I have more information.