Skip to content

Commit

Permalink
samples: use sysbuild in sidewalk
Browse files Browse the repository at this point in the history
[KRKNWK-18748]
* add sysbuild config for sample
* add sysbuild hci_ipc and mcuboot configs
* use sysbuild in twister
* use version file instead of script
* replace deprecacet conf_file to new file_sufix

Signed-off-by: Krzysztof Taborowski <[email protected]>
  • Loading branch information
ktaborowski authored and nordicjm committed May 22, 2024
1 parent c08bec3 commit 8981fd7
Show file tree
Hide file tree
Showing 17 changed files with 256 additions and 69 deletions.
4 changes: 2 additions & 2 deletions doc/samples/sid_end_device.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ You can build the ``release`` firmware for ``build_target`` by running the follo
.. parsed-literal::
:class: highlight
$ west build -b *build_target* -- -DCONF_FILE=prj_release.conf
$ west build -b *build_target* -- -DFILE_SUFFIX=release
For example:

.. code-block:: console
$ west build -b nrf52840dk/nrf52840 -- -DCONF_FILE=prj_release.conf
$ west build -b nrf52840dk/nrf52840 -- -DFILE_SUFFIX=release
.. note::
Selecting a build type is optional.
Expand Down
3 changes: 0 additions & 3 deletions samples/sid_end_device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

cmake_minimum_required(VERSION 3.20.0)

# Sidewalk version
include(bootloader_version.cmake)

# Zephyr CMake project
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(sidewalk_sid_end_device)
Expand Down
54 changes: 54 additions & 0 deletions samples/sid_end_device/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config NRF_DEFAULT_BLUETOOTH
default y if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP

choice BOOTLOADER
default BOOTLOADER_MCUBOOT
endchoice

if BOOTLOADER_MCUBOOT

config DFU_MULTI_IMAGE_PACKAGE_BUILD
default y

config DFU_MULTI_IMAGE_PACKAGE_APP
default y

if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP)

config MCUBOOT_UPDATEABLE_IMAGES
default 2

choice MCUBOOT_MODE
default MCUBOOT_MODE_OVERWRITE_ONLY
endchoice

choice BOOT_SIGNATURE_TYPE
default BOOT_SIGNATURE_TYPE_RSA
endchoice

config SECURE_BOOT
default y

config SECURE_BOOT_NETCORE
default y

config NETCORE_APP_UPDATE
default y

config DFU_MULTI_IMAGE_PACKAGE_NET
default y

endif # BOOTLOADER_MCUBOOT

endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP)

config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP

source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
5 changes: 5 additions & 0 deletions samples/sid_end_device/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VERSION_MAJOR = 2
VERSION_MINOR = 6
PATCHLEVEL = 99
VERSION_TWEAK = 0
EXTRAVERSION =
19 changes: 0 additions & 19 deletions samples/sid_end_device/boards/nrf5340dk_nrf5340_cpuapp.conf

This file was deleted.

This file was deleted.

5 changes: 3 additions & 2 deletions samples/sid_end_device/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sample:
name: Sidewalk end device sample
description: Sample implementing Amazon Sidewalk End Device
common:
sysbuild: true
build_only: true
platform_allow:
- nrf52840dk/nrf52840
Expand All @@ -19,7 +20,7 @@ tests:

sample.sidewalk.hello.release:
extra_args:
CONF_FILE=prj_release.conf
FILE_SUFFIX=release
extra_configs:
- CONFIG_SID_END_DEVICE_PERSISTENT_LINK_MASK=y
tags: Sidewalk hello
Expand All @@ -31,7 +32,7 @@ tests:

sample.sidewalk.hello.ble_only.release:
extra_args:
CONF_FILE=prj_release.conf
FILE_SUFFIX=release
extra_configs:
- CONFIG_SIDEWALK_SUBGHZ_SUPPORT=n
tags: Sidewalk hello BLE
Expand Down
36 changes: 36 additions & 0 deletions samples/sid_end_device/sysbuild/hci_ipc/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Bluetooth
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_CENTRAL=n
CONFIG_BT_MAX_CONN=1
CONFIG_BT_BUF_ACL_RX_SIZE=502
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_CTLR_ASSERT_HANDLER=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1

# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
# Host number of completed commands does not follow normal flow control.
CONFIG_BT_BUF_CMD_TX_COUNT=10

# IPC
CONFIG_IPC_SERVICE=y
CONFIG_MBOX=y

# Debug
CONFIG_LOG=n
CONFIG_SERIAL=n
CONFIG_ASSERT=y
CONFIG_DEBUG_INFO=y
CONFIG_EXCEPTION_STACK_TRACE=y
CONFIG_RESET_ON_FATAL_ERROR=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Configure QSPI for external flash
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
zephyr,code-partition = &boot_partition;
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

# The following configurations are required to support simultaneous multi image update
CONFIG_PCD_APP=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2

CONFIG_BOOT_SWAP_USING_MOVE=n
# Multi-image updates do not support image swapping yet.
CONFIG_BOOT_UPGRADE_ONLY=y

# The network core cannot access external flash directly. The flash simulator must be used to
# provide a memory region that is used to forward the new firmware to the network core.
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n

# Enable custom command to erase settings partition.
CONFIG_ENABLE_MGMT_PERUSER=y
CONFIG_ZCBOR=y
CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
zephyr,code-partition = &boot_partition;
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Ensure that the qspi driver is disabled by default
CONFIG_NORDIC_QSPI_NOR=n

# Workaroud: fprotect and watchdog feed
# are not supported in NCS v2.6.0
CONFIG_FPROTECT=n
CONFIG_BOOT_WATCHDOG_FEED=n
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Configure MCUboot features
CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_BOOT_MAX_IMG_SECTORS=256
CONFIG_MCUBOOT_DOWNGRADE_PREVENTION=y

# Allow for storing two images in MCUboot partitions
CONFIG_UPDATEABLE_IMAGE_NUMBER=2

# Store new images inside external flash
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y

# Enable flash simulator
CONFIG_PCD_APP=y
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n

# Configure QSPI for external flash
CONFIG_FLASH=y
CONFIG_FPROTECT=y
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

# Disable USB CDC ACM
CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM=n
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
zephyr,code-partition = &boot_partition;
nordic,pm-ext-flash = &mx25r64;
};
};
36 changes: 36 additions & 0 deletions samples/sid_end_device/sysbuild/mcuboot/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_MAIN_STACK_SIZE=10240

CONFIG_BOOT_SWAP_SAVE_ENCTLV=n
CONFIG_BOOT_BOOTSTRAP=n
CONFIG_PM=n

CONFIG_FLASH=y
CONFIG_FPROTECT=y

CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h"

CONFIG_BOOT_MAX_IMG_SECTORS=256

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y

# Bootloader size optimization
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_GPIO=n
CONFIG_LOG=n
CONFIG_CONSOLE_HANDLER=n
CONFIG_BOOT_BANNER=n
CONFIG_TIMESLICING=n
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_MULTITHREADING=n
CONFIG_TICKLESS_KERNEL=n
CONFIG_TIMEOUT_64BIT=n
CONFIG_NRF_ENABLE_ICACHE=n
24 changes: 0 additions & 24 deletions scripts/generate_version_info_overlay.py

This file was deleted.

0 comments on commit 8981fd7

Please sign in to comment.