-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Including header files from modules into app #25956
Comments
Is your source that has: If the source is part of the app lib, then it ought to work, but for further investigation, then verbose built output for the compilation of the source would be needed. If the source is part of another lib, such as
|
@ngoma94 First you should not include the HAL header in app. This should really be done using the APIs provided by Zephyr. Can you please share what you found missing in current Zephyr API so that we can work together to add it if reasonable? |
@tejlmand @Mani-Sadhasivam I imagine that the goal of the API is to keep the driver simple and user-friendly. I think, however, that it would be nice to also allow flexibility for users with less generic applications. At the very least, it would be able to write (and read) the chips registers. The functionality is already available in the driver module; it just isn't exposed by the API. |
@ngoma94 I assume you have some CMake library that needs to know the loramac-node include directory. All
assuming Another approach is to simply add the include to your library in this way:
Besides those examples, I also agree with @Mani-Sadhasivam that if you can reason your needs, then this could problably be improved in Zephyr for a better user experience. |
Thanks for all your help, guys. I ended up writing my own version of the driver, allowing me to configure the chip as I needed. I do think the current Zephyr driver could do with some expansion. I might consider submitting a suggestion when I'm done with my project. Thanks again, everyone. |
Happy you got it working, although not so good you had to write your own version.
Please do. |
@ngoma94 I've just encountered a similar issue where I'd need to set the module with FSK modulation. By any chance - is there anything you could share about your driver at least as a starting point? It seems I'll also have to write one myself :) |
Hi @mkarklins, I used the source files provided in the loramac-node zephyr projec as my starting point. I mentioned before that in these files resided the functionality I needed, but they weren't made available by the lora driver API. The API in question is here. I guess this makes sense since the driver was written specifically for LoRa applications, not as a generic SX1276 driver. Basically, I made an out-of-tree driver for my application, re-using parts of the source material from the loramac node project which suited my purpose, and wrote a different API, I think I maybe could have just written the new API file without re-writing the source functions, but I liked the full control my approach afforded me. Plus, it was good practice for writing zephyr drivers. If you are unfamiliar with how to write zephyr drivers, take a look at the following pages. They should prove helpful. |
@ngoma94 thanks! This is really helpful! |
Hello, The issue I am facing now is that Cmake is not able to find my header files from the nRF SDK when I include them in my main.c file in my Zephyr lwm2m_client sample. Is there any way to just include the whole nRF SDK without having to specify every single directory? |
Unfortunately not. Note, this is a Zephyr repository, so I assume your question is better suited for https://devzone.nordicsemi.com/ |
Hi all,
I'm trying to use some functions for the LoRa sx1276 driver that are not available from the lora driver api. These functions are defined in the loramac-node project module:
[zephryproject dir]/modules/lib/loramac-node/src/radio/sx1276/sx1276.c
. The header filesx1276.h
contains the function prototypes, and includes other dependencies. I would like to includesx1276.h
in my app because I believe it will give me access to all the functions I need for my project.I noticed there was another source file named
sx1276.c
in the zephyr tree, located atzephyr/drivers/lora/sx1276.c
. This is the source file in which the LoRa device driver and API are actually initialized. This file includes the header file I want via this include statement:#include <sx1276/sx1276.h>
. This is the only other file insx1276.h
is included. I thought I could include it in my app the same way. However, I keep encountering the fatal error:sx1276/1276.h: No such file or directory
. Could someone please let me know what I'm doing wrong?The text was updated successfully, but these errors were encountered: