Undefined reference error - using zephyr and matter

Hello,

I'm trying to extend the matter light_switch example of matter to be able to use OpenThreads jam detection feature. For this I extended the existing prj.conf with CONFIG_OPENTHREAD_JAM_DETECTION=y

When I try to call I get an undefined reference to otJamDetectionStart, even though I included the jam_detection.h file at the top of the file.

The code where the error occurs:

otInstance *instance;
instance = otInstanceInitSingle();
otError err_code;

err_code = otJamDetectionStart(instance, my_jam_detection_callback, NULL);
return otJamDetectionIsEnabled(instance)

Does anybody know why this error occurs?

Thanks!

Emily

Parents
  • Hello,

    Thank you for contacting DevZone at NordicSemi.

    I would like to ask:

    Which nCS version you are using?
    How is your callback?

    I think all you need is:

    function call with callback parameter
    definition of callback
    header file(s) inclusion
    setting project configurations

    I was able to compile the sample (light_switch) with the modification as per your query in the ncs v2.2.0.

    These are configurations that I have used in the proj.conf:

    CONFIG_OPENTHREAD=y
    CONFIG_OPENTHREAD_JAM_DETECTION=y
    CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER=y

    And the header files:

    #include <openthread/jam_detection.h>

    Hope it helps.

    Regards,
    Naeem

  • After adding CONFIG_OPENTHREAD and CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER to the proj.conf file it now works.

    Just so that I understand it better. Are these two always required to be set if I want to work with OpenThread? (Or at least some form of CONFIG_OPENTHREAD_NORDIC_LIBRARY because there seem to be a few different ones)

    Thanks a lot for your help!

    Emily

Reply Children
Related