Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Nuvoton NuMicro Cortex-M PackNew to Visual Studio Code? Get it now.
Nuvoton NuMicro Cortex-M Pack

Nuvoton NuMicro Cortex-M Pack

Preview

Nuvoton

|
192 installs
| (0) | Free
Nuvoton NuMicro Cortex-M Pack integrates essential extensions, configuration files, SVD support, OpenOCD setup, and template projects to simplify embedded development from setup to debugging.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nuvoton NuMicro Cortex-M Pack

Description

Nuvoton NuMicro Cortex-M Pack is a complete development toolkit for Nuvoton’s NuMicro Cortex-M microcontrollers in Visual Studio Code.

Outline

  • Features
  • Requirements
  • Getting Started
    • NuMicro Cortex-M Pack Environment Setup Guide
    • (Optional) Zephyr Project Setup Guide for Nuvoton NuMicro Cortex-M
  • Trouble Shooting

Features

The extension pack integrates essential components to simplify embedded development, including:

  • Essential extensions for VS Code.
  • Configuration files.
  • SVD (System View Description) support.
  • OpenOCD setup for debugging.
  • The PinView and LCDView help you with debugging.
  • Template projects to help you get started.
  • Extension version control prevents automatic extension upgrades from causing usage issues.
    • Caveat: You might be forced to use specific, fixed versions of the relevant extensions. For details, please see the sub-extension: Nuvoton Extension Version Manager.

Requirements

  • Visual Studio Code: Version 1.95.0 or higher.
  • Nu-Link_USB_Driver: Version 1.11 or higher. Nu-Link_USB_Driver download link

Getting Started

NuMicro Cortex-M Pack Environment Setup Guide

This guide walks you through setting up a NuMicro Cortex-M Pack project.

  1. Launch the VS Code application.

  2. Install the VS Code extension Nuvoton NuMicro Cortex-M Pack.

    • Nuvoton NuMicro Cortex-M Pack

      install_Nuvoton_Pack.png

    • Fix Arm CMSIS Solution version at 1.56.0
    • Fix Arm Debugger version at 1.4.4
  3. Prepare NuMicro BSP project

    • Go to Nuvoton Technology Corp, and download NuMicro BSP project. For example, M55M1.
  4. Open the VSCode folder in your downloaded NuMicro BSP

    • In Visual Studio Code, go to File → Open Folder…
    • Select the VSCode folder inside your project directory.

    open_vscodefolder

  5. Add Nuvoton Debug configuration (Optional — the BSP may have already done this for you)

    • Open .vscode/launch.json file, and insert the debug configuration in configurations
    • insert the debug configuration in configurations
    {
        "name": "Nuvoton Debug",
        "type": "cortex-debug-nuvoton",
        "request": "launch",
        "cwd": "${workspaceFolder}",
        "executable": "${command:embedded-debug.getApplicationFile}",
        "servertype": "openocd",
        "serverpath": "${command:openocd-helper.getOpenOcdPath}",
        "svdFile": "${command:openocd-helper.getSvdPath}",
        "configFiles": [
            "interface/cmsis-dap.cfg",
            "${command:openocd-helper.getOpenOcdConfigPath}"
        ],
        "runToEntryPoint": "main",
        "overrideLaunchCommands": [
            "monitor reset halt"
        ]
    }
    

    Nuvoton_Debug.png

  6. Ensure your settings in "Manage Solution" are properly configured (Optional — the BSP may have already done this for you)

    • Click on CMSIS in the active bar and then click on Manage Solution to set a context for your solution.
    • configure the Run & Debug settings.
    • Debug Configuration: Nuvoton Debug

      CMSIS_icon.png

  7. Check Device Status

    • Make sure the device is connected and recognized in Device Manager.
    • Only one NuMicro device can be connected at a time.
    • If a new VS Code instance is opened, the device in the Device Manager may be taken over by the newly opened VS Code. Close all instances of VS Code and restart to ensure proper device recognition.

      Device_Manager

  8. Execute Build, Run and Debug

    • Build

      build.png

    • Run

      run.png

    • Debug

      debug.png


