I want to make a platform support myself, but I don't quite understand some things

I’ve created 4 or so new platforms, or signifcant extensions to them, in the past years and all I can say is: Learn by doing. You start to recognize patterns when you look at different official platforms like https://github.com/platformio/platform-ststm32, https://github.com/platformio/platform-atmelavr/, https://github.com/platformio/platform-raspberrypi/, et cetara.

The class Espressif32Platform is instantiated by the PlatformIO core code with a certain expected name based on the platform’s name declared in the platform.json, lowercased except the first letter.

The PlatformIO core will call the magic methods defined in that class for getting the configuration options for boards, packages, debug tools, et cetara. It’s really best to learn by the examples here and recognize the common code patterns for inclusion of packages, definition of debug servers etc.

I really, really want good documentation on the very intricate details of that too, but they’re not provided in that depth yet. There are lots of scattered islands of knowledge one has to have to create this.

Best I can give you is some thing I wrote some ago for helping you understand the build system (aka, SCons) and some PlatformIO specifics: Arduino Due (or other SAM3/4) upload fails with ATMEL ICE JTAG on VSCode with PlatformIO - #8 by maxgerhardt

Along with the platforms I’ve created or expanded…