Problems with running the HRM example (ANT+)

Hello.

I bought an nRF5340 DK board and am trying to run the HRM example (which uses the ANT+ protocol) on it. The standard (create a new application -> copy a sample) blinky starts and works well, while the standard HRM_TX does not work.
I'm getting an error related to ANT+ initialization (hrm_tx: ant_plus_key_set failed: -63).
I have an ANT+ key that I got from thisisant.com and I tried writing it into the prj.conf file and the ant_rpc.conf file (adding the line "CONFIG_ANT_LICENSE_KEY=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx -xxxx"). When it didn’t work out for me, I set “CONFIG_ANT_EVALUATION_KEY=y”.
What is this error? How to fix it?

I installed everything strictly according to the instructions from the video: https://youtu.be/yg2p-scEyUA (except for the last step since I couldn't open Kconfig —> Menuconfig, see screenshot below)

Thanks in advance, Victor

Parents
  • Hello,

    Please check out the following information:
    https://www.thisisant.com/APIassets/ANTnRFConnectDoc/doc/integration_notes.html#license-keys 

    For the nRF5340 the following applies:

    "If using the dual core automatic child image, the radio-adjacent or network core image (cpunet) configuration file will be either child_image/ant_rpc.conf or child_image/hci_ipc.conf."

    As a first step you can try to comment out the CONFIG_ANT_LICENSE_KEY setting and just using CONFIG_ANT_EVALUATION_KEY=y as a check for your build environment and HW. Any difference if you modify the existing example as-is (without create a new application)?

    Kenneth

  • В качестве первого шага вы можете попытаться закомментировать параметр CONFIG_ANT_LICENSE_KEY и просто использовать CONFIG_ANT_EVALUATION_KEY=y в качестве проверки вашей среды сборки и аппаратного обеспечения. Есть ли разница, если вы измените существующий пример как есть (без создания нового приложения)?

    That's exactly what I do.
    Take a close look at the second screenshot I attached to my post above.
    This is the file "child_image/ant_rpc.conf", I deleted the line with my ANT key (CONFIG_ANT_LICENSE_KEY), and also specified the parameter CONFIG_ANT_EVALUATION_KEY=y
    What am I doing wrong?

    Let's go through the stages of creating a new project with you.
    1) I create a new project, select "Copy a sample", I open it in a new VS window

    2) I go to the file "child_image/ant_rpc.conf", there I change to "CONFIG_ANT_EVALUATION_KEY=y"

    3) Then I create a new build. Just select nRF5340DK and click "build".

    4) The last step is I connect my board and click "Flash"

    It writes to me, saying that the device is programmed. Should work, right?

    Interestingly, this time I didn't get any errors. This is great!
    After waiting a couple of minutes, I still couldn't find my board using the Garmin Edge device.

    I'll translate: it says "To connect to the heart rate monitor, wear it".
    At this time, an error related to Ant+ is written on VCOM0:

    So what kind of error is this? Maybe my sequence of actions is incorrect? Maybe I'm missing something?
    <err> ant_init: ant_stack_init() failed: -22
    <err> ant_rpc_net: cmd handler missing cb

  • Hi Victor,

    Thanks for running these steps! I think we're getting there.

    The build log shown is for an nRF52840. If you are building for nRF52840, the license key needs to be set in prj.conf. Since it is a single core chip this is the only configuration file that applies (there is no child_image in this case and ant_rpc.conf is unused).

    If you are intending to build for your nRF5340, child_image/ant_rpc.conf is the correct file for the license switch. Use "Add Build Configuration" to set up a new build for board nrf5340dk_nrf5340_cpuapp. This will use the child_image feature to automatically build for the network core based on the configurations in the ant_rpc.conf file.

    Let me know if this works!

  • I apparently chose this by accident. Of course I'm working with nRF5340, and building a project for my board (nRF5340-DK).

    I rebuilt the project, but the error did not go away.

    Wherein I ran “git status” and everything seemed to be fine (as far as I understand).

    Also I don't have the "ant_rpc" folder in the "build" folder:

    Here are two autoconf.h files that I found in the project folder:

    The "CONFIG_ANT_LICENSE_KEY" field is not in any of them.

    I don't know if this will help you, but I put together a project for nRF53 (for my board) and am sending it to you. Maybe you can use some logs to determine the cause of the error.
    8206.sample.zip

    Thank you for your help, I hope that we can solve this problem.
    Sincerely, Victor!

  • As of sdk-nrf v2.6, ANT samples do not support sysbuild - the Kconfig auto header shows SB_* defines so I think that is the problem. The child image feature for the samples relies on partition manager to build ANT onto the network core.

    I believe the sysbuild checkbox should be unchecked by default in VS Code, but please confirm.

  • FINALLY!
    I was able to defeat Ant+.
    Yes, thank you very much, the problem was in sysbuild. I saw in Nordic's YouTube video that they check the "sysbuild" box.
    I racked my brain for many days and couldn’t figure out what the problem was. It's good that you were found!

    Then I'll ask more questions. Please tell me where I can get acquainted with all Ant+ profiles (I'm interested in cycling ones). And in general, where is the documentation on working with Ant+ for beginners like me?

  • This is a good place to start (must be logged into thisisant.com to view): https://www.thisisant.com/developer/resources/downloads/#documents_tab

    For nRF Connect SDK specific ANT documentation, see here: https://www.thisisant.com/APIassets/ANTnRFConnectDoc/

Reply Children
No Data
Related