Memory usage in PlatformIO's Inspect inconsistent?

You’re having the general problem than that the “Debug” feature inspects the firmware when built in debug mode when memory usage is generally larger.

Best to compile in “MinSize with Debug Info” mode by setting build_flags = -g3 -ggdb3 -Wl,-Map,output.map to the platformio.ini, building, and either run the resulting .map file through amap or the .elf file through GitHub - ARMmbed/mbed-os-linker-report: Post-processing of linker output to calculate and visualize memory usage for elf-sections like I did e.g. in STM32g030k6p6 simple sketch overflows the flash memory? - #5 by maxgerhardt