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

Nuvoton NuCodeGen

Preview

Nuvoton

nuvoton.com
|
81 installs
| (0) | 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
    • Troubleshooting
      • Shell Integration Unavailable
        • Solution 1. Enable Shell Integration
        • Solution 2. Configure VSCode to Use the Correct Shell
        • Solution 3. Update PowerShell
      • #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 participant 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.95.0 or higher is recommended.
  • Install VS Code Extension: GitHub Copilot.
  • Need a GitHub Account to sign in to the Github Copilot extension.

Commands

  1. Chat participant
    • use @nucodegen to communicate with nucodegen participant
  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
  3. Tools
    • #buildcode: build your project and try to fix any build errors
    • #debugcode: load your code and run the debugger

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.
  4. Make sure GitHub Copilot is signed in.

    • If it isn’t: Command Palette (Ctrl+Shift+P) → “GitHub Copilot: Sign in”.
  5. Click copilot icon.

    copilot icon

  6. Access chat in VS Code

    • Set chat mode to Ask.
    • Recommended Language Model: Claude Sonnet.
      Please check the GitHub Copilot plan for details on the free and subscription models.
      Noted: Sonnet 3.7 is not supported in VS Code.

      claude sonnet 3.7

  7. Generate your code:

    • Use /{peripheral_name}_settings to get configurable settings and an example prompt.

      gencode step1

      example prompt

    • 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

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

      always allow

  8. Change mode of gencode step

    • You can change the mode of gencode step to tool calling mode.
    • In tool calling mode, the model can call tools to help generate code, such as searching for functions or macros in the library files, searching relevant code snippets from OpenNuvoton GitHub repository, etc.
    • Click Tool Calling setting to enable tool calling mode at the gencode step.

      enable tool calling

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
© 2025 Microsoft