prototooth/README.md

44 lines
2.8 KiB
Markdown
Raw Normal View History

2019-06-02 17:12:36 +00:00
# Go Bluetooth
2020-05-24 17:00:05 +00:00
[![CircleCI](https://circleci.com/gh/aykevl/go-bluetooth/tree/master.svg?style=svg)](https://circleci.com/gh/aykevl/go-bluetooth/tree/master)
2020-05-30 21:19:53 +00:00
[![GoDoc](https://godoc.org/github.com/aykevl/go-bluetooth?status.svg)](https://godoc.org/github.com/aykevl/go-bluetooth)
2020-05-24 17:00:05 +00:00
2020-05-30 21:19:53 +00:00
This package attempts to build a cross-platform Bluetooth Low Energy module for Go. It currently supports the following systems:
2019-06-02 17:12:36 +00:00
2020-05-30 21:19:53 +00:00
| | Windows | Linux | Nordic chips |
| --------------------- | ------------------ | ------------------ | ------------------ |
| Scanning | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| Advertisement | :x: | :heavy_check_mark: | :heavy_check_mark: |
| Local services | :x: | :heavy_check_mark: | :heavy_check_mark: |
| Local characteristics | :x: | :x: | :heavy_check_mark: |
2019-06-02 17:12:36 +00:00
2020-05-30 21:19:53 +00:00
## Baremetal support
2019-06-02 17:12:36 +00:00
2020-05-30 21:19:53 +00:00
As you can see above, there is support for some chips from Nordic Semiconductors. At the moment the following chips are supported:
2019-06-02 17:12:36 +00:00
2020-05-30 21:19:53 +00:00
* The [nRF52832](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52832) with the [S132](https://www.nordicsemi.com/Software-and-Tools/Software/S132) SoftDevice (version 6).
* The [nRF52840](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52840) with the [S140](https://www.nordicsemi.com/Software-and-Tools/Software/S140) SoftDevice (version 7).
These chips are supported through [TinyGo](https://tinygo.org/).
The SoftDevice is a binary blob that implements the BLE stack. There are other (open source) BLE stacks, but the SoftDevices are pretty solid and have all the qualifications you might need. Other BLE stacks might be added in the future.
### Flashing the SoftDevice
Flashing the SoftDevice can be tricky. If you have [nrfjprog](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Command-Line-Tools) installed, you can erase the flash and flash the new BLE firmware using the following commands. Replace the path to the hex file with the correct SoftDevice, for example `s132_nrf52_6.1.1/s132_nrf52_6.1.1_softdevice.hex` for S132 version 6.
2019-06-02 17:12:36 +00:00
nrfjprog -f nrf52 --eraseall
2020-05-30 21:19:53 +00:00
nrfjprog -f nrf52 --program path/to/softdevice.hex
2019-06-02 17:12:36 +00:00
2020-05-30 21:19:53 +00:00
After that, don't reset the board but instead flash a new program to it. For example, you can flash the Heart Rate Sensor example using `tinygo` (modify the `-target` flag as needed for your board):
2019-06-02 17:12:36 +00:00
tinygo flash -target=pca10040-s132v6 ./examples/heartrate
2020-05-30 21:19:53 +00:00
Flashing will normally reset the board.
## License
This project is licensed under the BSD 3-clause license, see the LICENSE file for details.
The SoftDevices from Nordic are licensed under a different license, check the license file in the SoftDevice source directory.