-
Hi, My question is rather simple: How can I integrate more deeply into Zephyr from within a module? I have, for example, a custom UART driver in my module and for it to use Zephyr toolchain intelligence I need to define Is there any way I can integrate more deeply with Zephyr and its build and configuration system from the outside? Thanks, any help is appreciated :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I haven't tested but can you add your drive to |
Beta Was this translation helpful? Give feedback.
-
By researching these functions I actually found For Kconfig there seems to be no way (as far as I can tell) to enable this behavior. But I found that it probably would be possible to add a custom preprocessor command, which expands to potential module Kconfigs... You just would have to expand the current Zephyr tree Kconfigs with some kind of "hook" at the end... But this is probably not something I could design with all the side effects this could have and potential opposition :D Maybe somebody has insight as to how Linux does this kind of thing, since I cannot imagine there is no solution to this... |
Beta Was this translation helpful? Give feedback.
By researching these functions I actually found
zephyr_library_amend()
(which is used instead ofzephyr_library()
) and actually lets you add out-of-tree CMake sources as long as the module has the same directory structure as the Zephyr tree. So if I put my UART driver intomy_module/drivers/serial/my_uart.c
and have aCMakeLists.txt
usezephyr_library_amend()
andzephyr_library_sources(my_uart.c)
it just works and eliminates the CMake warning :)For Kconfig there seems to be no way (as far as I can tell) to enable this behavior. But I found that it probably would be possible to add a custom preprocessor command, which expands to potential module Kconfigs... You just would have to expand t…