zephyr: Sysbuild does not pass cmake variables to application
Describe the bug
According to the docs, to pass a variable to an image in the sysbuild namespace I can use the syntax -D<namespace>_<var>=value.
Unfortunately when I try to set a variable for my application it does not get the value.
To Reproduce
I have made a repository that reproduces the error.
git clone https://github.com/vChavezB/sysbuild_namespace_var_bug
cd sysbuild_namespace_var_bug
west init -l .
west update -o=--depth=1 -n
west build . --sysbuild -- -Dsysbuild_namespace_var_bug_MY_VAR=Hello
Expected behavior That variables are passed to the namespace I selected.
Impact I cannot set variables from sysbuild to my application
Logs and console output Excerpt of when the value is not set
************************************************
* Running CMake for sysbuild_namespace_var_bug *
************************************************
MY VAR VALUE
Complete log over CI
https://github.com/vChavezB/sysbuild_namespace_var_bug/actions/runs/10197436191/job/28210269420
Environment:
- SDK: v3.7.0
- Toolchain: 0.16.5
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (16 by maintainers)
Just in case someone else does not find this, I link the issue https://github.com/zephyrproject-rtos/zephyr/issues/76628 which requires to document the comment from
https://github.com/zephyrproject-rtos/zephyr/issues/76592#issuecomment-2264776375