4
4

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 5 years have passed since last update.

[メモ]RedBearLab:BLE Nano - MDK-LiteでnRF51-SDK10のサンプル(HRS)をビルドして動かす

Last updated at Posted at 2016-02-05

環境

  • Windows7 64bit + MDK-Lite (5.17)
  • BLE Nano (V1.5) + MK20 USB Board
  • nRF51 SDK v10.0.0
  • スマホアプリ nRF Toolbox Nordic提供

S110とか、S120とか、S130とか何?

nRF51系のチップでは、BLE通信でSoftDeviceとい呼ばれるProtocol stackを使う。
https://www.nordicsemi.com/eng/Products/nRF51-Series-SoC
目的によって使用するものを選ぶ。

S110: Bluetooth Smart single mode peripheral protocol stack
S120: Bluetooth Smart single mode master protocol stack offering 8 simultaneous connections
S130: Bluetooth Smart protocol stack, supporting multi-link central, peripheral, observer and broadcaster roles

# ANTに対応してないnRF51822では、S210とS310は使えない。

pca10028とかpca10031とか?

# BLE Nanoでは、PCA10031のをつかっとけばいいかな?

BLE Nano側: ビルド

  1. SDKをダウンロード

    nRF51_SDK_10.0.0_dc26b5e.zip -
    http://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v10.x.x/
  2. SDKの中の、MDK5向けHRSサンプルプロジェクトを開く
    nRF51_SDK_10.0.0_dc26b5e/examples/ble_peripheral\ble_app_hrs/pca10031/s110/arm5_no_packs/ble_app_hrs_s110_pca10031.uvprojx
  3. nRF_DeviceFamilyPackがないと、Pack Installerが起動する。
    • nRF_DeviceFamilyPack:8.3.2 -> License Agreement がでてくる。Checkを入れて [Next].
    • nRF_DeviceFamilyPack:8.2.0も入れろ、と出てくる。
  4. ビルド => nrf51422_xxac_s110.hexが生成

    nRF51_SDK_10.0.0_dc26b5e/examples/ble_peripheral/ble_app_hrs/pca10031/s110/arm5_no_packs/_build/
  5. srec_cat.exeを使って、S110 Protocol Stackをくっつける。
    • SRecord For Windows

    • s110_nrf51_8.0.0_softdevice.hexnRF51_SDK_10.0.0_dc26b5e\components\softdevice\s110\hex\から持ってくる

    • srec_catをつかって、SoftDevice.hexとくっつけて、out.hexを作る。

% srec_cat.exe s110_nrf51_8.0.0_softdevice.hex -intel nrf51422_xxac_s110.hex -intel -o out.hex -intel --line-length=44```

  1. out.hexをMBEDドライブに放り込む


  2. 今後のためにバッチファイルでも作っておく
    % hexmerge.bat input.hex output.hex で、output.hexが作られる。

    hexmerge.bat

@ECHO OFF
SET HEX_IN=%1
SET HEX_OUT=%2
SET HEX_SOFTDEVICE=s110_nrf51_8.0.0_softdevice.hex
IF "%HEX_IN%"=="" GOTO NO_HEX_IN
IF "%HEX_OUT%"=="" GOTO NO_HEX_OUT
echo %HEX_OUT% = %HEX_SOFTDEVICE% + %HEX_IN%
srec_cat.exe %HEX_SOFTDEVICE% -intel %HEX_IN% -intel -o %HEX_OUT% -intel --line-length=44
GOTO EXIT
:NO_HEX_IN
echo NO_HEX_IN !!!
GOTO EXIT
:NO_HEX_OUT
echo NO_HEX_OUT !!!
GOTO EXIT
:EXIT


## スマホ側
1. [nRF Toolbox](https://www.nordicsemi.com/eng/Products/Nordic-mobile-Apps/nRF-Toolbox-App)をインストールして、起動
2. `HRM`を選んで、`CONNECT`をおすと、Device一覧が出てくる
<br>=> Nordic_HRMを選ぶ
3. グラフとか見れる。
4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?