Getting started modifying PIO build process, specifically around hacking platform build scripts

Per the issue I’m having with STM32 (here, previously here, and here), for which I’m getting very little traction, I figured I’d look into fixing the issue myself. The short version being that include paths for libraries are being added the platform build, causing compile errors for clashing header file names (e.g. “debug.h”)

Was wondering if there was a documentation starting point about how framework / platform builds tie into PIO in general. I’ve looked at the STSTM32 platform code trying to determine how it passes library includes up to the PIO superclasses, but I couldn’t find much.

I’ve looked at the Custom Development Platform documentation, but it’s rather light on details.

This should be work-aroundable by just modifying the library’s code locally. In this thread (Trouble with LORA and PingPong demo - #3 by maxgerhardt) it described for the SX1272 Ping Pong demo and SX1272Lib, should be the same for the SX1276.

Yes, this works, but the core problem (adding library include paths to the framework build) still exists. Adding a single library to an empty project shouldn’t break the build.

Isn’t the code itself the problem in this case? Semtech’s SX1276Lib adds a debug.h file (mbed-os has mbed_debug.h) with the exact same function code (inline, even) and names as the one used by mbedos (debug(), debug_if()). This build should break with error: redefinition of .. even on the normal mbedos build system if the debug.h file is included.