Skip to the content.

nRF Connect SDKとnRF Connect for Desktopは別物

2024/05/26

J-Linkのことはひとまず忘れて nRF Connect SDKを使ってみる。

nRF Connect for Desktopをインストールした。

私は “nRF Connect” のところだけ見て、これが nRF Connect SDK なのだろうと思い込んでいた。 しかしこれは単なるアプリ集で、Nordicの開発ボードであれば自動で認識したりして便利そうなのだが、そうでない場合はあまり使い道がないような気がする。 J-Link LITE Cortex-M V8をつないでみたのだが、サポートしていなかったのでこれ以上の確認は止めた。

nrf


nRF Connect SDKのドキュメントページはここか。

https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/index.html

手持ちで使えそうなのが太陽誘電さんの nRF52832 ボードだけである。Flashが512KBなので nRF52832AA か。256KBなら ABである。
なのでGetting started with nRF52 Seriesを見るが、nRF Connect for Dsktopをインストールするように書かれている。 まあ、ハードウェアとしてnRF DKが選ばれているので、それならば仕方あるまい。

このページを参照するのがよさそうだ。

インストール

ここを参考にしてnRF Connect SDK関連をインストールする。

nRF Connect SDKによるBluetooth LE 簡単スタートアップ - 加賀デバイス株式会社

以下は nRF Connect for VS Code Extension Pack の「Install Toolchain」でインストールされる。

VS codeの関係しそうな Extension はいくつかあるが、pack なのでまとめてインストールしてくれる(C/C++なども)。 それはよかったのだが、”Install Toolchain”ボタンを押してもエラーっぽい表示はあるものの、うんともすんともいわない。

nrf

J-Linkとnrf-command-line-toolsを再インストールするとうまくいった。まあよかろう。

nrf

Toolchainのインストールはすぐ終わるが、SDKのインストールはけっこう時間がかかる。 Windowsでは「c:\ncs」にインストーすしているようだ。

サンプルソフトのビルド

サンプルソフトは Step3 をまねして BLE UART service を使った。
Build Configurationの”Board”は「nrf52sdk_nrf52832」を選んだ。チップ名だけで決めた。
“Build Configurations”ボタンをクリックしてしばし待つと、warningは出るものの一応おわったっぽい。

nrf

が “[ACTIONS]” なんて出てこない。

nrf

vscodeを閉じて開いたら出てきた。初回だけだろうか。

UARTのピンアサイン変更

太陽誘電さんの評価ボードはFT232を使ってUSB-Serial変換をしている。

先ほど Build Configurationで選択した「nrf52sdk_nrf52832」はこうなっていた。

nrf

FT232のRXDがnRFのTXDにつながっていればよいのであれば、このままでよいのかな。

ビルドと書込み

これは書いてあるとおりなのだが、アイコンでなくてもクリックしたら動作するので注意だ。
そして、Flashでエラーになった。

 *  Executing task: nRF Connect: Build: peripheral_uart/build (active) 

Building peripheral_uart
C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir u:/Prog/BLE/nrf52-ncs/peripheral_uart/build u:/Prog/BLE/nrf52-ncs/peripheral_uart"

ninja: no work to do.
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: nRF Connect: Flash: peripheral_uart/build (active) 

Flashing build to 518006130
C:\WINDOWS\system32\cmd.exe /d /s /c "west flash -d u:\Prog\BLE\nrf52-ncs\peripheral_uart\build --skip-rebuild --dev-id 518006130 --erase"

-- west flash: using runner nrfjprog
-- runners.nrfjprog: mass erase requested
-- runners.nrfjprog: reset after flashing requested
-- runners.nrfjprog: Flashing file: u:\Prog\BLE\nrf52-ncs\peripheral_uart\build\zephyr\zephyr.hex
[ #################### ]   0.095s | Erase file - Done erasing                                                          
[ #################### ]   2.663s | Program file - Done programming                                                    
[ #################### ]   1.825s | Verify file - Done verifying                                                       
[error] [ Worker] - An unknown error.
[error] [ Client] - Encountered error -102: Command read_device_info executed for 47 milliseconds with result -102
[error] [ Client] - Encountered error -102: Command read_memory_descriptors executed for 31 milliseconds with result -102
Failed to read device memories.
[error] [ Worker] - An unknown error.
ERROR: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
FATAL ERROR: command exited with status 33: nrfjprog --pinresetenable -f NRF52 --snr 518006130

 *  The terminal process terminated with exit code: 33. 

近そうなのはあったのだが、prj_minimal.confCONFIG_BOARD_ENABLE_DCDC=nを追加したものの効果はなかった。
まだまだだなー。