Nuvoton Cortex-M ARM CPU infrastructure support

Somewhat based on issue #2453, and my findings/progress/clarification requests…

PlatformIO is an amazing platform for handling processors–especially ones that tend to be “locked away” under proprietary and expensive compiler suites (Keil, IAR, etc.)

I recently got started on Nuvoton processors, and bought a dev board for the M252KG6AE processor. Nuvoton has a half-baked solution for Linux utilizing a customized Eclipse IDE and a customized OpenOCD–but honestly, it’s pretty poor. I’m not familiar with Eclipse IDE, and it’s mind-bogglingly complicated to try to get anything out of it.

Did some digging around, and found that I could get a verbose compile log of an example Nuvoton project–which helps CONSIDERABLY in figuring out why it doesn’t work or what to do…

I’ve spent a few days tinkering around with modifying the Platform and Frameworks by @maxgerhardt for the Gigadevice Beijing CPUs…and at long last was able to finally get a successful compile–with a few caveats.

Since the Nuvoton BSPs for these Cortex-M MCUs are also available in GCC flavor, we can use arm-none-eabi-gcc (as per the “official” Eclipse port) for compiling, as well as OpenOCD for programming and debugging (hopefully without requiring a custom OpenOCD–and even if so, oh well.)

My goals:

  • To create a platform on PlatformIO for these Cortex-M MCUs, where they can be programmed without cumbersome or expensive tooling.
  • To allow usage of the official Nuvoton CMSIS BSP (board support package) without modification (if at all possible)

For reference, here’s the verbose compile log from Eclipse IDE of a Nuvoton “PWM_DeadTime” example:

make all
Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/main.c
Invoking: Cross ARM GNU C Compiler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -std=gnu11 -MMD -MP -MF"User/main.d" -MT"User/main.d" -c -o “User/main.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/main.c”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/main.c

Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/clk.c
Invoking: Cross ARM GNU C Compiler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -std=gnu11 -MMD -MP -MF"Library/Library/clk.d" -MT"Library/Library/clk.o" -c -o “Library/Library/clk.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/clk.c”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/clk.c

Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/gpio.c
Invoking: Cross ARM GNU C Compiler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -std=gnu11 -MMD -MP -MF"Library/Library/gpio.d" -MT"Library/Library/gpio.o" -c -o “Library/Library/gpio.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/gpio.c”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/gpio.c

Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/pwm.c
Invoking: Cross ARM GNU C Compiler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -std=gnu11 -MMD -MP -MF"Library/Library/pwm.d" -MT"Library/Library/pwm.o" -c -o “Library/Library/pwm.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/pwm.c”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/pwm.c

Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/retarget.c
Invoking: Cross ARM GNU C Compiler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -std=gnu11 -MMD -MP -MF"Library/Library/retarget.d" -MT"Library/Library/retarget.o" -c -o “Library/Library/retarget.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/retarget.c”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/retarget.c

Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/sys.c
Invoking: Cross ARM GNU C Compiler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -std=gnu11 -MMD -MP -MF"Library/Library/sys.d" -MT"Library/Library/sys.o" -c -o “Library/Library/sys.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/sys.c”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/sys.c

Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/uart.c
Invoking: Cross ARM GNU C Compiler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -std=gnu11 -MMD -MP -MF"Library/Library/uart.d" -MT"Library/Library/uart.o" -c -o “Library/Library/uart.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/uart.c”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/StdDriver/src/uart.c

Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/GCC/_syscalls.c
Invoking: Cross ARM GNU C Compiler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -std=gnu11 -MMD -MP -MF"CMSIS/CMSIS/GCC/_syscalls.d" -MT"CMSIS/CMSIS/GCC/_syscalls.o" -c -o “CMSIS/CMSIS/GCC/_syscalls.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/GCC/_syscalls.c”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/GCC/_syscalls.c

Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/GCC/startup_M251.S
Invoking: Cross ARM GNU Assembler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -x assembler-with-cpp -D__STARTUP_CLEAR_BSS -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -MMD -MP -MF"CMSIS/CMSIS/GCC/startup_M251.d" -MT"CMSIS/CMSIS/GCC/startup_M251.o" -c -o “CMSIS/CMSIS/GCC/startup_M251.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/GCC/startup_M251.S”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/GCC/startup_M251.S

