Visual studio code里ncs下载加速
鉴于简中网络环境的特异性,开发nrf54L系列必须使用nRF Connect SDK(NCS)/Zephyr开发,导致下载痛苦不堪。依据ncs的更新日志:
[00:00:51] Stale build configuration (hello_world - build): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[00:00:51] Stale build configuration (hello_world - build_1): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[00:00:51] Stale build configuration (blinky - build): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[00:00:51] Stale build configuration (hello_world - build/hello_world): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[00:00:51] Stale build configuration (hello_world - build_1/hello_world): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[00:00:51] Stale build configuration (blinky - build/blinky): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[00:01:55] nrfutil-sdk-manager install,v3.1.1,--sdk-path,c:\ncs\v3.1.1,--type,nrf: Install toolchain v3.1.1
[00:01:55] nrfutil-sdk-manager install,v3.1.1,--sdk-path,c:\ncs\v3.1.1,--type,nrf: Toolchain with version v3.1.1 already installed: success
[00:01:55] nrfutil-sdk-manager install,v3.1.1,--sdk-path,c:\ncs\v3.1.1,--type,nrf: Calculating SDK checksum
[00:01:55] nrfutil-sdk-manager install,v3.1.1,--sdk-path,c:\ncs\v3.1.1,--type,nrf: Verified previously download file: success
[00:01:55] nrfutil-sdk-manager install,v3.1.1,--sdk-path,c:\ncs\v3.1.1,--type,nrf: Download SDK v3.1.1
[00:05:33] =========== Toolchain validation report for nRF Connect SDK Toolchain v3.1.1 ===========
再依据C:\Users\hec.vscode\extensions\nordic-semiconductor.nrf-connect-2025.8.654-win32-x64\platform\nrfutil\logs\nrfutil-sdk-manager.log文件的内容找到位于https://files.nordicsemi.com/ui/native/ncs-src-mirror/external/sdk-manager/目录下的3个配置文件,分别为:
../
config-cn.json 31-07-25 23:33:12 +0800
config.json 31-07-25 23:32:16 +0800
configChanges.json 08-05-25 17:13:29 +0800
index.json 19-09-25 21:01:43 +0800
根据configChanges.json的内容:
{
“versions”: {
“1”: {
“index_url”: “https://files.nordicsemi.com/artifactory/ncs-src-mirror/external/sdk-manager/index.json”,
“download_url_template”: “https://files.nordicsemi.com/artifactory/ncs-src-mirror/sdk-nrf/{version}/src.tar.gz”
}
}
}
可以猜测到下载地址,但是实际上加上版本号,输入文件名后仍无法下载,再经摸索,发现在如下地址可以下载:https://files.nordicsemi.cn/artifactory/ncs-src-mirror/external/v3.1.1/src.tar.gz
简单来说,如果要加速下载过程,可以从如上网址下载ncs sdk包,然后重要的一步:改名为sdk-nrf-bundle-v3.1.1.tar.gz,存放到目录C:\ncs\downloads下,然后执行升级sdk的常规流程。可以看到正在解压缩,以及安装完成的日志
[22:50:21] Unable to find the toolchain at path: C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
[22:50:21] Unable to find the toolchain at path: C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
[22:52:01] nrfutil-sdk-manager install,v3.1.1,–sdk-path,c:\ncs\v3.1.1,–type,nrf: Install toolchain v3.1.1
[22:52:01] nrfutil-sdk-manager install,v3.1.1,–sdk-path,c:\ncs\v3.1.1,–type,nrf: Toolchain with version v3.1.1 already installed: success
[22:52:01] nrfutil-sdk-manager install,v3.1.1,–sdk-path,c:\ncs\v3.1.1,–type,nrf: Download SDK v3.1.1
[23:16:24] Stale build configuration (hello_world – build): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[23:16:24] Stale build configuration (blinky – build): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[23:16:24] Stale build configuration (hello_world – build/hello_world): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[23:16:24] Stale build configuration (blinky – build/blinky): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[23:16:24] Stale build configuration (hello_world – build): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[23:16:24] Stale build configuration (blinky – build): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[23:16:24] Stale build configuration (hello_world – build/hello_world): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[23:16:24] Stale build configuration (blinky – build/blinky): Unable to find the SDK at path: C:/ncs/v3.1.0/zephyr
[23:16:36] nrfutil-sdk-manager install,v3.1.1,–sdk-path,c:\ncs\v3.1.1,–type,nrf: Install toolchain v3.1.1
[23:16:36] nrfutil-sdk-manager install,v3.1.1,–sdk-path,c:\ncs\v3.1.1,–type,nrf: Toolchain with version v3.1.1 already installed: success
[23:16:36] nrfutil-sdk-manager install,v3.1.1,–sdk-path,c:\ncs\v3.1.1,–type,nrf: Calculating SDK checksum
[23:16:44] nrfutil-sdk-manager install,v3.1.1,–sdk-path,c:\ncs\v3.1.1,–type,nrf: Verified previously download file: success
[23:16:44] nrfutil-sdk-manager install,v3.1.1,–sdk-path,c:\ncs\v3.1.1,–type,nrf: Unpack SDK v3.1.1
[23:19:27] nrfutil-sdk-manager install,v3.1.1,–sdk-path,c:\ncs\v3.1.1,–type,nrf: Unpacked SDK tarball: success
[23:19:29] Unable to find the toolchain at path: C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
[23:19:29] Unable to find the toolchain at path: C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
[23:27:58] =========== Toolchain validation report for nRF Connect SDK Toolchain v3.1.1 ===========
📦 Using the nRF Connect SDK v3.1.0 at c:\ncs\v3.1.0
No issues were detected with the toolchain.
另外检索到一个有用的信息,外网和内网的下载路径是不同的,外网是com域名,内网是cn域名。