PlatformIO Integration Guide
GCC 14 or newer (most PlatformIO platforms ship with older toolchains)
C++23 is mandatory
Must explicitly remove older standard flags with build_unflags
[env:nucleo_f767zi]
platform = ststm32
board = nucleo_f767zi
framework = arduino
platform_packages =
toolchain-gccarmnoneeabi@1.140201.0
lib_deps =
https://github.com/tucher/JsonFusion.git
build_unflags =
-std =gnu++14
-std =gnu++17
build_flags =
-std =c++23
-D_POSIX_C_SOURCE =200809L
#include < JsonFusion/parser.hpp>
struct Config {
std::string app_name;
int version;
bool debug_mode;
struct Server {
std::string host;
int port;
};
Server server;
};
void setup () {
const char * json = R"( {
"app_name": "MyApp",
"version": 1,
"debug_mode": true,
"server": {
"host": "localhost",
"port": 8080
}
})" ;
Config config;
bool result = JsonFusion::Parse (config, std::string_view (json));
}
Requires -D_POSIX_C_SOURCE=200809L to fix vdprintf errors in Print::printf()
No additional flags needed
Better suited for production embedded systems
framework = stm32cube ; Instead of arduino