(Optional) Zephyr Project Setup Guide for Nuvoton NuMicro Cortex-M

  1. Install Required Extension Packs

    Install the following extension packs:

    • Nuvoton NuMicro Cortex-M Pack
    • Zephyr IDE Extension Pack

    install_Nuvoton_Pack.png

    install_Zephyr_Pack.png

    Use the Zephyr IDE buttons in the following steps to create the environment.

    environment_setup.png

  2. Creating a Zephyr Project from Sample Code

    Create a new project using sample code. Choose a project template provided by the Zephyr IDE.

    select_template.png

  3. Add a build configuration and choose your target board, e.g., NuMaker-PFM-M467.

    select_board.png

  4. Add Runner Configuration (OpenOCD) Configure the project runner to use OpenOCD.

    configuration_complete.png

  5. Update Zephyr Project Runner Settings

    Go to View → Command Palette and run Update Zephyr Project Runner. Select the project to update the runner settings and refresh the settings.

    update_setting.png

    select_project.png

    update_complete.png

    refresh_settings.png

  6. Set the target type Please choose the target type for debugging according to the project.

    select_target_type.png

  7. Build Project and Flash to Target Use the build button to build and flash the firmware to your target board.

    build_flash.png

  8. Create launch.json Create the launch.json file used for debugging.

    create_launch.json.png

  9. Set the runToEntryPoint (optional) If you don’t want execution to stop at the main function when running in debug mode, set the runToEntryPoint parameter and specify the symbol function where you want it to stop (for example, Zephyr’s execution entry point z_arm_reset; for Nuvoton BSP projects, the entry point is Reset_Handler).

    entrypoint_setting.png

  10. Select Debug Settings Select Nuvoton Debug Zephyr.

    select_debug_setting.png

  11. Enter Debug Mode and Start Monitor for Output Launch the debugger and open the monitor or terminal to view runtime output.

    add_runner.png

    debug_and_monitor.png

Trouble Shooting

Build project

  1. CMSIS-Toolbox cannot find the path (missing vcpkg-configuration.json file)

    Clicking "Add to Arm Tools" buuton will generate vcpkg-configuration.json in VSCode.

    When connected to the Internet, it will download and install the related Arm tool settings.

    arm_tool1.png

    arm_tool2.png

Flash target

  1. Button becomes disabled

    flash_debug_icon.png

    Modify the cmsis-toolbox version in vcpkg-configuration.json and reactivate the environment - this will regenerate launch.json and task.json
    "arm:tools/open-cmsis-pack/cmsis-toolbox": "2.9.0",
    
  2. Waiting for a debug probe

    debug_probe.png

    Install the latest version of Nu-Link_USB_Driver

    Check whether the CMSIS-DAP device is connected

    Verify that the CMSIS-DAP option is enabled

    https://github.com/OpenNuvoton/Nuvoton_Tools/blob/master/Documents/NuLink2Pro.md

    Check whether any other application is using the CMSIS-DAP device

  3. Memory region at address is not writable

    program_region.png

    Check whether the latest version of the pack has been updated

    Check that the region to be programmed is defined in the .cbuild-run.yml file

    Make sure the connected device matches the model defined in csolution.yml — this affects flash size and SRAM size.

  4. Steps to update the pack settings in the project

    Modify the cbuild-pack.yml file to update the pack and version to the latest

    pack_update1.png

    Refresh to reload the pack and rebuild the solution

    pack_update2.png

Debug target

  1. Cannot halt at the main function

    It depends on AC6 optimization results. Not needed for GCC. Modify cproject.yml and add -fno-inline build option.

    ac6_build_option.png

Setup RTOS View

  1. Add some define to the RTOS project

    gcc_arm.ld

    Add the following to .data and .bss sections:

    KEEP(*(.freertos_tasks)) and KEEP(*(.freertos_globals))
    

    FreeRTOSConfig.h

    #define configUSE_TRACE_FACILITY        1
    Enable FreeRTOS trace facility, which is required to display    thread and task status information.
    
    #define configUSE_STATS_FORMATTING_FUNCTIONS 1
    Enable formatted statistics functions, used to generate tables    like those returned by uxTaskGetSystemState(), making it easier    to display the running status of each task.
    
    #define configRECORD_STACK_HIGH_ADDRESS 1
    Record the stack end address.
    
    #define INCLUDE_vTaskList 1
    Enable the vTaskList() function, which lists the status of all    tasks in the system.
    
    #define INCLUDE_uxTaskGetStackHighWaterMark 1
    Enable the uxTaskGetStackHighWaterMark() function, which returns    each task’s stack high-water mark.
    
    #define configGENERATE_RUN_TIME_STATS   0
    This option controls whether run-time statistics are generated.
    
    #define configGENERATE_RUN_TIME_STATS   1
    This option controls whether run-time statistics are generated.
    
    #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()  /* Define this    to initialize your timer/counter */
    
    #define portGET_RUN_TIME_COUNTER_VALUE()          /* Define this    to sample the timer/counter */
    These macros must be defined to set up and read the timer/counter    used for collecting run-time statistics.
    
  2. Add rtos options to launch.json file

    RTOS_option.png

  3. Add variable to main function of the project

    static volatile int uxTopUsedPriority;
    uxTopUsedPriority = configMAX_PRIORITIES - 1;
    

    RTOS_view.png

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft