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…
- GitHub - CommunityGD32Cores/platform-gd32: PlatformIO platform for ARM-based GD32{F,E,L,W} chips. Work in Progress!
- GitHub - Community-PIO-CH32V/platform-ch32v: PlatformIO platform for CH32V RISC-V chips (CH32V003, CH32V103, CH32V20x, CH32V30x) and CH56x, CH57x, CH58x
- GitHub - Community-BL-IOT/platform-sifive: SiFive: development platform for PlatformIO
- GitHub - maxgerhardt/platform-raspberrypi: Raspberry Pi: development platform for PlatformIO