platformio-core
platformio-core copied to clipboard
Support for Nuvoton products
- http://www.nuvoton.com.cn/hq/products/microcontrollers/arm-cortex-m4-mcus/nuc505-series/?__locale=en
- http://www.nuvoton.com/resource-files/UM_NuTiny-SDK-NUC505_EN_Rev1.03.pdf
- https://www.nuvoton.com/products/microcontrollers/arm-cortex-m0-mcus/nuc130-230-automotive-series/nuc130lc1cn/
Support for Nuvoton products...a very decent start on the 8-bit 8051-1T Nuvoton MCUs on PlatformIO has already been under way (utilizing SDCC for the compiler), and that was a thrilling discovery for me. Works quite well, although I have had to rewrite/modify the Nuvoton BSP (board support packages) for SDCC--oh, and hack in some of the MS51-series processors into a modified version of "nuvoprog" (which desperately needs rewritten in something better than Go.)
I would say that the main difficulty with mainstreaming Nuvoton's offerings, is the lack of software options for programming them. I'm on Linux (couldn't throw Windoze out fast enough after they lost their minds with 8)...and the only "official" option provided for us penguins, is a heavily modified Eclipse IDE. And it's only for a few of the Nuvoton 32-bit ARM processors. Which to be frank, is a terrible solution that is effectively useless.
(Worth noting, however, the heavily modified Eclipse IDE does provide us with SVD files for each processor group. As well as the BSP including all the specific files for each processor group.)
It looks to me that basic compiler support for some 32-bit ARM-based Nuvoton MCUs should be quite easy, as there's numerous other processors utilizing arm-none-eabi-gcc and the like for a compiler.
For example, I personally have several Nuvoton M252-series official development boards (with the M252KG6AE processor), based on the ARM Cortex-M23 core. Digging around, I found that the Gigadevice project supports several Gigadevice processors with the ARM Cortex-M23 core, such as this: https://github.com/CommunityGD32Cores/platform-gd32/blob/main/boards/genericGD32L233C8.json
Programming/debugging is going to be a bit more challenging. Nuvoton tried submitting a patch to OpenOCD, but was rejected due to not following the rules for a patch ( https://review.openocd.org/c/openocd/+/4739/1 ). Unfortunately, Nuvoton's solution to the rejection was then to create their own modified version of OpenOCD for Nuvoton processors: https://github.com/OpenNuvoton/OpenOCD-Nuvoton
The official Nuvoton ICP tool works great on Windoze, but I have not had any luck getting it to work in Wine on Linux. The program runs, to be sure, but it can never enumerate the USB HID device for the Nu-Link-Pro programmer that I have. I've delved into that as far as I could (yes, plugdev permissions were set correctly), even going as far as to see that Wine's USB subsystem would properly find the USB Nu-Link-Pro...but the Nuvoton ICP tool would enumerate right over it and not "grab" it.
I am more than happy to help test with the M252KG6AE dev boards that I have. Perhaps I can go through the 50-page setup PDF for the Eclipse IDE thing again and maybe get "hello world" to work again (for capturing "arm-none-eabi-gcc" command line data + OpenOCD"Nuvoton" commands?
The official Nuvoton BSP for the M252 (well, for M251/M252/M254/M256/M258) can be found at https://github.com/OpenNuvoton/M251BSP Appears that they use CMSIS framework--which again, I've seen used elsewhere in PlatformIO, including on the ST STM32 PlatformIO branch. In other words, nothing new there either.
I've got some Nuvoton hardware, and would say that I'm quite well versed in low-level debugging/programming (have done a lot of programming in pure assembler--including an entire program with over 700KB of ARM7 assembly source, in both ARM and THUMB subsets, too! Was for the Nintendo GBA.) Where my experience lacks is with toolchains, compiling systems and high-level language stuff. Is there any way I can be of value in sorting some of this out for the PlatformIO community?