2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Wio TerminalでBluetooth(その1)

Posted at

Wio TerminalでBluetoothを使う

Wio TerminalでBluetoothを扱う日本語の記事をあまり見かけないなので、備忘録としてここに残す。

本家本元サイト

とは言っても、本家本元とのこちら(英語)に従って進める。ただし、つまづいた点もある。

基本環境

Windows10上でのArduino IDE利用。Wikiに従って準備する。

Bluetoothを使うまでの設定

SAMD51からRTL8720へのシリアル通信を有効化

こちらにそって、WiFi&Bluetooth用のFirmwareをUpdateする。まずは、SAMD51からRTL8720へのシリアル通信を行うための「rtl8720_update_v2.uf2」をDownloadする。Chromeでは警告が出るが無視して進める。電源ボタンをクイックに2度スライドすると、Wio TerminalがMass Storageデバイスとして認識される。
MassStorage1.png
MassStorage2.png
Downloadした「rtl8720_update_v2.uf2」をここにコピーする。すると、

というメッセージがLCDに表示される。

Firmware Update

次に最新のFirmwareをここからDownloadする。今回は"JP"がついているものを使った。CLIによるUpdateを行う。Firmwareを焼くツールをDownloadする。(gitは別途インストールしておく。)

F:\Workspace\Arduino\WioTerminal\> git clone https://github.com/LynnL4/ambd_flash_tool

amid_flash_toolフォルダができる。
FlashTool.png
この中のfirmwareフォルダにDownloadしたFirmwareを格納する。
Firmware.png
Firmwareの更新(erase&flash)を行う。

F:\Workspace\Arduino\WioTerminal\ambd_flash_tool> ambd_flash_tool.exe erase
Erasing...
All images are sent successfully!
Image tool closed!

Success!

F:\Workspace\Arduino\WioTerminal\ambd_flash_tool> ambd_flash_tool.exe flash
copy img to workspace...
Flashing...
All images are sent successfully!
Image tool closed!

Success!

ライブラリのインストール&サンプルプログラムのビルド

Arduino IDEからZIP形式のBluetooth関連ライブラリをインクルードする。

  • Seeed_Arduino_rpcBLE
  • Seeed_Arduino_rpcUnified
    するとサンプルプログラムも同時にインストールされる。
    BTsample.png
    しかし、このままでは、Seeed Arduino rpcBLEおよびSeeed Arduino rpcUnifiedのサンプルプログラムをビルドすることができなかった。調べると、
  • Seeed_Arduino_FreeRTOS
    が必要であった。このライブラリをDownloadし、同じようにArduino IDEに組み込みことにより、サンプルプログラムをビルドすることができる。

補足

上記サンプルプログラムは、Wio TerminalのメインプロセッサであるSAMD51用のようだ。どうも、Aruduino IDEを用いて、WiFi&Bluetooth用のプロセッサRTL8720を直接ハンドリングできる方法がある。

なので、続き(その2)を考えてみる。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?