Skip to content

Commit 4b029b6

Browse files
doc: Restructure sample documentation
Restructure sample documentation, removing common stuff from sample to separat section. Signed-off-by: Bjørn Tore Taraldsen <[email protected]>
1 parent d61a6ee commit 4b029b6

File tree

24 files changed

+279
-201
lines changed

24 files changed

+279
-201
lines changed

doc/nrf-bm/sample/intro.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.. _getting_started_with_the_samples:
2+
3+
Getting Started with the Samples
4+
################################
5+
6+
This section is a general description of how you can explore and try out the samples provided with the nRF Connect SDK.
7+
It describes how you can create a copy of your sample, configure it, build and program the samples to test it running on a Nordic DK’s.
8+
9+
.. toctree::
10+
:maxdepth: 1
11+
:caption: Subpages
12+
:glob:
13+
14+
/sample/intro/create_sample
15+
/sample/intro/configure_and_build_sample
16+
/sample/intro/program_sample
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Configuring and building the sample
2+
===================================
3+
4+
Follow these steps to create your first build configuration for this sample:
5+
6+
1. Verify the configuration of this sample.
7+
8+
You will need the following information:
9+
10+
* The |NCS| version and toolchain version that the current |BMshort| release is based on: |ncs_release|
11+
* The board target onto which you want to program the firmware (see `Requirements`_).
12+
13+
This information will be used in the steps that follow.
14+
15+
.. note::
16+
The following screenshots show the **Hello SoftDevice** sample as reference.
17+
18+
#. In the `Applications View`_, click :guilabel:`Add build configuration`.
19+
20+
.. figure:: /images/add_build_configuration.png
21+
:alt: Add Build Configuration
22+
23+
Add Build Configuration
24+
25+
#. This opens the **Add Build Configuration** page.
26+
27+
.. figure:: /images/add_build_configuration_page.png
28+
:alt: Add Build Configuration page - fragment
29+
30+
Add Build Configuration page - fragment
31+
32+
#. For your very first build configuration, double-check that the values in the |NCS| and toolchain menus match the expected versions.
33+
34+
#. Select the board target onto which you want to program the firmware.
35+
36+
For your very first build configuration, select a compatible board target from the drop-down menu.
37+
38+
.. figure:: /images/board_target.png
39+
:alt: Board target drop-down menu
40+
41+
Board target drop-down menu
42+
43+
#. If the sample supports Kconfig fragments, you can configure a fragment by selecting :file:`prj.conf` from the :guilabel:`Base configuration files (Kconfig fragments)` drop-down menu.
44+
45+
Then, from the :guilabel:`Extra Kconfig fragments` drop-down menu, select the target fragment.
46+
47+
#. Leave all the other options as default.
48+
49+
For more details on how to configure builds, see `How to build an application`_ in |VSC| extension documentation.
50+
51+
#. Click :guilabel:`Generate and Build`.
52+
53+
The |VSC| extension generates the configuration file and triggers the build process, which can take some time. You can monitor its progress in the notification that appears.
54+
55+
.. tabs::
56+
57+
.. group-tab:: Simple board variants
58+
59+
When the process is complete, the `Actions View`_ appears.
60+
In this View, you can trigger the build process again, flash the built application, start a debug session (if debug options were set when building), or generate a memory report.
61+
The build files appear in the build's `Details View`_, which is named after your application.
62+
63+
.. figure:: /images/show_build_configuration_files.png
64+
:alt: Build configuration files
65+
66+
Build configuration files
67+
68+
When selecting Simple Board variants it will automatically include the SoftDevice hex.
69+
When the build process is completed, the `Applications View`_ will list SoftDevice in addition to the main application.
70+
71+
.. note::
72+
This will also be the case for the Peripheral samples where we do not need a SoftDevice.
73+
Reason for this is the selected board target and that we have decided to not have any board targets without SoftDevice included.
74+
75+
76+
.. group-tab:: MCUboot board variants
77+
78+
When the process is complete, the `Actions View`_ appears.
79+
In this View, you can trigger the build process again, flash the built application, start a debug session (if debug options were set when building), or generate a memory report.
80+
The build files appear in the build's `Details View`_, which is named after your application.
81+
82+
.. figure:: /images/show_build_configuration_files_mcuboot.png
83+
:alt: Build configuration files
84+
85+
Build configuration files with MCUboot board variant
86+
87+
When selecting an MCUboot board variant, the configuration of the memory includes both MCUboot and single-bank DFU.
88+
This will automatically include and compile the extra images needed for the partitions.
89+
When the build process is completed, the Application view will list all images.
90+
91+
For details on how the memory partitions are organized when including MCUboot and DFU, see :ref:`dfu_memory_partitioning`.
92+
93+
For how to program your board and run the images, see :ref:`ug_dfu`.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Creating a copy of the sample
2+
=============================
3+
4+
Follow these steps to create a new application based on this sample:
5+
6+
1. Open the |nRFVSC| by clicking its icon.
7+
#. From the :guilabel:`Welcome View`, click :guilabel:`Create a new application`.
8+
9+
A quick pick menu appears.
10+
11+
#. Select :guilabel:`Copy a sample` - this will create a `freestanding application`_ from a sample in |BMlong|.
12+
13+
If you have more than one SDK version installed, a quick pick menu appears showing a list of SDK versions to copy the sample from.
14+
15+
#. If asked to select the SDK version, select the one that you want to copy the sample from.
16+
17+
A quick pick menu appears showing a list of available samples to choose from.
18+
This list is autogenerated based on the chosen SDK with the :guilabel:`nrf-bm` samples placed on the top of the list.
19+
All samples below the :guilabel:`nrf-bm` specific list are not compatible and should be ignored.
20+
21+
.. figure:: /images/create_new_application_from_sample_quick_pick_menu.png
22+
:alt: Create New Application from Sample - Quick Pick Menu
23+
24+
Create New Application from Sample - Quick Pick Menu
25+
26+
#. Click on the name of this sample.
27+
28+
A prompt appears asking to enter the location for the application.
29+
You can also use the folder button at the top of the quick pick to open a folder picker.
30+
31+
The application creation process starts after you enter the name.
32+
When the application is created, a prompt appears.
33+
Click :guilabel:`Open` or :guilabel:`Open in New Window` to open the new application.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Programming
2+
===========
3+
4+
Follow these steps to program this sample:
5+
6+
1. Plug in your device to the serial terminal using a USB cable.
7+
Your device appears on the `Connected Devices View`_ list in |VSC|.
8+
#. To flash the application you have built, select your build folder in the `Applications View`_.
9+
Then, click :guilabel:`Flash` in the `Actions View`_ after connecting the device to the terminal.
10+
11+
12+
Flash ALL
13+
---------
14+
15+
By selecting the build folder in the Application View, nRF Connect extension in VS Code will automatically program ALL images listed in that build configuration.
16+
For a Simple Board variant, the build folder will list both the application and the SoftDevice, and a Flash command will flash both.
17+
Equally for a MCUboot variant, the Flash command will flash all the images needed.
18+
19+
20+
Flash individually
21+
------------------
22+
23+
If you, in the Application view, select one of the images listed within a build folder, nRF Connect extension in VS Code will flash only the selected image.
24+
For a Simple Board variant, the build folder will list both the application and the SoftDevice. If you select either application or SoftDevice, the Flash command will Flash only the selected one.
25+
26+
.. note::
27+
28+
When programming in VSC with nRF Connect plugin it’s important to understand the difference between the “Flash” and “Erase and Flash to board”. See [Action View] for details on this
29+
30+
.. note::
31+
32+
When programming a board for the first time using MCUboot board variants with KMU (default), make sure the KMU is programmed with the necessary keys.
33+
34+
* Using the command line: Execute ``west flash --erase`` or ``west flash --recover``.
35+
* Using Visual Studio Code: In the Actions View, hover over the :guilabel:`Flash` option.
36+
Click :guilabel:`Erase and Flash to Board`, which appears to the right under :guilabel:`More actions`.
37+
38+
.. figure:: /images/erase_and_flash_to_board.png
39+
:alt: Erase and flash to board.
40+
41+
For more details, see `How to flash an application`_ in |VSC| extension documentation.

doc/nrf-bm/samples.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All other samples and applications that are included in the distribution must be
1313
:glob:
1414
:caption: Subpages:
1515

16+
sample/intro
1617
sample/ble
1718
sample/dfu
1819
sample/peripheral

samples/bluetooth/ble_cgms/README.rst

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,26 +69,16 @@ Overview
6969

7070
The Continuous Glucose Monitoring Service (CGMS) is a service that exposes glucose and other data from a personal Continuous Glucose Monitoring sensor.
7171

72-
Programming the S115 SoftDevice
73-
*******************************
72+
Playing with the sample
73+
***********************
7474

75-
.. include:: /includes/softdevice_flash.txt
75+
his sample can be found under :file:`samples/bluetooth/ble_cgms/` in the |BMshort| folder structure.
7676

77-
.. _ble_cgms_sample_testing:
77+
For details on how to create, configure and program a sample see :ref:`getting_started_with_the_samples`.
7878

79-
Building and running
80-
********************
81-
82-
This sample can be found under :file:`samples/bluetooth/ble_cgms/` in the |BMshort| folder structure.
83-
84-
.. include:: /includes/create_sample.txt
85-
86-
.. include:: /includes/configure_and_build_sample.txt
87-
88-
.. include:: /includes/program_sample.txt
8979

9080
Testing
91-
=======
81+
*******
9282

9383
1. Compile and program the application.
9484
#. Connect the device to the computer.

samples/bluetooth/ble_hids_keyboard/README.rst

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,26 +101,16 @@ LED 1:
101101
LED 3:
102102
Lit when Caps Lock is on.
103103

104-
Programming the S115 SoftDevice
105-
*******************************
106-
107-
.. include:: /includes/softdevice_flash.txt
108-
109-
.. _ble_hids_keyboard_sample_testing:
110-
111-
Building and running
112-
********************
104+
Playing with the sample
105+
***********************
113106

114107
This sample can be found under :file:`samples/bluetooth/ble_hids_keyboard/` in the |BMshort| folder structure.
115108

116-
.. include:: /includes/create_sample.txt
117-
118-
.. include:: /includes/configure_and_build_sample.txt
109+
For details on how to create, configure and program a sample see :ref:`getting_started_with_the_samples`.
119110

120-
.. include:: /includes/program_sample.txt
121111

122112
Testing
123-
=======
113+
*******
124114

125115
1. Compile and program the application.
126116
#. In the Serial Terminal, using the `Serial Terminal app`_ or |VSC|, observe that the ``BLE HIDS Keyboard sample started.`` message is printed.

samples/bluetooth/ble_hids_mouse/README.rst

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,16 @@ LED 0:
102102
LED 1:
103103
Lit when a device is connected.
104104

105-
Programming the S115 SoftDevice
106-
*******************************
107-
108-
.. include:: /includes/softdevice_flash.txt
109-
110-
.. _ble_hids_mouse_sample_testing:
111-
112-
113-
Building and running
114-
********************
105+
Playing with the sample
106+
***********************
115107

116108
This sample can be found under :file:`samples/bluetooth/ble_hids_mouse/` in the |BMshort| folder structure.
117109

118-
.. include:: /includes/create_sample.txt
119-
120-
.. include:: /includes/configure_and_build_sample.txt
110+
For details on how to create, configure and program a sample see :ref:`getting_started_with_the_samples`.
121111

122-
.. include:: /includes/program_sample.txt
123112

124113
Testing
125-
=======
114+
*******
126115

127116
You can test this sample using a computer or a smartphone.
128117

samples/bluetooth/ble_hrs/README.rst

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,17 @@ User interface
9595
Button 1:
9696
Keep the button pressed while resetting the board to delete bonding information for all peers stored on the device.
9797

98-
Programming the S115 SoftDevice
99-
*******************************
10098

101-
.. include:: /includes/softdevice_flash.txt
102-
103-
.. _ble_hrs_sample_testing:
104-
105-
Building and running
106-
********************
99+
Playing with the sample
100+
***********************
107101

108102
This sample can be found under :file:`samples/bluetooth/ble_hrs/` in the |BMshort| folder structure.
109103

110-
.. include:: /includes/create_sample.txt
111-
112-
.. include:: /includes/configure_and_build_sample.txt
104+
For details on how to create, configure and program a sample see :ref:`getting_started_with_the_samples`.
113105

114-
.. include:: /includes/program_sample.txt
115106

116107
Testing
117-
=======
108+
*******
118109

119110
You can test this sample using `nRF Connect for Desktop`_ with the `Bluetooth Low Energy app`_ and the `Serial Terminal app`_.
120111
Make sure that these are installed before starting the testing procedure.

samples/bluetooth/ble_lbs/README.rst

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,27 +71,16 @@ The LED Button Service (LBS) is a custom service that receives information about
7171

7272
You can use the sample to transmit the button state from your development kit to another device.
7373

74-
Programming the S115 SoftDevice
75-
*******************************
76-
77-
.. include:: /includes/softdevice_flash.txt
78-
79-
.. _ble_lbs_sample_testing:
80-
81-
82-
Building and running
83-
********************
74+
Playing with the sample
75+
***********************
8476

8577
This sample can be found under :file:`samples/bluetooth/ble_lbs/` in the |BMshort| folder structure.
8678

87-
.. include:: /includes/create_sample.txt
88-
89-
.. include:: /includes/configure_and_build_sample.txt
79+
For details on how to create, configure and program a sample see :ref:`getting_started_with_the_samples`.
9080

91-
.. include:: /includes/program_sample.txt
9281

9382
Testing
94-
=======
83+
*******
9584

9685
You can test this sample using `nRF Connect for Desktop`_ with the `Bluetooth Low Energy app`_ and the `Serial Terminal app`_.
9786
Make sure that these are installed before starting the testing procedure.

0 commit comments

Comments
 (0)