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: doc/nrf-bm/drivers.rst
+5-32Lines changed: 5 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,45 +11,18 @@ This will mostly be more higher-level drivers and should be seen as a supplement
11
11
Only the drivers located under :file:`nrf-bm/drivers` and the ones provided in nrfx are in the scope of the |BMshort|.
12
12
All other drivers that are included in the distribution must be ignored when working with the Bare Metal option.
13
13
14
-
Pre-allocated resources
15
-
***********************
16
-
17
-
Some peripherals will be pre-allocated by the system and must not be accessed directly by the application.
14
+
Some peripherals are pre-allocated by the system and must not be accessed directly by the application.
18
15
19
16
By default, |BMshort| initializes a system timer that is used by both the :ref:`lib_bm_timer` and logging timestamp.
20
-
This will allocate ``GRTC`` channel ``0`` and ``GRTC_2_IRQn``.
17
+
This allocates the ``GRTC`` channel ``0`` and ``GRTC_2_IRQn``.
21
18
The initialization starts ``GRTC`` and enables ``SYSCOUNTER``, as required by the SoftDevice.
22
19
23
-
When SoftDevice is enabled, it takes the ownership of the peripherals that it needs.
20
+
When the SoftDevice is enabled, it takes the ownership of the peripherals that it needs.
24
21
They will not be available for application to use.
25
-
The SoftDevice is reusing both the `SoftDevice Controller`_ and the `Multiprotocol Service Layer`_ from the nRF Connect SDK.
22
+
The SoftDevice is reusing both the `SoftDevice Controller`_ and the `Multiprotocol Service Layer`_ from the |NCS|.
26
23
See the Integration Notes documentation for these libraries to get an overview of the resource it will be using.
27
24
28
-
For details on SoftDevice behavior, see the `S115 SoftDevice Specification`_.
29
-
30
-
nrfx
31
-
****
32
-
33
-
The |BMshort| is set up to use nrfx that comes with the nRF Connect SDK.
34
-
35
-
In |BMshort|, it is expected that the application uses either the nrfx driver or, if needed, interacts directly with the peripheral register interface (nrf hal).
36
-
37
-
To learn more, see the `nrfx documentation`_ that is distributed as separate bundle.
38
-
The nrfx source code is located in :file:`../modules/hal/nordic/nrfx`.
39
-
40
-
.. note::
41
-
42
-
The CMake in Bare Metal option is already set up to include the source code from nrfx.
43
-
44
-
To include and start using the nrfx driver:
45
-
46
-
* Include the interface file, like :file:`#include <nrfx_spim.h>` for the SPI Master driver.
47
-
* Start adding code in your application to set up, initialize and start using the driver.
48
-
49
-
To start interacting directly with a peripheral through the register interface:
50
-
51
-
* Include the interface file, like :file:`#include <hal/nrf_gpio.h>` for GPIO.
52
-
* Start adding code interacting with the register interface (:file:`nrf_gpio_pin_write(….)` ).
25
+
For details on the SoftDevice behavior, see the `S115 SoftDevice Specification`_.
The |BMshort| is set up to use nrfx that comes with the |NCS|.
7
+
8
+
In |BMshort|, it is expected that the application uses either the nrfx driver or, if needed, interacts directly with the peripheral register interface (nrf hal).
9
+
10
+
To learn more, see the `nrfx documentation`_ that is distributed as a separate bundle.
11
+
The nrfx source code is located in :file:`../modules/hal/nordic/nrfx`.
12
+
13
+
.. note::
14
+
15
+
The CMake in |BMshort| is already set up to include the source code from nrfx.
16
+
17
+
To include and start using the nrfx driver:
18
+
19
+
* Include the interface file, like :file:`#include <nrfx_spim.h>` for the SPI Master driver.
20
+
* Start adding code in your application to set up, initialize, and start using the driver.
21
+
22
+
To start interacting directly with a peripheral through the register interface:
23
+
24
+
* Include the interface file, like :file:`#include <hal/nrf_gpio.h>` for GPIO.
25
+
* Start adding code interacting with the register interface (:file:`nrf_gpio_pin_write(….)`).
Copy file name to clipboardExpand all lines: doc/nrf-bm/install_nrf_bm.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ Every |BMlong| release consists of:
73
73
74
74
#. In the next page you will be prompted to **Select SDK type**, click :guilabel:`nRF Connect SDK Bare Metal`.
75
75
76
-
#. In the next page you will be prompted to **Select an SDK version (or enter the branch, tag or commit SHA) to install...**, click :guilabel:`v0.9.0` marked on the right by the label :guilabel:`Pre-packaged SDKs &Toolchains`.
76
+
#. In the next page you will be prompted to **Select an SDK version (or enter the branch, tag or commit SHA) to install...**, click :guilabel:`v1.0.0` marked on the right by the label :guilabel:`Pre-packaged SDKs &Toolchains`.
77
77
78
78
#. In the next page you will be prompted to select a destination for the SDK. The default suggestion is recommended. Then press **Enter**.
79
79
This will proceed by installing |BMshort| and the respective Toolchain it requires.
@@ -119,7 +119,7 @@ Every |BMlong| release consists of:
119
119
120
120
#. In the next page you will be prompted to **Select SDK type**, click :guilabel:`nRF Connect SDK Bare Metal`.
121
121
122
-
#. In the next page you will be prompted to **Select an SDK version (or enter the branch, tag or commit SHA) to install...**, click :guilabel:`v0.9.0` marked on the right by the label :guilabel:`GitHub`.
122
+
#. In the next page you will be prompted to **Select an SDK version (or enter the branch, tag or commit SHA) to install...**, click :guilabel:`v1.0.0` marked on the right by the label :guilabel:`GitHub`.
123
123
124
124
#. In the next page you will be prompted to select a destination for the SDK. The default suggestion is recommended. Then press **Enter**.
.. _`Migration notes - nRF5 SDK to nRF Connect SDK Bare Metal option`: https://docs.nordicsemi.com/bundle/nrf-bm-latest/page/migration/nrf5_bm_migration.html
94
97
.. _`S115 9.0.0-3.prototype API reference`: https://docs.nordicsemi.com/bundle/s115_9.0.0-3.prototype_api/page/topics.html
Utility libraries for Bluetooth LE are available in |BMshort|, though their collection may not be as complete, and their functionality and API may be slightly different than their respective nRF5 implementation.
134
138
@@ -153,10 +157,10 @@ See table below for a summary of supported libraries.
153
157
-
154
158
-
155
159
* - ``ble_db_discovery``
156
-
- No
157
-
-
158
160
- Yes
159
161
-
162
+
-
163
+
- Experimental
160
164
* - ``ble_conn_params``
161
165
- Yes
162
166
- Name unchanged
@@ -198,19 +202,19 @@ See table below for a summary of supported libraries.
198
202
-
199
203
-
200
204
* - ``nrf_ble_scan``
201
-
- No
202
-
-
203
205
- Yes
206
+
- ``ble_scan``
204
207
-
208
+
- Experimental
205
209
* - ``ble_link_ctx_manager``
206
210
- No
207
211
-
208
212
- No
209
213
- Functionality implemented manually where needed
210
214
* - ``ble_radio_notification``
211
-
- No
212
-
-
213
215
- Yes
216
+
- Name unchanged
217
+
-
214
218
-
215
219
* - ``peer_manager``
216
220
- Yes
@@ -222,7 +226,7 @@ SoftDevice integration
222
226
**********************
223
227
224
228
The SoftDevice, serving as a Bluetooth Low Energy protocol stack, maintains a consistent API from the nRF5 SDK to the |BMshort| environment.
225
-
For instance, the API functionalities in SoftDevice S115 are comparable to those in S113.
229
+
For instance, the API functionalities in SoftDevice S115 and S145 are comparable to those in S113 and S140, respectively.
226
230
227
231
However, notable changes have occurred in how the SoftDevice is integrated within the system.
228
232
@@ -240,7 +244,7 @@ Interrupt Handling
240
244
The responsibility for interrupt handling has shifted in |BMshort| - the application must now manage interrupts and forward them to the SoftDevice as needed.
241
245
242
246
It is important to note that while the API remains compatible, the SoftDevices themselves are not binary-compatible between the two environments.
243
-
SoftDevices from the nRF5 SDK cannot be reused in |BMshort|, and similarly, the S115 SoftDevice is not compatible with the nRF5 SDK.
247
+
SoftDevices from the nRF5 SDK cannot be reused in |BMshort|, and similarly, the S115 and S145 SoftDevices are not compatible with the nRF5 SDK.
244
248
245
249
Other libraries
246
250
***************
@@ -255,6 +259,30 @@ This is due to several factors, including:
255
259
* Different project configuration mechanism, inherently affecting how libraries are configured.
256
260
* Different coding standard in the |NCS| (for example, limited use of ``typedef``).
257
261
262
+
Error codes
263
+
***********
264
+
265
+
nRF5 mainly used the unsigned nRF errors defined in ``nrf_error.h`` for error handling, with ``NRF_SUCCESS`` for successful operations and errors such as ``NRF_ERROR_NO_MEM`` and ``NRF_ERROR_FORBIDDEN``.
266
+
In addition to the generic nRF errors, the nRF5 also used BLE SoftDevice errors defined in ``nrf_error_soc.h`` and ``nrf_error_sdm.h``, and the errors from the nrfx header within the same error scope, but with a diffeent base offset.
267
+
268
+
|BMshort| uses the nRF errors for BLE related libraries and services, including the SoftDevice APIs.
269
+
For other libraries and drivers, including nRFX, the signed ``errno`` error space is used.
270
+
Defined as a signed integer (``int``) with ``0`` reprecenting a successful operation and errors returned as negative values, e.g. ``-ENOMEM`` and ``-EPERM``.
271
+
272
+
In |BMshort| the return type of a function can be a good indication of the error space used, together with the header location:
273
+
274
+
* If the header resides within a ``bluetooth`` folder it is likely using the nRF error space.
275
+
Else it is using the ``errno`` error space.
276
+
* If the return type is ``uint32_t`` it is likely using the nRF error space.
277
+
If the return type is ``int`` it is likely using the ``errno`` error space.
278
+
* For return values using the nRF error space, the variable is typically named ``nrf_error``.
279
+
If the variable used to store the return variable is named ``err``, ``retval`` or ``ret`` it is more likely to use the ``errno`` error space.
280
+
281
+
.. note::
282
+
283
+
In |BMshort| ``NRF_SUCCESS`` is defined as ``0``.
284
+
You will therefore find checks such as ``if (nrf_error)`` in the code, though the generic solution would be ``if (nrf_error != NRF_SUCCESS)``.
285
+
258
286
.. _nrf5_bm_migration_dfu:
259
287
260
288
DFU
@@ -313,4 +341,5 @@ The desktop and mobile tools available for the |NCS| are also compatible with th
313
341
Drivers
314
342
*******
315
343
316
-
For migration of nrfx drivers, see `nrfx migration guides`_.
344
+
For migration of nrfx drivers, see the `nrfx 3.0 migration guide`_ and the `nrfx 4.0 migration guide`_.
345
+
|BMshort| is using nRFX 4.0, though details from `nrfx 3.0 migration guide`_ might be required when migrating from nRF5.
0 commit comments