Building file: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/system_M251.c
Invoking: Cross ARM GNU C Compiler
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/CMSIS/Include" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/StdDriver/inc" -I"/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/SampleCode/StdDriver/PWM_DeadTime/GCC/…/…/…/…/Library/Device/Nuvoton/M251/Include" -std=gnu11 -MMD -MP -MF"CMSIS/CMSIS/system_M251.d" -MT"CMSIS/CMSIS/system_M251.o" -c -o “CMSIS/CMSIS/system_M251.o” “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/system_M251.c”
Finished building: /mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/system_M251.c

Building target: PWM_DeadTime.elf
Invoking: Cross ARM GNU C Linker
arm-none-eabi-gcc -mcpu=cortex-m23 -march=armv8-m.base -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g -T “/mnt/Files/Nuvoton/BSP - M251_M252_M254_M256_M258_Series_BSP_CMSIS_V3.02.001/Library/Device/Nuvoton/M251/Source/GCC/gcc_arm.ld” -Xlinker --gc-sections -Wl,-Map,“PWM_DeadTime.map” --specs=nano.specs -o “PWM_DeadTime.elf” ./User/main.o ./Library/Library/clk.o ./Library/Library/gpio.o ./Library/Library/pwm.o ./Library/Library/retarget.o ./Library/Library/sys.o ./Library/Library/uart.o ./CMSIS/CMSIS/GCC/_syscalls.o ./CMSIS/CMSIS/GCC/startup_M251.o ./CMSIS/CMSIS/system_M251.o
Finished building target: PWM_DeadTime.elf

Invoking: Cross ARM GNU Create Flash Image
arm-none-eabi-objcopy -O ihex “PWM_DeadTime.elf” “PWM_DeadTime.hex”
Finished building: PWM_DeadTime.hex

Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley “PWM_DeadTime.elf”
text data bss dec hex filename
7816 128 56 8000 1f40 PWM_DeadTime.elf
Finished building: PWM_DeadTime.siz

What I noticed here is that it’s building the CMSIS BSP as well–then combining everything together. This seems to be how Nuvoton likes to do their BSP stuff. Not saying it’s great, or that it’s bad–just that’s how they seem to like to do it.

I have managed to cobble it together to the point of being able to compile the exact same program (have not yet tested whether or not it actually works on the target hardware!)

Problems I’m aware of:

  1. I had to rename the Nuvoton “_syscalls.c” to “_syscalls.c.nocompile” to get past a GCC “errno redefined”, as follows:

