Open liquiddandruff opened 3 years ago
The fix is as suspected, rename the .c and edit the CMakeLists.txt to work around compile_source_files
for the build to progress.
1) rename
cd %HOMEPATH%\.platformio\packages\framework-zephyr-loramac-node\src\radio\sx1276
mv sx1276.c radio_sx1276.c
2) edit cmakelists.txt vim %HOMEPATH%\.platformio\packages\framework-zephyr-loramac-node\zephyr\CMakeLists.txt
- zephyr_library_sources_ifdef(CONFIG_HAS_SEMTECH_SX1276 ../src/radio/sx1276/sx1276.c)
+ zephyr_library_sources_ifdef(CONFIG_HAS_SEMTECH_SX1276 ../src/radio/sx1276/radio_sx1276.c)
After above changes, enabling the LoRa in the prj.conf
builds successfully.
What kind of issue is this?
You can erase any parts of this template not applicable to your Issue.
Configuration
Operating system: Win10 x64
PlatformIO Version (
platformio --version
): PlatformIO Core, version 5.1.0Device: Adafruit Feather M0 RFM95
Description of problem
Running Zephyr's Menuconfig from the PlatformIO Tasks->adafruit_feather_m0->Platform->Run Menuconfig and enabling LORA and SX1276 device generates a final .config in
<project_root>\.pio\build\adafruit_feather_m0\zephyr\.config
that builds successfully.However this is not ideal since modifications done through Menuconfig cannot be easily tracked in .git.
Luckily Zephyr build system supports a
prj.conf
in<project_root>\zephyr\prj.conf
that gets merged with the board provided defaults.Diffing before and after the Menuconfig modifications (and removing some options that are not supposed to be set manually) produce the following changes:
However adding the above to
prj.conf
and performing a PIO build causes PIO's custom build logic to fail with:This might be due to
compile_source_files
being confused because they have the same file names, but it is correct (framework-zephyr\\drivers\\lora\\sx1276.c
depends on the actual implementation defined inframework-zephyr-loramac-node\\src\\radio\\sx1276\\sx1276.c
)There should be no difference after merging since the final
.config
as generated by Zephyr's Menuconfig builds successfully, but we seem to not be able to get to that point due to possibly erroneous target generation/dependency/name clash incompile_source_files
.Steps to Reproduce
platformio.ini
<project_root>\.pio\build\adafruit_feather_m0\zephyr\.config
somewhere asclean.config
<project_root>\.pio\build\adafruit_feather_m0\zephyr\.config
somewhere aslora.config
clean.config
andlora.config
, the relevant changes are as illustrated above.<project_root>\zephyr\prj.conf
Actual Results
When specifying the same configs generated by Menuconfig in
prj.conf
, attempting to build returns multiple targets error.Expected Results
Should build successfully when the same configurations that would have been generated by Menuconfig are included in
prj.conf
.If problems with PlatformIO Build System:
The content of
platformio.ini
: