STC’s STC8 family of 8051 microcontrollers (e.g. STC8H8K64U-USB) ship with a built-in rv51 RISC-V soft-core. User C/C++ is compiled with riscv64-unknown-elf-gcc and runs on the rv51 pipeline; native 8051 ISRs handle USB CDC, timers and GPIO via ecall. This makes it the only 8051 part with practical, modern C++ support.
The build pipeline reuses the official Arduino-STC8 core’s tools/wrapper/sdcc.py wrapper, so behaviour is identical to the Arduino IDE flow.
What an interesting core and concept that is, with rv51!
That is actually done via pio pkg publish on the PIO commandline. A platform is a type of package in that sense. Please review the AI output more carefully and critically next time.
A thing you should also do before publishing the platforms is to first publish the toolchain packages to the PIO registry (same pio pkg publish) so that you can reference your toolchain by just its name and version in the platform.json, without needing Python code to switch the package.
Thanks so much for the feedback and for pointing me in the right direction!
I appreciate the correction on using pio pkg publish. I’ll definitely follow your advice to publish the toolchain packages to the registry first so I can clean up the platform.json and drop that extra Python code.
Thank you for the suggestion! I’m aware of the existing Intel MCS-51 platform and the Generic STC8H8K64U board support.
However, my platform takes a fundamentally different approach: instead of using SDCC (which only supports C), it runs rv51 — a RISC-V emulator written in 8051 assembly — and compiles user code with riscv64-unknown-elf-gcc (GCC 13.4.0). This brings full C++17 support, Arduino library compatibility, and FreeRTOS to the STC8H, none of which are possible with the SDCC-based toolchain.
In short:
Existing platform: SDCC → C only, no Arduino libraries
This platform: GCC via rv51 → full C++17, 6000+ Arduino libraries, FreeRTOS
That said, I’m happy to discuss whether parts of this (e.g. the board definition or USB flasher) could be contributed upstream. Would that be something the team would consider?