This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

prj.conf configuration not propagating to autoconf.h and .conf

I would like to use functions from the date_time and dk_buttons_and_leds libraries in an nRF91 application. I included the following lines in the application's prj.conf file:

CONFIG_DATE_TIME=y
CONFIG_DK_LIBRARY=y

After clicking "Open nRF Connect SDK Project" in Segger Embedded Studio only the CONFIG_DK_LIBRARY=y setting can be found in the application's autoconf.h and .config files. When building the application, attempting to call functions from the date_time library gives an "undefined reference to" error.

Can I ask how to properly include the date_time library and other SDK libraries into an application?

Parents
  • Hi.

    In general, I would say that you have done everything correctly.

    Some libraries might have dependencies that you have to enable (or disable) in order for them to be included though.

    However, I can not find any configuration option called "DATE_TIME". Where is it defined (or what library is included if it is defined)?

    So I can not tell if that is the issue here.

    Also, when you opened the project, you should get an error/warning if any dependency was not satisfied or you tried to set an option that is not supported.

    Best regards,

    Didrik

  • Hi,

    I wanted to include the library found at ncs/nrf/lib/date_time. As for where it is defined I am not sure, I simply found it in the CMake file in the lib folder.

    I could not see any warnings when configuring, but it appears as if I overlooked a dependency of the BSD_LIBRARY. (CONFIG_DATE_TIME).

    It appears as if CONFIG_NETWORKING and CONFIG_HEAP_MEM_POOL_SIZE are also needed. I was able to build successfully with the following configurations in the prj.conf file.

    CONFIG_DATE_TIME=y
    CONFIG_BSD_LIBRARY=y
    CONFIG_NETWORKING=y
    CONFIG_HEAP_MEM_POOL_SIZE=1024
    

  • Looks like the library is only available on the master branch. That explains why I could not find it.

    Anyway, good to hear that you got it working!

Reply Children
No Data
Related