Adding new libraries

Hello,

I'm new to software development so apologies if this is a simple question but I can't find a straightforward answer for nordic connect sdk on vs code.

An IC I'm trying to use comes with its own libraries, I have .c and .h versions of the file. How do I go about importing them to main.c? I've tried putting them in the src folder and including them but it doesn't seem to work.

I've tried External Library — Zephyr Project Documentation too but it has an extra MakeFile that I don't have and the CMakeLists file is a lot longer than the one given in sample projects so I'm not sure where to start.

Any info/resources would be greatly appreciated!

Parents
  • Hi,

    There are multiple ways to add external files.

    The sample you are pointing to is if you got a precompiled library, so this is not what you are looking for
    If you want to include c and h files in your project, there are two main ways to do that:

    1. Adding your own driver. For many use-cases this is more complex than you need. It is the "zephyr way" tho.
    2. Just adding your own files in CMakeLists.txt, as seen in our samples. For example here

    Regards,
    Sigurd Hellesvik

Reply
  • Hi,

    There are multiple ways to add external files.

    The sample you are pointing to is if you got a precompiled library, so this is not what you are looking for
    If you want to include c and h files in your project, there are two main ways to do that:

    1. Adding your own driver. For many use-cases this is more complex than you need. It is the "zephyr way" tho.
    2. Just adding your own files in CMakeLists.txt, as seen in our samples. For example here

    Regards,
    Sigurd Hellesvik

Children
Related