Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Nuvoton NuCodeGenNew to Visual Studio Code? Get it now.
Nuvoton NuCodeGen

Nuvoton NuCodeGen

Nuvoton

nuvoton.com
|
775 installs
| (1) | Free
Streamline your NuMicro firmware development with AI-powered interactive chat, NuMicro BSP-compatible code generation, and automated build testing.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nuvoton NuCodeGen

Description

Nuvoton NuCodeGen is an AI-powered autonomous coding extension that generates code based on the library files of chip series and utilizes tools to edit files, build projects, retrieve functions or macros from the library files, and fix code errors.

Outline

  • Nuvoton NuCodeGen
    • Description
    • Outline
    • Features
    • Requirements
    • Commands
    • Getting Started
    • Example Prompts
    • Troubleshooting
      • Shell Integration Unavailable
      • #githubRepo Tool Not Working

Features

  • A chat extension for VSCode building on GitHub Copilot Chat.
    • Use a prompt to generate snippet code based on Nuvoton STDdriver API.
    • Use a prompt to query all kinds of information related to the NuMicro BSP standard driver.
  • Add a custom agent to Copilot Chat
    • Allows customization of how user requests are handled.
  • Add custom commands and tools
    • Support various peripherals
    • Helps with building and correcting bugs.

Requirements

  • Visual Studio Code: Version 1.110 or higher is recommended.
  • Install VS Code Extension: GitHub Copilot.
  • Need a GitHub Account to sign in to the Github Copilot extension.
  • Ensure that your corporate or personal firewall does not block VS Code's network access during the installation of extensions.

Commands

  1. Custom agent
    • Select NuCodeGen as the agent in the Copilot Chat interface.
  2. Slash commands
    • /{peripheral_name}: handle issues related to the specified peripheral. For example,
      • /pdma: generate code for PDMA functionality
      • /clk: generate code for peripherals' clocks
      • /spi: what are limits for SPI_Open function?
      • /clk: how many clock sources does SPI0 have?
    • /{peripheral_name}-settings:
      • List the relevant settings for the specified peripheral
      • Example prompt format for settings
    • /build-project: build your project and try to fix any build errors
    • /debug-project: load your code and run the debugger
  3. VSCode commands
    • NuCodeGen:Add User-Defined Sub-Skill
      • Add a user-defined sub-skill defining rules and constraints for a specific peripheral in specific application scenarios to improve related code generation.
      • Added sub-skills will be stored in the ~/.copilot/skills/nucodegen/ directory.
    • NuCodeGen:Delete User-Defined Sub-Skill
      • Remove the user-defined sub-skill for a specific peripheral.
    • NuCodeGen:Open Sub-Skill
      • Open the sub-skill file for a specific peripheral to edit, including user-defined and default sub-skills.

Getting Started

  1. Launch the VS Code application.

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

  3. Follow the "Getting Started" section in the "Overview" of the Nuvoton NuMicro Cortex-M Pack.

    • Make sure you have downloaded the required NuMicro BSP in this step, and opened its VSCode directory in Visual Studio Code.

    NOTE: The NuCodeGen agent is activated only if a CMSIS‑solution project is present.

  4. Make sure GitHub Copilot is signed in.

    • If it isn’t: Command Palette (Ctrl+Shift+P) → “GitHub Copilot: Sign in”.
  5. Click the Chat button to open the Chat Panel.

    copilot icon

    Access `Chat Input Box` in `Chat Panel`
    • Recommended Language Model: The latest and greatest Claude model.
      Please check the GitHub Copilot plan for details on the free and subscription models.

    NOTE: The use of less capable language models can significantly compromise the quality of the code generation.

  6. select NuCodeGen as the agent in the Copilot Chat interface.

    gencode step1

    NOTE: If you cannot find the NuCodeGen agent, please make sure you have opened the correct folder that contains the CMSIS-solution project. The agent is designed to be activated only in the context of a CMSIS-solution project to ensure relevant code generation.

  7. Generate your code:

    • Method 1: Repeatly get configurable settings and example prompts, then generate code based on user-adjusted settings.

      NOTE: This method guarantees high accuracy because you control all the parameters, but it requires more steps and manual tuning.

      1. Use /{peripheral_name}-settings to get configurable settings and an example prompt.

        gencode step1

        example prompt

      2. Based on the example prompt, use /{peripheral_name} to generate your code.

        • Each setting can be adjusted based on your needs.
        • Without clear configuration settings, the likelihood of generating incorrect configurations is higher.

        gencode step2

    • Method 2: Directly generate code by describing your needs in natural language.

      NOTE: This method feels more natural because you just state the goal, but it can miss key details and lead to inaccurate code generation.

      oneshot prompt example

    • Click Always Allow to enable automatic execution of command line operations.

      always allow

  8. Add your own sub-skill for a specific peripheral to improve code generation related to that peripheral.

    • Method 1: Open Command Palette (Ctrl+Shift+P) → Enter NuCodeGen:Add User-Defined Sub-Skill
    • Method 2: Right-click in editor → Focus on NuCodeGen → Select Add User-Defined Sub-Skill

Example Prompts

  • NuCodeGen Example Prompts provide a collection of example prompts for various peripherals. These prompts can be used as references to help you generate code for your specific use cases.

Troubleshooting

Shell Integration Unavailable

  • During the process of building the code, you may encounter a Shell integration unavailable issue. shell integration unavailable

    • Solution 1. Enable Shell Integration

      1. Open VSCode
      2. Click Manage -> Settings

        settings

      3. Search terminal.integrated.shellIntegration.enabled
      4. Make sure this feature is turned on.

        enable shell integration

    • Solution 2. Configure VSCode to Use the Correct Shell

      1. Open VSCode
      2. Press Ctrl + Shift + P
      3. Type Terminal: Select Default Profile and choose it
      4. Select one of the supported shells: e.g. git bash, or PowerShell.
        • CMD (Command Prompt) does not support shell integration.
    • Solution 3. Update PowerShell

      If you still encounter the same issue when using PowerShell, upgrade PowerShell to version 7 or later.

      1. Check current PowerShell version by running: $PSVersionTable.PSVersion
      2. If your version is below 7, update PowerShell.

#githubRepo Tool Not Working

  • In the gencode step, the tool-calling mode may retrieve relevant code snippets from the OpenNuvoton GitHub repository.
  • If you encounter issues with the #githubRepo tool.

    #githubRepo tool not working

  • Please ensure that your internet connection is stable and try again.
  • If the problem persists, please use Copilot on the GitHub site to ask a question related to the repository.

    ask github copilot

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