|
| 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`. |
0 commit comments