Add gitignore
[nrf5x-base-fork.git] / README.md
bloba45ef4b18a582b66fac5090d64400a161932be03
1 Nordic nRF5x Support Files
2 ==========================
4 This repository is a starting point and shared code for Nordic nRF5x BLE platforms. This repo is
5 a collection of libraries, SDKs, Softdevices, and Makefiles to be included
6 within other projects using the Nordic platfroms. Pull requests welcome.
8 The currently supported SDK versions are: 9.0.0, 10.0.0, 11.0.0, 12.2.0.
10 The currently supported Softdevice versions are:
11 s110_7.3.0, s110_8.0.0, s120_2.1.0, s130_1.0.0, s130_2.0.0, s130_2.0.1.
14 Usage
15 -----
17 First, add this project as a submodule inside of your repo with your
18 nRF5x code.
20     git submodule add https://github.com/lab11/nrf5x-base
22 Then write an application for the nRF5x SoC you are using and include
23 a Makefile that looks like this:
25 ```make
26 PROJECT_NAME = $(shell basename "$(realpath ./)")
28 APPLICATION_SRCS = $(notdir $(wildcard ./*.c))
29 # Various C libraries that need to be included
30 APPLICATION_SRCS += softdevice_handler.c
31 APPLICATION_SRCS += ble_advdata.c
32 APPLICATION_SRCS += ble_conn_params.c
33 APPLICATION_SRCS += app_timer.c
34 APPLICATION_SRCS += ble_srv_common.c
35 APPLICATION_SRCS += app_util_platform.c
36 APPLICATION_SRCS += nrf_drv_common.c
37 APPLICATION_SRCS += nrf_delay.c
38 APPLICATION_SRCS += led.c
39 APPLICATION_SRCS += simple_ble.c
40 APPLICATION_SRCS += simple_adv.c
41 # Add other libraries here!
43 # platform-level headers and source files
44 LIBRARY_PATHS += ../../include
45 SOURCE_PATHS += ../../src
47 # Set the softdevice needed for the application
48 SOFTDEVICE_MODEL = s110
50 # Include the main Makefile
51 NRF_BASE_PATH ?= ../../nrf5x-base
52 include $(NRF_BASE_PATH)/make/Makefile
53 ```
54 An example Makefile is included in this repo as Makefile.example. Copy to your
55 own application directory and modify as desired.
57 Generally, the expected directory structure for your project is:
58 ```
59     /apps
60         /<application 1>
61         /<application 2>
62         ...
63     /src
64         various platform-level code (e.g. functions shared between applications)
65     /include
66         various platform-level headers (e.g. platform pin mappings)
67     /nrf5x-base (submodule)
68 ```
70 Example Applications
71 --------------------
73 This repo has several example and test applications. See the
74 [apps](https://github.com/lab11/nrf5x-base/tree/master/apps)
75 folder.
77 Supported Features
78 --------------
80 There are libraries for many common BLE functions in this repo:
82 - `simple_ble`: Quick interface to most common BLE functions
83   - BLE Advertisements
84     - Device name only
85     - Manufacturer data
86     - Eddystone
87     - Rotating multiple advertisements
88   - BLE Services
89 - SQL style database ([LittleD](https://github.com/graemedouglas/LittleD))
90 - [RTT Debugging](https://www.segger.com/pr-j-link-real-time.html)
91 - Nordic [BLE Serialization](http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v10.0.0%2Fble_serialization_s110_events.html)
92 - Nordic DFU over-the-air reprogramming.
96 Program a nRF51822
97 ------------------
99 To flash an application to a nRF51822 BLE chip, there is some setup
100 you must do.
102 1. Install the [`arm-none-eabi-gcc`](https://launchpad.net/gcc-arm-embedded) compiler.
104     On Ubuntu:
106         sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
107         sudo apt-get update
108         sudo apt-get install gcc-arm-embedded
110 2. Install the JLink [software](https://www.segger.com/jlink-software.html)
111 for your platform. You want the "Software and documentation pack".
113 3. Acquire a [JLink JTAG programmer](https://www.segger.com/jlink-general-info.html).
114 The "EDU" edition works fine.
116 4. Program an app! With the JLink box attached to the target board:
118         make flash
120     will write the app and softdevice to the nRF51822. You can erase
121     a chip with:
123         make erase-all
125     See the [make](https://github.com/lab11/nrf5x-base/tree/master/make) folder
126     for a complete list of commands.
128     Most of our boards use a [TagConnect header](http://www.tag-connect.com/TC2030-IDC-NL)
129     instead of the way-too-large ARM JTAG header. We use [our own](https://github.com/lab11/jtag-tagconnect)
130     adapter, but Segger also makes [one](https://www.segger.com/jlink-6-pin-needle-adapter.html).
132 5. Upon inital programming, the nRF will enter debug mode, which will prevent the nRF from sleeping and 
133    prevent the reset line from working. To fix this, either perform a powerdown/powerup or download nrfjprog from 
134    (https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822) and run nrfjprog --pinreset
136 Git Submodules
137 --------------
139 If you're using submodules in your project, you may want to use this to make
140 git automatically update them:
141 https://gist.github.com/brghena/fc4483a2df83c47660a5
144 BLE Tools for Other Platforms
145 -----------------
147 When developing a BLE application, several tools exist to make your life easier.
148 The easiest option, if you have access to an android phone, is [nRF Master Control Panel](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=en).
149 On iOS, [LightBlue Explorer](https://itunes.apple.com/us/app/lightblue-explorer-bluetooth/id557428110?mt=8)
150 has similar or better functionality. Alternatively,
151 [noble](https://github.com/sandeepmistry/noble) is a NodeJS library for interacting with BLE that can run from
152 a Linux or Mac computer.
154 Example Platforms Using nRF5x-base
155 ----------------------------------
157 - [Squall](https://github.com/helena-project/squall)
158 - [BLEES](https://github.com/lab11/blees)
159 - [Nucleum](https://github.com/lab11/nucleum)
160 - [PolyPoint](https://github.com/lab11/polypoint)
161 - [PowerBlade](https://github.com/lab11/powerblade)
164 License
165 -------
167 The files in this repository are licensed under the [MIT License](LICENSE)
168 unless otherwise noted by the local directory's README and license files.