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 Reply Children
  • В качестве первого шага вы можете попытаться закомментировать параметр 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

  • I have tried to recreate what you are doing, but it seems to work here:

    An observation, I can see your have a very old nRF5340-PDK, which is no longer supported, ref:
    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrf/device_guides/working_with_nrf/nrf53/nrf5340.html 

    Kenneth

  • I have tried to recreate what you are doing, but it seems to work here:

    It's good that it works for you, but it doesn't solve my problem.
    I recently bought a NEW nRF5340-DK, I'm trying to run the usual example, showing my steps step by step - and it doesn't work. I turn to you for help, and you say: “Everything works for me.” Tell me, as a Nordic employee, what should I do in this situation? How should I react to the fact that it works for you, but not for me? My task is to run on my board.
    I DEFINITELY need to use Ant+ technology and that's why I bought the nRF 53 series board because they are the only ones that support Ant+ in your new development environment (NCS).

    I am asking for help in the hope that you will help me resolve my issue. If I do something wrong, correct me, tell me how to do it. If it doesn’t work for me specifically, tell me, maybe I should reinstall something.

    With all due respect to you and the time you spend on my questions, your answer did not bring me any closer to solving the problem. I really hope for a constructive response aimed at helping me with my question. At the end of the day, my goal is not to get into an argument with anyone or prove that the board doesn't work, but my goal is to RUN the Ant+ EXAMPLE CODE.

    Let us together try to solve this problem.
    For example, what does this error mean:
    <err> ant_init: ant_stack_init() failed: -22
    <err> ant_rpc_net: cmd handler missing cb
    I didn't find the answer. I am sure that you, as an employee, have a better understanding of your own product. If you personally don’t know the answer to my question, let’s ask an employee who can figure it out. After all, the one who programmed and wrote the Ant+ library for NCS.

    An observation, I can see your have a very old nRF5340-PDK, which is no longer supported, ref:
    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrf/device_guides/working_with_nrf/nrf53/nrf5340.html 

    As for the fact that I have “a very old nRF5340-PDK” - you are mistaken. I have a new nRF5340-DK (not PDK). Here's a photo:



    I sincerely ask you to help me with this question!
    I will look forward to your answer,
    Sincerely, Victor.

  • You can try to delete the build folder and re-compile to check if that helps. The last error you shared is due to -NRF_EINVAL if the ANT License Key argument is invalid, from the ant_interface.h:

    /******************************* RE/INITIALIZATION API *******************/
    
     /** @brief This function checks for a valid license key and initializes the ANT stack (including stack variables). It must be executed prior to any wireless protocol activity.
     *          By default, it will be called during kernel initialization by ANT for nRF Connect SDK initialization code.
     *
     * @warning This is an internal glue function intended for SYS_INIT, it is not necessary to call it directly. This function is only meaningful on processor cores used for radio communication and may have a dummy implementation on multicore SoC's.
     *
     * @param[in] aucLicenseKey is a pointer to an ANT License Key. This key is managed via the :kconfig:option:`CONFIG_ANT_LICENSE_KEY`.
     *
     * @retval  0 Success
     * @retval  -NRF_EPERM if the stack is not enabled
     * @retval  -NRF_EINVAL if the ANT License Key argument is invalid
     */
    ant_err_t ant_stack_init (const uint8_t *aucLicenseKey);

    So not something I can help you with directly, you would need to reach out to thisisant.com if there is problem with your license key.

    Edit: You can try to zip your project with the change to "child_image/ant_rpc.conf" and I can try to run it here.

    Kenneth

  • Good afternoon.
    Thank you for your quick response.

    The whole point here is that at the moment (see my steps above) I am NOT using my Ant+ key (I use CONFIG_ANT_EVALUATION_KEY=y). So I don't really understand how it can be invalid.

    Edit: You can try to zip your project with the change to "child_image/ant_rpc.conf" and I can try to run it here.

    I would be grateful to you. Let's check.
    I zipped the project file and uploaded it on DropMeFiles:
    https://dropmefiles.com/dMHKK

    By the way, maybe let's do the opposite? You managed to launch the project. Maybe you can zip it and send it to me, and I'll try to load it onto my nRF53 board

    Thank you!
    Sincerely, Victor.

Related