You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-9Lines changed: 39 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,10 @@ If you are interested in assisting the development of this project please submit
18
18
19
19
I wanted to have a consistent BLE API on all of the devices I work with. NimBLE is the best choice for this as it is the most feature complete and fully open source library available for Arduino.
20
20
21
+
## BLE
22
+
This Arduino Core does **not** contain any BLE functionality. It has been designed to support using the [NimBLE-Arduino](https://github.com/h2zero/NimBLE-Arduino) library for BLE operation.
23
+
**Note:** Only the release version 1.4.0 and above of [NimBLE-Arduino](https://github.com/h2zero/NimBLE-Arduino) supports Arm devices.
24
+
21
25
## Supported boards
22
26
23
27
### nRF52840
@@ -52,7 +56,7 @@ I wanted to have a consistent BLE API on all of the devices I work with. NimBLE
52
56
*[BBC micro:bit](https://microbit.org)
53
57
*[Calliope mini](https://calliope.cc/en)
54
58
*[Bluz DK](http://bluz.io)
55
-
* Nordic Semiconductor [nRF51822 Development Kit](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822-Development-Kit)
59
+
*[Nordic Semiconductor nRF51822 Development Kit](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822-Development-Kit)
@@ -66,7 +70,6 @@ I wanted to have a consistent BLE API on all of the devices I work with. NimBLE
66
70
## Installing
67
71
68
72
### Board Manager
69
-
70
73
1.[Download and install the Arduino IDE](https://www.arduino.cc/en/Main/Software) (At least v1.6.12)
71
74
2. Start the Arduino IDE
72
75
3. Go into Preferences
@@ -75,7 +78,6 @@ I wanted to have a consistent BLE API on all of the devices I work with. NimBLE
75
78
6. Select your board from the Tools -> Board menu
76
79
77
80
### From git (for core development)
78
-
79
81
1. Follow steps from Board Manager section above
80
82
2.```cd <SKETCHBOOK>```, where ```<SKETCHBOOK>``` is your Arduino Sketch folder:
81
83
* OS X: ```~/Documents/Arduino```
@@ -86,7 +88,6 @@ I wanted to have a consistent BLE API on all of the devices I work with. NimBLE
86
88
5. Restart the Arduino IDE
87
89
88
90
## Flashing your device
89
-
90
91
1. Select your board from the Tools -> Board menu
91
92
2. Select any options you want
92
93
3. Select a programmer (J-Link, ST-Link V2, CMSIS-DAP, Black Magic Probe, adafruit-nrfutil or nrfutil) from the Tools -> "Programmer: " menu
@@ -105,19 +106,48 @@ I wanted to have a consistent BLE API on all of the devices I work with. NimBLE
105
106
1. Install nrfutil if not already installed `pip install nrfutil`
106
107
2. Select nrfutil as the firmware uploader in the tools menu.
107
108
108
-
## BLE
109
-
110
-
This Arduino Core does **not** contain any BLE functionality. It has been designed to support using the [NimBLE-Arduino](https://github.com/h2zero/NimBLE-Arduino) library for BLE operation.
111
-
**Note:** Currently only the release version 1.4.0 and above of [NimBLE-Arduino](https://github.com/h2zero/NimBLE-Arduino) supports Arm devices.
109
+
## Configuration (optional)
110
+
You can change the configuration for many settings by creating a `build_opt.h` file in your sketch folder.
111
+
In here you can set compile time definitions for settings that will be included directly on the command line.
112
+
For example: `'-DCONFIG_MAIN_TASK_STACK_SIZE=2048'` This will set the main task stack size to 2048 bytes.
113
+
114
+
### Configuration option list
115
+
*`CONFIG_MAIN_TASK_STACK_SIZE` - sets the size **in bytes** of the main loop task.
116
+
*`CONFIG_RTOS_TICK_RATE_HZ` - set the tick rate for FreeRTOS (default 1024).
117
+
*`CONFIG_RTOS_MAX_PRIORITIES` - set the maximum priority level for FreeRTOS tasks.
118
+
*`CONFIG_RTOS_MIN_TASK_STACK_SIZE` - set the minimum task stack size.
119
+
*`CONFIG_RTOS_TIMER_QUEUE_LENGTH` - set the queue size for the FreeRTOS timers.
120
+
*`CONFIG_RTOS_TIMER_STACK_DEPTH` - set the timer task stack size **in 32bit words**.
121
+
* Nimble configuration options can also be included, the list of those can be found [here](https://h2zero.github.io/NimBLE-Arduino/md__command_line_config.html)
122
+
* Other compiler options or definitions for other libraries can also be specified.
123
+
124
+
## API
125
+
There are a few useful functions available to help with your project.
126
+
### RTOS class functions
127
+
*`uint32_t RTOS.getMainTaskHwm();` - Returns the high water mark of the Main task stack **in 32bit words**.
128
+
*`uint32_t RTOS.getIsrStackHwm();` - Returns the high water mark of the ISR stack **in 32bit words**.
129
+
*`uint32_t RTOS.getIdleTaskHwm();` - Returns the high water mark of the Idle task stack **in 32bit words**.
130
+
*`uint32_t RTOS.getTimerTaskHwm()` - Returns the high water mark of the Timer task stack **in 32bit words**.
131
+
*`uint32_t RTOS.getBleHostTaskHwm();` - Returns the high water mark of the NimBLE Host task stack **in 32bit words**.
132
+
*`uint32_t RTOS.getBleLLTaskHwm()` - Returns the high water mark of the NimBLE Link Layer task stack **in 32bit words**.
133
+
*`uint32_t RTOS.getFreeHeap();` - Returns the currently free heap size **in bytes**.
134
+
135
+
### General system functions
136
+
*`uint32_t getResetReason();` - Returns the reset reason for the last boot.
137
+
*`void systemPowerOff();` - Shuts down the MCU.
138
+
*`void systemRestart();` - Reboot.
112
139
113
140
## Bootloader
114
141
Currently only some boards have Adafruit bootloaders available which are provided as options. You may choose to use the bootloader or none.
115
142
The provided Adafruit bootloaders have no softdevice, if you currently are using the softdevice based Adafruit bootloader on your nRF52 board you will need to update it to the one provided by selecting it from the boards menu and clicking `Burn Bootloader`.
116
143
117
144
For boards without the Adafruit bootloader option clicking `Burn Bootloader` will simply erase the flash memory on the device. This is required if you have any bootloader flashed already.
118
145
119
-
## Credits
146
+
## Important notes
147
+
* The last four pages of flash, before the bootloader (if applicable) are reserved for user storage and bond information storage (2 pages each).
148
+
* Careful attention should be paid to selecting the correct bootloader (tools->Bootloader Type) for your build (if applicable) to ensure the correct linkage.
120
149
150
+
## Credits
121
151
This core is based on [Arduino-nRF5](https://github.com/sandeepmistry/arduino-nRF5) by Sandeep Mistry,
122
152
which is based on the [Arduino SAMD Core](https://github.com/arduino/ArduinoCore-samd).
123
153
With some code from [Adafruit_nRF52_Arduino](https://github.com/adafruit/Adafruit_nRF52_Arduino)
0 commit comments