/home/user/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/bin/ld: .pio/build/M252KG6AE/libboot.a(_syscalls.o):(.bss.errno+0x0): multiple definition of `errno’; /home/user/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/10.3.1/…/…/…/…/arm-none-eabi/lib/thumb/v8-m.base/nofp/libc_nano.a(lib_a-reent.o):(.bss.errno+0x0): first defined here

For whatever reason, this isn’t a problem on the stock Nuvoton compiler, and I notice that both have the “specs=nano.specs” on the final linker step. Unfortunately, it’s not in line with keeping the BSP untouched (for easy updating), nor is it a proper solution.

  1. I had to delete the “ARM” and “IAR” folders out of the device tree, as GCC was (understandably) failing compiling on the invalid syntax in those folders.

    The crux of the issue is that I have to include the “system_M251.c” for a successful compile–and if I point the build libraries to the root “Source” folder, Scons goes down through all of the subfolders as well. Great feature–but I don’t know how to prevent it from traversing subfolders.
    BUT…I’d rather not modify the Nuvoton BSP if at all possible, i.e. making it more of a seamless port over to PlatformIO.

Thoughts, solutions?

It appears that it shouldn’t be terribly difficult to make this work for most of the rest of Nuvoton’s 32-bit Cortex-M processors…which would be wonderful.
I would need some direction how to best handle that, whether (a la STSTM32) there’s a separate framework for each “subgroup” of processors…or whether they’re all shoehorned into a single large framework?

Here’s a successful verbose compile output from PlatformIO on the same project/processor:

Processing M252KG6AE (platform: nuvoton-m32; board: cmsis_m252kg6ae; framework: cmsis)

CONFIGURATION: https://docs.platformio.org/page/boards/nuvoton-m32/cmsis_m252kg6ae.html
PLATFORM: Nuvoton 32-bit ARM (0.0.1) > Generic M252KG6AE
HARDWARE: M252KG6AE 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:

  • framework-cmsis-nuvoton @ 1.40500.0 (4.5.0)
  • toolchain-gccarmnoneeabi @ 1.100301.220327 (10.3.1)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 0 compatible libraries
    Scanning dependencies…
    No dependencies
    Building in release mode
    Warning! Unknown upload protocol openocd
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/src/main.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -Iinclude -Isrc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source src/main.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/acmp.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/acmp.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/bpwm.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/bpwm.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/clk.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/clk.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/crc.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/crc.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/crypto.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/crypto.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/dac.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/dac.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/eadc.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/eadc.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/ebi.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/ebi.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/fmc.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/fmc.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/gpio.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/gpio.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/i2c.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/i2c.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/lcd.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/lcd.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/pdma.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/pdma.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/pwm.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/pwm.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/qspi.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/qspi.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/retarget.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/retarget.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/rtc.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/rtc.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/sc.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/sc.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/scuart.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/scuart.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/spi.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/spi.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/sys.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/sys.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/timer.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/timer.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/timer_pwm.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/timer_pwm.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/tk.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/tk.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/uart.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/uart.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/usbd.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/usbd.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/usci_i2c.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/usci_i2c.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/usci_spi.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/usci_spi.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/usci_uart.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/usci_uart.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/wdt.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/wdt.c
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/CMSISframework/wwdt.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/src/wwdt.c
    arm-none-eabi-gcc -mthumb -mcpu=cortex-m23 -march=armv8-m.base -x assembler-with-cpp -D__STARTUP_CLEAR_BSS -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source -c -o .pio/build/M252KG6AE/boot/GCC/startup_M251.o /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source/GCC/startup_M251.S
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/boot/system_M251.o -c -std=gnu11 -Os -ffunction-sections -fdata-sections -fmessage-length=0 -fsigned-char -mthumb -mcpu=cortex-m23 -march=armv8-m.base -DPLATFORMIO=60112 -DNUVOTON -DNUVOTON_M23 -DNUVOTON_M252KG6AE -DF_CPU=48000000L -D_NUVOTON_ -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/CMSIS/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/StdDriver/inc -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Include -I/home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source/system_M251.c
    arm-none-eabi-ar rc .pio/build/M252KG6AE/libCMSISframework.a .pio/build/M252KG6AE/CMSISframework/acmp.o .pio/build/M252KG6AE/CMSISframework/bpwm.o .pio/build/M252KG6AE/CMSISframework/clk.o .pio/build/M252KG6AE/CMSISframework/crc.o .pio/build/M252KG6AE/CMSISframework/crypto.o .pio/build/M252KG6AE/CMSISframework/dac.o .pio/build/M252KG6AE/CMSISframework/eadc.o .pio/build/M252KG6AE/CMSISframework/ebi.o .pio/build/M252KG6AE/CMSISframework/fmc.o .pio/build/M252KG6AE/CMSISframework/gpio.o .pio/build/M252KG6AE/CMSISframework/i2c.o .pio/build/M252KG6AE/CMSISframework/lcd.o .pio/build/M252KG6AE/CMSISframework/pdma.o .pio/build/M252KG6AE/CMSISframework/pwm.o .pio/build/M252KG6AE/CMSISframework/qspi.o .pio/build/M252KG6AE/CMSISframework/retarget.o .pio/build/M252KG6AE/CMSISframework/rtc.o .pio/build/M252KG6AE/CMSISframework/sc.o .pio/build/M252KG6AE/CMSISframework/scuart.o .pio/build/M252KG6AE/CMSISframework/spi.o .pio/build/M252KG6AE/CMSISframework/sys.o .pio/build/M252KG6AE/CMSISframework/timer.o .pio/build/M252KG6AE/CMSISframework/timer_pwm.o .pio/build/M252KG6AE/CMSISframework/tk.o .pio/build/M252KG6AE/CMSISframework/uart.o .pio/build/M252KG6AE/CMSISframework/usbd.o .pio/build/M252KG6AE/CMSISframework/usci_i2c.o .pio/build/M252KG6AE/CMSISframework/usci_spi.o .pio/build/M252KG6AE/CMSISframework/usci_uart.o .pio/build/M252KG6AE/CMSISframework/wdt.o .pio/build/M252KG6AE/CMSISframework/wwdt.o
    arm-none-eabi-ar rc .pio/build/M252KG6AE/libboot.a .pio/build/M252KG6AE/boot/GCC/startup_M251.o .pio/build/M252KG6AE/boot/system_M251.o
    arm-none-eabi-ranlib .pio/build/M252KG6AE/libCMSISframework.a
    arm-none-eabi-ranlib .pio/build/M252KG6AE/libboot.a
    arm-none-eabi-gcc -o .pio/build/M252KG6AE/firmware.elf -T /home/user/.platformio/packages/framework-cmsis-nuvoton/Library/Device/Nuvoton/M251/Source/GCC/gcc_arm.ld -mthumb -Os -Xlinker --gc-sections --specs=nano.specs -mcpu=cortex-m23 -march=armv8-m.base .pio/build/M252KG6AE/src/main.o -L.pio/build/M252KG6AE -Wl,–start-group .pio/build/M252KG6AE/libCMSISframework.a .pio/build/M252KG6AE/libboot.a -lc -lgcc -lm -lstdc++ -Wl,–end-group
    MethodWrapper([“checkprogsize”], [“.pio/build/M252KG6AE/firmware.elf”])
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [ ] 0.5% (used 180 bytes from 32768 bytes)
    Flash: [ ] 3.1% (used 8212 bytes from 262144 bytes)
    .pio/build/M252KG6AE/firmware.elf :
    section size addr
    .text 8084 0
    .ARM.exidx 8 8084
    .data 120 536870912
    .bss 60 536871032
    .heap 256 536871096
    .stack_dummy 1024 536871096
    .ARM.attributes 44 0
    .comment 67 0
    Total 9663
    arm-none-eabi-objcopy -O binary .pio/build/M252KG6AE/firmware.elf .pio/build/M252KG6AE/firmware.bin
    ================================================= [SUCCESS] Took 5.27 seconds =================================================

Other problems: if I change the “framework-cmsis-nuvoton @ 1.40500.0 (4.5.0)” version number (pulled direct from the Gigadevice), then PlatformIO can’t find the folder–which is right there. (Yes, I change the version number in all 3 instances that I’ve been able to find). Minor issue obviously.

You might notice the two archives…one’s “CMSISframework.a” (a direct ripoff of the Gigadevice framework!) and the other one’s “boot”, as I was unable to figure out how else to get PIO to compile the processor boot assembler and C files. I don’t think that this is a problem–but there’s probably a better way to handle it!

Here’s a link to the Nuvoton BSP for the chips I’m currently toying with: GitHub - OpenNuvoton/M251BSP: BSP of M251/M252/M254/M256/M258 Series MCU

Tested all 3 PlatformIO versions of OpenOCD, and alas…none of them work with the Nuvoton Nu-Link programmers. One error or another.

But the Nuvoton customized OpenOCD does work.

Bit annoying, especially as it’s based on OpenOCD “Open On-Chip Debugger 0.10.0-dev-00470-gcc54018c (2021-04-01-07:43)”

Where there’s a will, there’s a way.

I guess I’ve reached feature demonstration: the compiled file actually runs on the target hardware and provides the expected end result…

YES. IT WORKS ON THE TARGET BOARD! :boom:

At the moment, I’m cobbling together the “OpenOCD upload” command based on some examples here…and manually running it in Terminal. Next I need to find some PlatformIO framework examples utilizing OpenOCD, and get this all working the proper way…

Unfortunately, we will have to use the OpenNuvoton OpenOCD version. Oh well.

1 Like

Successfully compiling and uploading from PlatformIO / VSCode.

Well, did some digging around, only to find that “cmsis-dap” used in different other platforms is really a fancy name for “pyOCD”, which PlatformIO supports.
And there’s apparently Nuvoton packs for it.

Nuvoton themselves is apparently planning to port over to cmsis-dap, which makes it seem like this might be the best option for a long-term PlatformIO basis.

Tried to play with it, only to get eaten alive by the Python–which is pretty typical for me. So I tried using another PIO framework (Maxim32) that lists “tool-pyocd” as a dependency, but have not been able to get it to invoke “tool-pyocd”–all it does is pop out, “Warning! Unknown upload protocol cmsis-dap”

pyOCD is failing installation–I’m not even to the point of getting it to run. As follows:

Configuring upload protocol…
AVAILABLE: cmsis-dap, openocd
CURRENT: upload_protocol = cmsis-dap
Uploading .pio/build/M252KG6AE/firmware.bin
Collecting pyocd==0.29.0
Using cached pyocd-0.29.0-py2.py3-none-any.whl (11.0 MB)
Collecting cmsis-pack-manager>=0.2.7 (from pyocd==0.29.0)
Obtaining dependency information for cmsis-pack-manager>=0.2.7 from https://files.pythonhosted.org/packages/8a/88/77c3934d1fd13c3cf8d9b4c5d794a6872ac5593baf6c0413dc3c2a51959e/cmsis_pack_manager-0.5.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
Using cached cmsis_pack_manager-0.5.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.7 kB)
Collecting colorama (from pyocd==0.29.0)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting intelhex<3.0,>=2.0 (from pyocd==0.29.0)
Using cached intelhex-2.3.0-py2.py3-none-any.whl (50 kB)
Collecting intervaltree<4.0,>=3.0.2 (from pyocd==0.29.0)
Using cached intervaltree-3.1.0.tar.gz (32 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status ‘done’
Collecting naturalsort<2.0,>=1.5 (from pyocd==0.29.0)
Using cached naturalsort-1.5.1.tar.gz (7.4 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status ‘done’
Collecting prettytable (from pyocd==0.29.0)
Obtaining dependency information for prettytable from https://files.pythonhosted.org/packages/4d/81/316b6a55a0d1f327d04cc7b0ba9d04058cb62de6c3a4d4b0df280cbe3b0b/prettytable-3.9.0-py3-none-any.whl.metadata
Using cached prettytable-3.9.0-py3-none-any.whl.metadata (26 kB)
Collecting pyelftools (from pyocd==0.29.0)
Obtaining dependency information for pyelftools from https://files.pythonhosted.org/packages/33/f9/281a411a5281b674b10830a2f312c64464b49916d097b8919f009de579e0/pyelftools-0.30-py2.py3-none-any.whl.metadata
Using cached pyelftools-0.30-py2.py3-none-any.whl.metadata (381 bytes)
Collecting pylink-square (from pyocd==0.29.0)
Obtaining dependency information for pylink-square from https://files.pythonhosted.org/packages/d7/a1/043191e57d78627a16f5a21622b75f7f3a026f1746aa0fdbb339f46acd72/pylink_square-1.2.0-py2.py3-none-any.whl.metadata
Using cached pylink_square-1.2.0-py2.py3-none-any.whl.metadata (5.1 kB)
Collecting pyusb<2.0,>=1.0.0b2 (from pyocd==0.29.0)
Using cached pyusb-1.2.1-py3-none-any.whl (58 kB)
Collecting pyyaml<6.0,>=5.1 (from pyocd==0.29.0)
Using cached PyYAML-5.4.1.tar.gz (175 kB)
Installing build dependencies: started
Installing build dependencies: finished with status ‘done’
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status ‘error’
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [62 lines of output]
/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg
!!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.
  
          By 2023-Oct-30, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.
  
          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
  
  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)
  running egg_info
  writing lib3/PyYAML.egg-info/PKG-INFO
  writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
  writing top-level names to lib3/PyYAML.egg-info/top_level.txt
  Traceback (most recent call last):
    File "/home/siddy/.platformio/penv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/home/siddy/.platformio/penv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/siddy/.platformio/penv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 271, in <module>
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 318, in run
      self.find_sources()
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 326, in find_sources
      mm.run()
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 548, in run
      self.add_defaults()
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 586, in add_defaults
      sdist.add_defaults(self)
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/command/sdist.py", line 113, in add_defaults
      super().add_defaults()
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
      self._add_defaults_ext()
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
    File "<string>", line 201, in get_source_files
    File "/tmp/pip-build-env-g27kmhbh/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
      raise AttributeError(attr)
  AttributeError: cython_sources
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Error: Couldn’t install dependencies for pyOCD!
Installing Python dependencies for pyOCD…
*** [upload] Error 1

Can someone shed some light onto what’s going on here? Apparently PlatformIO’s “pyOCD” package is not in working order.
The “pyOCD” PlatformIO package is pulling pyOCD 0.29; the latest (at the current time) is 0.36. I tried modifying the PIO PY stub to pull 0.36–only for it to fail elsewhere:

platformio 6.1.12a1 requires pyelftools==0.29, but you have pyelftools 0.30 which is incompatible.

further spamming of my own thread, LOL!

Manually installed pyOCD 0.36 via pip, and tried to manually use it in the Terminal. Followed the steps here: embedded - PyOCD doesn't find Nu-Link2-Me probe on my NuMaker board - Stack Overflow

No joy. I get the same result with either of the Nuvoton programmers I have: “No available debug probes are connected”.

Despite having all of the Nuvoton processors supported in the ARM DFP, apparently pyOCD is still not ready for prime time.

Mh no that’s a misunderstanding. pyOCD is a program. CMSIS-DAP is a protocol for debug adapters. Both OpenOCD and pyOCD can handle connecting to CMSIS-DAP-type debug probes. (In OpenOCD, this would be by chosing -f interfaces/cmsis-dap.cfg). But if pyOCD is better is easier for your case, you can use it.

Note that PlatformIO does have pre-packaged pyOCD and platforms that use it. See here, here, here, here.

The PlatformIO-provided version for pyOCD seems to be extremely old (> 3 years) though, but you should be able to craft a newer version of this easily by looking at which files are in the PlatformIO-provided tool-pyocd package.

Of course you can also pacakge the Nuvoton-modified OpenOCD package for every OS and use that.

Ah, OK…thanks for the clarification. In digging through PIO Github repositories for tools, I seemed to always find “cmsis-dap” tied to “pyocd”, but not “openocd”. There’s only 4 platforms referencing pyocd anyhow, so it’s not like that’s enough to be conclusive!

As noted above, I tried to use the PIO pyOCD (“tool-pyocd”)…and could not get it to successfully install (via PIO).
Yes, the current version of PIO pyOCD is 3 years old–but it’s also not “pre-packaged.” It’s literally a downloader stub for pyOCD 0.29. As mentioned above, I adjusted the downloader stub to download the platest pyOCD 0.36–and the install failed at a later step.

For test purposes, I manually installed pyOCD from the system terminal via “python3 -mpip install -U pyocd”, getting 0.36.0–and that’s where I found that it did not work with the Nuvoton programmers.
Conveniently, Nuvoton has a “patched” version of pyOCD for their stuff–drats, not that again! It’s “only” 252 commits behind the current pyOCD…

Well, apparently the “Nuvoton-modified OpenOCD” is now “too old” for Cortex-Debug in VSCode, at least according to this issue on GH. I haven’t gotten far enough in the process of trying to get a debugger working to verify this issue. Don’t even know if Cortex-Debug is required as a bridge…I’ve got much to learn.

At least I can program the M252KG board from PIO/VSCode on my desktop now.

Digging into pyOCD (simply because putting the burden of cross-platform-tooling onto Python seems easier), modified to get the PIO “tool-pyocd” stub to pull directly from the OpenNuvoton pyOCD repo…

…only to find that the OpenNuvoton pyOCD repo is based on pyOCD 0.30.0, which is not compatible with the current version of PlatformIO. Sheesh and cheers!
Further, in pyOCD 0.30.0 and newer, the pyOCD team removed the “flash_tools” function–now you’re apparently supposed to do it through “pyocd load”.

0.29.0: https://github.com/pyocd/pyOCD/tree/v0.29.0/pyocd/tools
0.30.0: https://github.com/pyocd/pyOCD/tree/v0.30.0/pyocd/tools
removed in this commit: Tools: drop deprecated pyocd-flash and pyocd-tool. · pyocd/pyOCD@473cf94 · GitHub

SO…yeah, the PIO pyOCD stuff is quite out of date. Not surprising considering how few platforms use it.

I’ll keep plugging away…maybe it’ll work…

EDIT: nope, the Nuvoton pyOCD isn’t even usable as it stands. So the modded OpenOCD it has to remain for now.