Closed maxgerhardt closed 5 years ago
Sorry, I don't have mbed CLI. Does it add nested folders to CPPPATH? Could you share somewhere verbose build log from this example https://github.com/maxgerhardt/pio-lorawan-example?
Thanks for the report! Please re-test with pio upgrade --dev
.
The compilation is successfuly now for that project (👍), but I don't think it's the correct solution.
The commit will cause that -DMBED_CONF_SX1276_LORA_DRIVER_RADIO_VARIANT=SX1276UNDEFINED
is injected only into the compilation of the library sources (e.g. SX1272_LoRaRadio.cpp). But the mbed-cli would add this macro into the mbed_config.h
(I'll recheck later but I'm pretty sure).
#define MBED_CONF_SX1276_LORA_DRIVER_RADIO_VARIANT SX1276UNDEFINED // set by library:mbed-lora-radio-drv
This way it is seen by all sources which include mbed.h
and not only the library's source. E.g., when main.cpp
is compiled, it doesn't see that macro.
Please pio upgrade --dev
😊
What kind of issue is this?
Configuration
Operating system: Windows 10 x64
PlatformIO Version (
platformio --version
):version 4.0.0a3
Description of problem
Taking a look at https://github.com/maxgerhardt/pio-lorawan-example, you can see that inside
lib/mbed-radio-radio-drv/SX127{2,6}
there arembed_lib.json
files defining some default value for configuration macros. See e.g. here:https://github.com/maxgerhardt/pio-lorawan-example/blob/061615d01c2b97faff79c6322b44dbe2defd7f64/lib/mbed-lora-radio-drv/SX1272/mbed_lib.json#L1-L17
In the
mbed-cli
build system, the last entry would generate the macro definition#define MBED_CONF_SX1272_LORA_DRIVER_RADIO_VARIANT=SX1272UNDEFINED
. This is then e.g. used herehttps://github.com/maxgerhardt/pio-lorawan-example/blob/061615d01c2b97faff79c6322b44dbe2defd7f64/lib/mbed-lora-radio-drv/SX1272/SX1272_LoRaRadio.cpp#L1465-L1467
However, PlatformIO doesn't generate this definition and trying to build the code without a special
build_flag = -D ..
definition will result in a compilation failure:I have to manually fix this error by using this
platformio.ini
:Ergo, PlatformIO should automatically pick up on any
mbed_lib.json
files and create these macros, but it doesn't.Steps to Reproduce
-D
definitions in theplatformio.ini
Actual Results
Build failure.
Expected Results
Successful build because the macros were created.