nRF Util - 使用手冊

原文內容

🔔 nRF Util User Guide https://infocenter.nordicsemi.com/pdf/nRF_Util_v7.1.0.pdf


1. 指令


nrfutil 內建的指令

Command Description
help Show comprehensive documentation
install 下載 安裝 nrfutil 指令集
upgrade nrfutil 指令升級至最新版本
uninstall 卸除 nrfutil 指令 [aliases: remove]
prepare-offline 下載離線用的安裝包
search 顯示nrfutil可安裝的指令
list 顯示已安裝的 nrfutil 指令集
self-upgrade nrfutil 核心升級


2. 配置需求


安裝 使用nRF Util前所需要的配置軟體

    ● SEGGER J-link - 所有平台都須要,從 SEGGER J-Link Software.下戴

🆆 Windows

    ● Microsoft Visual C++ Redistributable - 從 Microsoft Visual C++ Redistributable. 下載

🅻 Linux

    ● libusb-1.0 and nRF-udev - 依下列步驟操作安裝

sudo apt install libusb-1.0-0

    下戴最新的 .deb from nRF-udev.

sudo dpkg -i nrf-udev_1.0.1-all.deb


3. nRF Util 安裝


參考 https://lungtenghsu.blogspot.com/2024/02/nrf-util.html


4.3 更新 nRF Util


確認是否有新版本

nrfutil list --outdated

版本更新

nrfutil upgrade


4.4 nRF Util 離線安裝


1. 預先透過網路下載安裝檔 (E:/nrfutil-offline 路徑自訂)

nrfutil prepare-offline E:/nrfutil-offline

2. 使用離線檔案安裝

nrfutil install device --from-offline E:/nrfutil-offline

使用新版本更新

nrfutil upgrade --from-offline E:/nrfutil-offline


5.2.1 使用SEGGER J-Link OB debugger來燒錄裝置


1. 找到連接電腦的 J-Link裝置序號

nrfutil device list --traits jlink

2. 清除IC firmware

nrfutil device erase --serial-number xxxxxxxxx

3. 燒錄新的firmware

nrfutil device program --serial-number xxxxxxxxx --firmware /path/fw.hex

4. Reset重啟裝置

nrfutil device reset --serial-number xxxxxxxxx

也可使用 --options 來達成上述1至4的步驟

nrfutil device program --serial-number xxxxxxxxx --firmware /path/fw.hex --options chip_erase_mode=ERASE_ALL,reset=RESET_SYSTEM


5.2.2 透過Nordic Secure DFU來更新nRF52840 Dongle


Nordic Secure DFU 是經由串列埠(Serial)來傳輸

燒錄的hex是須要被打包成DFU package(Zip)的,參考 Generating DFU packages

1. 列出DFU trigger 介面的裝置

nrfutil device list --traits nordicDfu


❗ 如果未顯示裝置,按壓 Reset pin讓Dongle進入 programming mode


2. 透過DFU串口寫入firmware

nrfutil device program --firmware dfu_package.zip --serial-number xxxxxxxxxxxx

完成後Dongle既進入Application mode,這動作可由 --option 來決定,參考

nrfutil device program --help


補充



DFU over Bluetooth Low Energy

nrfutil dfu ble -pkg app_dfu_package.zip -ic NRF52 -p COM3 -n "MyDevice" -f

DFU over a serial UART connection

nrfutil dfu serial -pkg app_dfu_package.zip -p COM3 -b 115200

DFU over a serial USB connection

nrfutil dfu usb-serial -pkg app_dfu_package.zip -p COM3 -b 115200


留言