Include header files in out of tree driver developement

Hi,

I tried the following ticket for out of tree developement ( Out-of-tree driver - Zephyr (freestanding app) )

It works,but i cannot able to access the header files of my driver from application, even from driver c files if placed in app/include/drivers... directory as mentioned in that ticket

I have also explained my case elaborately as a reply in that ticket,

i tried the following line in cmakelist.txt

list(APPEND SYSCALL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)

this also throws the error

fatal error: app/drivers/modem/modem_test.h: No such file or directory

is there any other cmake argument that should be included to access the header file???

Parents
  • Hi

    Please send me your minimal project and I will have a look at it.

    Do mention specifics (like the SDK, Board, and how you are compiling) about project.

    /BR, Naeem

  • ncs_oot_simple.zip

    SDK: v2.5.0

    Toolchain: v2.5.0

    Board: custom board(smart-remote-52840) available inside boards directory in .zip(board based on nrf52840)

    Built this project in nrf connect for vscode, u can open this project using "open existing project" option in nrf connect extension in vscode

    This .zip project will build without any error for the mentioned custom board, but if u move the "kscan_sx1508.h" header file into the "include/app/drivers/" folder and if i try to include the file in "kscan_sx1508.c", im getting undefined reference error

    Also i want to include this header file in my application "main.c" too, what should i need to add/change in my project to access my header file like "#include <app/drivers/kscan_sx1508.h>" in my project?? 

  • Hi,

    Please do the following changes in the project that you have sent. I am calling the main project folder as PROJECT.

    1) In the PROJECT/CMakeLists.txt, replace the line number 16 with:

    zephyr_include_directories(include/app/drivers)

    2) In the PROJECT/src/main.c, replace the line number 16 with:

    #include <kscan_sx1508.h>

    3) Move the file "kscan_sc1508.h" from PROJECT/drivers/kscan/      to     PROJECT/include/app/drivers/

    4) Replace the line number 27 of PROJECT/drivers/kscan/kscan_sc1508.c with:

    #include <kscan_sx1508.h>

    5) Remove line number 3 and line number 5 of PROJECT/drivers/kscan/CMakeLists.txt

    Showing the folder structure, file contents and compilations:

    Just attaching the whole project for reference.

    ncs_oot_simple.rar

    Regards,

    Naeem

Reply
  • Hi,

    Please do the following changes in the project that you have sent. I am calling the main project folder as PROJECT.

    1) In the PROJECT/CMakeLists.txt, replace the line number 16 with:

    zephyr_include_directories(include/app/drivers)

    2) In the PROJECT/src/main.c, replace the line number 16 with:

    #include <kscan_sx1508.h>

    3) Move the file "kscan_sc1508.h" from PROJECT/drivers/kscan/      to     PROJECT/include/app/drivers/

    4) Replace the line number 27 of PROJECT/drivers/kscan/kscan_sc1508.c with:

    #include <kscan_sx1508.h>

    5) Remove line number 3 and line number 5 of PROJECT/drivers/kscan/CMakeLists.txt

    Showing the folder structure, file contents and compilations:

    Just attaching the whole project for reference.

    ncs_oot_simple.rar

    Regards,

    Naeem

Children
Related