BL652メモ

OpenOCD

openocdを使ってブートローダーを書き込みますが、Macでhomebrewを使ってインストールするとinvalid command name "nrf5"と言われるので、別のバイナリを持ってきて正常に動作した。

Release GNU MCU Eclipse OpenOCD v0.10.0-12 20190422 · ilg-archived/openocd · GitHub

~/gnu-mcu-eclipse/openocd/0.10.0-12-20190422-2015/bin/openocd -s ~/gnu-mcu-eclipse/openocd/0.10.0-12-20190422-2015/scripts -f interface/stlink-v2.cfg -f target/nrf52.cfg -c init -c "reset init" -c halt -c "nrf5 mass_erase" -c "program s132_nrf52_3.0.0_softdevice.hex verify" -c reset -c exit
~/gnu-mcu-eclipse/openocd/0.10.0-12-20190422-2015/bin/openocd -s ~/gnu-mcu-eclipse/openocd/0.10.0-12-20190422-2015/scripts -f interface/stlink-v2.cfg -f target/nrf52.cfg -c "program caravelle_ble-bootloader.hex verify" -c "reset" -c exit

9, 10番ピン

BL652のSIO 9, 10番ピンはNFCと共用で、標準ではNFCに使われるので、以下の設定をconfig.hに書いて、GPIOに変更する必要がある。ピンに余裕があるなら、このピンを使わない方が無難。

#define CONFIG_NFCT_PINS_AS_GPIOS