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.
Make sure you have downloaded the required NuMicro BSP in this step, and opened its VSCode directory in Visual Studio Code.
Make sure GitHub Copilot is signed in.
If it isn’t: Command Palette (Ctrl+Shift+P) → “GitHub Copilot: Sign in”.
Click copilot icon.
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.
Generate your code:
Use /{peripheral_name}_settings to get configurable settings and an 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.
Click Always Allow to enable automatic execution of command line operations.
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.
Troubleshooting
Shell Integration Unavailable
During the process of building the code, you may encounter a Shell integration unavailable issue.