作者 / Author · fangcuiqun
Build Xtensa DSP projects from VS Code using the Xplorer command-line toolchain. Select your target Core, switch between Debug and Release, and check your floating license from the Xplore sidebar.
中文说明
Features
- Build from the sidebar or status bar. Open or switch projects, build, clean, rebuild, or stop a running task. Build logs appear in the VS Code task terminal, and GCC-style diagnostics appear in the Problems panel.
- Debug and Release profiles. The extension remembers your selection per project. It passes the selected mode to Make and CMake builds, and exposes it to custom build scripts.
- Xtensa toolchain and Core settings. The extension detects the standard Windows installation, shows the resolved path, and lets you set the Core name and configuration directory from your chip SDK.
- License testing and seat checks. Save a license server or file once and reuse it across projects. Test the server connection and run a short compiler probe. When
lmutil is configured, the extension compares seat records before the operation and about 10 seconds after it exits. The green activity light shows when a build or license test is running.
- Sample projects. Try a minimal C build or a ten-file audio processing project with separate Debug and Release outputs.
Requirements and quick start
- Install VS Code 1.85 or newer, the Xtensa command-line toolchain, the target Core package from your chip SDK, and a valid license. Supply an existing Makefile, CMake build, or SDK script.
- Use Install from VSIX in VS Code. Open the Xplore sidebar, choose your project folder, and trust the workspace before running build tasks.
- Set the Core name and configuration directory. On Windows, leave the toolchain path empty to enable automatic discovery.
- Enter a license server as
IP:port or port@host, or enter a license-file path. Choose 测试激活 to test the connection and compile a temporary source file.
- Select Debug or Release and click 编译 to build. For a full build log, use 重新编译.
The included samples have been verified with the local HiFi4 toolchain. To build for HiFi5, install the target Core package and use your SDK's Core settings. HiFi5 hardware projects and floating-seat return are pending validation.
✉️ Email · fangcuiqun@163.com
When reporting an issue, include the extension version, toolchain version, target Core, and relevant build output.
中文说明
在 VS Code 中调用 Xtensa Xplorer 的命令行工具链编译 DSP 工程。左侧活动栏打开 Xplore 后可以修改工程配置,底部状态栏提供工程选择、编译、重新编译、清理和设置。编译时点击 停止 可终止 VS Code 构建任务。终端显示构建输出,GCC 格式诊断会出现在“问题”面板。
功能介绍
- 一键构建。从侧栏或底栏打开工程,执行编译、清理、重新编译和停止。点击 Debug / Release 切换模式,插件按工程记住选择。
- 工具链和 Core 配置。自动检测 Windows 标准安装路径并显示完整目录,可按芯片 SDK 设置 Core 名称和配置目录。
- 许可证测试。保存一次服务器或许可证文件后跨工程复用,支持连接检查、临时试编译和构建活动提示。配置
lmutil 后可延时核对席位。
- 示例工程。随包提供最小 C 工程和包含 10 个 C 文件的音频处理工程,可验证 Debug 与 Release 构建。
侧边栏依次显示 打开或切换工程、Core 配置、编译、许可证与工具链。HiFi5 工程需要安装目标芯片的 Core 和 SDK,本机已用 HiFi4 验证示例编译。
安装和配置
- 在 VS Code 的扩展面板选择“从 VSIX 安装”,然后在 Xplore 侧边栏点击 打开或切换工程,选择已有 Makefile 或构建脚本的文件夹,并信任工作区。底部的工程名也能打开文件夹选择器。
- 构建目录默认是工程根目录。需要自定义构建目录、命令或参数时,可在 VS Code 设置中搜索
@ext:fangcuiqun.xplore-tool @tag:advanced。
- 设置 芯片 Core 和 Core 配置目录,HiFi5 的值以芯片 SDK 为准。XtensaTools 安装路径默认自动查找,优先使用已有的
XCC_DIR,或扫描 Windows 标准位置 C:/usr/xtensa/XtDevTools/install/tools。侧边栏直接显示实际使用的完整路径,路径过长时可悬停查看。自定义安装可点击该项手动填写。
- 构建程序默认为
xt-make,编译参数默认为空数组,清理参数默认为 ["clean"]。如果项目使用 CMake,可将程序设为 cmake,参数设为 ["--build", "build"],清理参数设为 ["--build", "build", "--target", "clean"]。批处理可用 cmd.exe 并提供 ["/d", "/c", "build.bat"]。
- 点击 许可证服务器 / 文件,填入 IDE 使用的
IP:端口,例如 192.0.2.10:27000。也可填 27000@license-server 或许可证文件绝对路径。设置保存在本机用户设置,所有工程可以复用,默认传入 LM_LICENSE_FILE。
测试工程与激活
要看完整的多文件构建日志,可打开随包提供的音频处理测试工程 examples/xtensa-audio,再点击「重新编译」。它会编译 10 个 C 文件并链接 audio_demo.elf。
在 VS Code 选择「打开文件夹」,打开本仓库的 examples/xtensa-smoke。示例配置选择本机已装的 HiFi4 Core,点击「编译」会生成 smoke.o。切换 HiFi5 时,填写目标芯片的 Core 与配置目录,再点击「重新编译」。
填好服务器后点击侧边栏的 测试激活。插件检查服务器 TCP 端口,再用配置的 Core 运行一次 xt-clang 试编译。测试连接和编译进程随后退出。结果会显示在侧边栏和通知中。若工具链还有其他许可证来源,试编译通过只能说明当前环境可编译,服务器的席位记录可用于进一步确认。
许可证占用
许可灯显示在侧栏 编译 标题和底栏 Debug / Release 旁。构建或测试激活运行时亮绿,空闲时为空心。服务器查询结果显示在 席位归还核对 一栏。
每次启动构建任务时,插件只向该任务传递许可证环境变量。需要授权的编译器、链接器等工具按其许可机制向 FlexNet 借出席位,并在工具进程退出时按许可证服务器策略归还。服务器若设置了 linger,或启用了离线借用,席位可能延迟归还。插件不会启动 Xplorer IDE 或许可证服务。许可证文件需要使用已签发的有效授权。
使用单一浮动服务器时,可在 FlexNet 查询工具 填写管理员提供的 lmutil.exe 路径,或将工具加入 PATH。插件在构建或试编译前读取席位基线,结束约 10 秒后后台读取一次,对比本机当前用户的新增席位记录。发现新增占用时弹出提醒。席位共享、同一用户在本机的其他进程和服务器可见性会影响判断。
本版本从已有构建入口运行工程,不从 Xplorer 的 Eclipse 工程描述生成 Makefile。工具链设置参考 NXP 的 Xplorer 命令行指南。
构建模式如何传入工程
各构建任务收到 XPLORE_BUILD_MODE。Make 工具还会收到 CONFIG,Makefile 可读取它并设置编译参数。CMake 的 --build 命令在未指定 --config 时会添加选中的模式。自定义脚本须读取模式变量并自行选择对应的构建参数或目录。示例工程的 Debug 和 Release 产物分别保存,清理以当前模式为准。
📬 支持与联系
✉️ 联系邮箱 · fangcuiqun@163.com
反馈问题时,请附上插件版本、工具链版本、目标 Core 和相关构建日志。