Trouble with LORA and PingPong demo

Yeah there is a clash with mbedOS 5.8.2 functions from mbed_debug.h as defined here with additional but identical debug functions defined in Semtech’s debug.h in the SX1272 lib. Unfortunetly the debug.h header defines the prototypes of the functions no matter what macros are set (here).

You can get the project to compile by doing the following things:

Use the platformio.ini file:

[env:nucleo_l152re]
platform = ststm32
board = nucleo_l152re
framework = mbed
lib_deps = 
	mbed-rtos
	SX1272Lib
lib_ignore = 
	mbed-LWIP
	mbed-mbedtls
build_flags =
	-D PIO_FRAMEWORK_MBED_RTOS_PRESENT
	-I .piolibdeps/SX1272Lib_ID2756/radio
	-I .piolibdeps/SX1272Lib_ID2756/registers
	-I .piolibdeps/SX1272Lib_ID2756/sx1272
	-I .piolibdeps/SX1272Lib_ID2756/typedefs
	-I .piolibdeps/SX1272Lib_ID2756/debug

Your board may differ, but the important parts are that it includes the SX1272 lib, then ignores LWIP and mbedtls which PIO somehow thinks have to be included (but results in compilation error), and finally defines for fixing this and including the directories of the library which also somehow don’t get automatically added to the include path. This assumes that the SX1272 is installed in your project folder under .piolibdeps and not some global repository.

Use the main.cpp and main.h from here.

Modify the debug.h file of your SX1272 lib to be an empty file.

Then you should see

Dependency Graph
[05/06/18 10:44:11] Processing nucleo_l152re (platform: ststm32; board: nucleo_l152re; framework: mbed)
|-- <mbed-rtos> (C:\Users\Maxi\.platformio\packages\framework-mbed\rtos)
|-- <SX1272Lib> (C:\Users\Maxi\Documents\stackoverflow_testing\.piolibdeps\SX1272Lib_ID2756)
[...]
arm-none-eabi-ar rc .pioenvs\nucleo_l152re\lib5d0\libSX1272Lib_ID2756.a .pioenvs\nucleo_l152re\lib5d0\SX1272Lib_ID2756\radio\radio.o .pioenvs\nucleo_l152re\lib5d0\SX1272Lib_ID2756\sx1272\sx1272-hal.o .pioenvs\nucleo_l152re\lib5d0\SX1272Lib_ID2756\sx1272\sx1272.o
arm-none-eabi-ranlib .pioenvs\nucleo_l152re\lib5d0\libSX1272Lib_ID2756.a
arm-none-eabi-g++ -o .pioenvs\nucleo_l152re\firmware.elf -mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -Wl,-n -Wl,-T".pioenvs\nucleo_l152re\STM32L152XE.ld.link_script.ld" @"C:\Users\Maxi\Documents\stackoverflow_testing\.pioenvs\nucleo_l152re\longcmd-293bab093b121e5cafa557dcae476abb" -LC:\Users\Maxi\.platformio\platforms\ststm32\ldscripts -L.pioenvs\nucleo_l152re -Wl,--start-group .pioenvs\nucleo_l152re\lib5d0\libSX1272Lib_ID2756.a -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -lc -lstdc++ -Wl,--end-group
arm-none-eabi-size -B -d .pioenvs\nucleo_l152re\firmware.elf
arm-none-eabi-objcopy -O binary .pioenvs\nucleo_l152re\firmware.elf .pioenvs\nucleo_l152re\firmware.bin
text	   data	    bss	    dec	    hex	filename
44476	   2568	   8636	  55680	   d980	.pioenvs\nucleo_l152re\firmware.elf
 [SUCCESS] Took 31.86 seconds 

Since modifying libraries files isn’t that great you could just drop a copy of the SX1272Lib in the lib/ folder, give it a custom name and include that in lib_deps with adapter include flags. Then it would we re-producable across all systems.