nRF5340-DK で nRF Connect SDK を使用して各種機能確認を進めているのでメモ。基本的には samples が充実しているのである程度理解や知識が進めば困ることはなさそう。
ただ nRF Connect SDK は Zephyr OS がベースであり、何もしならない状態ではまずの第一歩が少し難しそう。Web上に情報は多いので必要な情報は十分ありそうなのだが、多いがためにどの順序で見ていけばよいか悩むところ。
ということで各種情報をあとから見直すためのメモ。 まずは公式のイントロダクション動画や紹介動画、webセミナー(Webinar)から入るのが良いのではと思えるので、その順序で並べておく。
見る(nRF5340 DK、nRF Connect for VS Code)
まず最初に、ひとまず開発環境の構築や開発ができるようになるための手順。
- Introducing the nRF5340 DK
- https://www.youtube.com/watch?v=LS2XEB5xIFs
- nRF5340 DK を使用するうえでの基本的な知識
- https://www.youtube.com/watch?v=LS2XEB5xIFs
- Future-proofing IoT development with nRF Connect SDK
- https://www.youtube.com/watch?v=_Myyxc94APQ
- nRF Connect SDK で開発するための基本的なベースから手順まで幅広くカバーしており、最初にかなりよさそう
- https://www.youtube.com/watch?v=_Myyxc94APQ
- Introducing nRF Connect for VS Code
nRF Connect for VS Code tutorials
- https://www.youtube.com/watch?v=zcMCaODyISo&list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl
- 現時点で以下の6本が提供されている
- nRF Connect SDK を使用する場合は実際には VS Code (Visual Studio Code)を開発環境として使用して開発を進めていくが、それを具体的な手順ベースで紹介しており、まず最初に見た目でどの箇所をどのように操作しておけばよいかよいかわからないような状況において、役に立つ。
- nRF Connect for VS Code, part 1: Installation
- nRF Connect for VS Code, part 2: Creating an application
- nRF Connect for VS Code, part 3: Building an application
- nRF Connect for VS Code, part 4: Flashing an application
- nRF Connect for VS Code, part 5: Debugging Nordic Semiconductor
- nRF Connect for VS Code, part 6: Changing SDK- and toolchain versions
- https://www.youtube.com/watch?v=zcMCaODyISo&list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl
Getting started with custom development in nRF Connect SDK
読む(学ぶ)
なんとなくわかったところで、実際に手を動かしてある程度手が動くようになるまでの手順や学習。
- nRF Connect SDK Fundamentals
- https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/
- 最初に役に立つ
- 以下の章立て。すべて役に立つ。(必要)
- Lesson 1 – nRF Connect SDK Introduction
- Lesson 2 – Reading buttons and controlling LEDs
- Lesson 3 – Elements of an nRF Connect SDK application
- Lesson 4 – Printing messages to console and logging
- Lesson 5 – Serial communication (UART)
- Lesson 6 – Serial communication (I2C)
- Lesson 7 – Multithreaded applications
- Lesson 8 – Thread synchronization
- https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/
見る(Zephyr OS)
その次に、Zephyr RTOS を知って自在にコーディングや機能のつくり込みができるようになるための手順。
- Zephyr 101 - Getting Work Done with Threads, Work Queues and Timers
- Zephyr 101 - Thread Control
- Zephyr 101 - Using the Device Tree
- Zephyr 101 - Multi-Event Polling and Thread Control
読む
- Writing device drivers for UART peripherals
- Devicetree — Zephyr Project Documentation
- https://docs.zephyrproject.org/latest/build/dts/index.html
- Zephyr OS の Devicetree について。最終的には全部重要だった。がまずは最低限以下を把握しておけば大丈夫そう。(残りは流し読み & 必要になれば戻ってきて詳細を読み込む)
- Devicetree access from C/C++ — Zephyr Project Documentation
- https://docs.zephyrproject.org/latest/build/dts/api-usage.html
- 結局プログラムから使用するにはどうすればよいか、という観点側からのアプローチ。具体的で理解しやすいと思う。
- https://docs.zephyrproject.org/latest/build/dts/api-usage.html
- Devicetree HOWTOs — Zephyr Project Documentation
- https://docs.zephyrproject.org/latest/build/dts/howtos.html
- こういったときはどうすれば?という方面からのアプローチ。意外とやりたいことはこの中に収まる(のでは)。
- https://docs.zephyrproject.org/latest/build/dts/howtos.html
- https://docs.zephyrproject.org/latest/build/dts/index.html
- Kernel Services — Zephyr Project Documentation
- https://docs.zephyrproject.org/latest/kernel/services/index.html
- OS が提供する基本的な機能やAPI、説明はすべてここからたどれる。
- 自分がしたいことはどの機能を使用すると適切なのかを把握するために、どのような機能が提供されているのかを一通り目を通しておくのが良い。
- https://docs.zephyrproject.org/latest/kernel/services/index.html
- OS Services — Zephyr Project Documentation
- https://docs.zephyrproject.org/latest/services/index.html
- OS の基本機能(RTOSの基本提供機能)ではなく、それを使用して使う側に提供しているサービス
- 自分がやりたいことと関係がなければ詳細を見ることはないが、Logging はさすがに把握しておく必要がありそう。
- https://docs.zephyrproject.org/latest/services/index.html
その他
優先度は低いけれども情報を探しておいたのでメモ。
- nRF Connect SDK / Getting started / Installing automatically
- nRF Connect for VS Code / Get started / How to install the extension
- https://nrfconnect.github.io/vscode-nrf-connect/get_started/install.html
- もし nRF Connect for VS Code の環境構築の仕方に迷ったら or わからなくなったら
- https://nrfconnect.github.io/vscode-nrf-connect/get_started/install.html
Nordic nRF5340 PDKを使おう~nRF Connect for VS CodeをセッティングしてVisualStudioCodeで使う~ - Qiita
- https://qiita.com/usashirou/items/00f37ab2180b0f54da83
- 一通りの手順が日本語で記述されているので一番読みやすいかもしれない。(ただしこの情報が最新ではなくなる可能性が時間の経過とともに高まってくるので現時点ではよいけれども、将来的にも良いかどうかはわからない)
- 開発開始が若くまだまだインストールの仕方も変わっていくと考えられるので、先に挙げた公式サイトの内容に従うのが一番良い
- https://qiita.com/usashirou/items/00f37ab2180b0f54da83
Introduction to the Zephyr RTOS
- https://www.youtube.com/watch?v=jR5E5Kz9A-k
- 見たけれども(私の今回の場合では)あまり必要なかった
- https://www.youtube.com/watch?v=jR5E5Kz9A-k
- Zephyr Devicetree Mysteries, Solved - Marti Bolivar, Nordic Semiconductor
- https://www.youtube.com/watch?v=w8GgP3h0M8M
- 参考としてみる分には面白い(がちょっと難しく、現時点では内容に追いつけない)
- https://www.youtube.com/watch?v=w8GgP3h0M8M
- Zephyr 101 - Learn the basics to get your first build
- https://www.youtube.com/watch?v=02WjkF_v_30
- 見たけれども(私の今回の場合では)あまり必要なかった
- https://www.youtube.com/watch?v=02WjkF_v_30
- Zephyr入門(概要 & (スケジューラ:概要編))
- https://qiita.com/ueba/items/c5fe99bedd8862854ebd
- OS自体を深く知る分には有用。今回は(私の場合では)使う分には参考程度でよさそうと判断。
- https://qiita.com/ueba/items/c5fe99bedd8862854ebd
- Making a device driver for nrf52833 using Device Tree for SPI supported device that is not available in zephyr/drivers/sensors
- https://devzone.nordicsemi.com/f/nordic-q-a/89759/making-a-device-driver-for-nrf52833-using-device-tree-for-spi-supported-device-that-is-not-available-in-zephyr-drivers-sensors
- SPIを使用したセンサの drivers のレイヤのつくり方や参考、例についての問い合わせ。以下が参考になるとの回答が得られている。
- Zephyr 101 - Introduction to Drivers
- Zephyr 101 - Rolling Your Own Drivers
- https://devzone.nordicsemi.com/f/nordic-q-a/89759/making-a-device-driver-for-nrf52833-using-device-tree-for-spi-supported-device-that-is-not-available-in-zephyr-drivers-sensors