The bluetooth SoC is a based off a Nordic nRF51. It's running [project Zephyr RTOS][1] [hci_uart sample][2]. Only changes made to this sample is: pins used for comms and added a blinking LED to assure CPU is running.
What have been done so far and it works:
sudo btmgmt --index 0
static-addr ... something....
power on
find -l```
- calling `hciconfig` we can see transmitted and received bytes between Pi and BT-SoC without issues.
**What is missing: bluetoothctl**
Any attempt to use bluetoothctl informs that we have no controller.
bluetoothctl
[bluetooth]# list
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# list
[bluetooth]# show
No default controller available
Further digging I've found that `hciuart.service` does not execute (as it would normally do on a Raspberry Pi 3:
pi@raspberrypi:~ $ systemctl status hciuart.service
● hciuart.service - Configure Bluetooth Modems connected by UART
Loaded: loaded (/lib/systemd/system/hciuart.service; enabled)
Active: inactive (dead)
start condition failed at Tue 2017-05-23 09:44:13 CEST; 1s ago
ConditionPathIsDirectory=/proc/device-tree/soc/gpio@7e200000/bt_pins was not met
pi@raspberrypi:~ $ cat /lib/systemd/system/hciuart.service
[Unit]
Description=Configure Bluetooth Modems connected by UART
ConditionPathIsDirectory=/proc/device-tree/soc/gpio@7e200000/bt_pins
Before=bluetooth.service
After=dev-serial1.device
[Service]
Type=forking
ExecStart=/usr/bin/btuart
[Install]
WantedBy=multi-user.target
It points that `/proc/device-tree/soc/gpio@7e200000/bt_pins` doesn't exist, and indeed it doesn't.
I've tried to directly execute the binary from the service and got the following error message:
pi@raspberrypi:~ $ sudo /usr/bin/btuart
Can't open serial port: No such file or directory
Can't initialize device: No such file or directory
Doing the same tests using a USB serial connection to my Linux PC it works. Bluetoothctl have controller and it sees/communicates with the BT SoC
**So my questions:**
- Why there is not bluetooth controller? how do I add/enable one?
- Is it because of the hciuart.service? How do I enable it?
- Is it because of the gpio@7e200000/bt_pins? How do I add, enable them?
Thanks a lot for any help
[1]: https://devzone.nordicsemi.com/blogs/1059/nrf5x-support-within-the-zephyr-project-rtos/
[2]: https://github.com/zephyrproject-rtos/zephyr/tree/master/samples/bluetooth/hci_uart