Skip to content

Commit

Permalink
samples: fix bootloaders warnings
Browse files Browse the repository at this point in the history
Remove mcuboot board overlays for _ns variant,
mcuboot always use secure images.
Fix warning was assigned 'y' but got 'n':
* FPROTECT_ALLOW_COMBINED_REGIONS on nrf54l15
* MBEDTLS_CFG_FILE on nrf52840
Remove redundant PM_MCUBOOT_PAD configuration.
Remove log configuration from board overlays.

Signed-off-by: Krzysztof Taborowski <[email protected]>
  • Loading branch information
ktaborowski committed Nov 7, 2024
1 parent 46b4ea3 commit 9d5fe01
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 112 deletions.
16 changes: 11 additions & 5 deletions samples/sid_end_device/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ config DFU_MULTI_IMAGE_PACKAGE_BUILD
config DFU_MULTI_IMAGE_PACKAGE_APP
default y

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

if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP)

config MCUBOOT_UPDATEABLE_IMAGES
Expand Down Expand Up @@ -46,12 +49,15 @@ config DFU_MULTI_IMAGE_PACKAGE_NET

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
if (BOARD_NRF54L15DK_NRF54L15_CPUAPP || BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS)

# TODO: NCSDK-28931: Cannot use fprotect twice, so disable it in MCUboot to
# test protecting factory data. It can be enabled while there is a support
# for protection more than one region.
config MCUBOOT_FPROTECT_ALLOW_COMBINED_REGIONS
default n

# override the mcuboot pad size, because it is not set globally for NS build.
config PM_MCUBOOT_PAD
default 0x800
endif # (BOARD_NRF54L15DK_NRF54L15_CPUAPP || BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS)

endif # BOOTLOADER_MCUBOOT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

# Disable the Flash Patch and Breakpoint (FPB) feature
# to increase the security of the device.
CONFIG_DISABLE_FLASH_PATCH=y
CONFIG_REBOOT=y
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#
# Copyright (c) 2021 Nordic Semiconductor ASA
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# TODO: NCSDK-28931: Cannot use fprotect twice, so disable it in MCUboot to
# test protecting Matter factory data. It can be enabled while there is a support
# test protecting factory data. It can be enabled while there is a support
# for protection more than one region.
CONFIG_FPROTECT=n

# TODO: Workaround, disable memory guard to avoid false faults in application after boot
CONFIG_HW_STACK_PROTECTION=n

Expand All @@ -20,38 +21,9 @@ CONFIG_TICKLESS_KERNEL=y

CONFIG_BOOT_WATCHDOG_FEED=n

# Disable all debug features
CONFIG_USE_SEGGER_RTT=n
CONFIG_SHELL=n
CONFIG_OPENTHREAD_SHELL=n
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_LOG=n
CONFIG_LOG_MODE_MINIMAL=n
CONFIG_ASSERT_VERBOSE=n
CONFIG_ASSERT_NO_FILE_INFO=y
CONFIG_PRINTK=n
CONFIG_PRINTK_SYNC=n
CONFIG_THREAD_NAME=n
CONFIG_BOOT_BANNER=n
CONFIG_NCS_BOOT_BANNER=n

CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y

# Ensure that the qspi driver is disabled by default
CONFIG_GPIO=n
CONFIG_SPI=n
CONFIG_SPI_NOR=n
CONFIG_NORDIC_QSPI_NOR=n
CONFIG_MULTITHREADING=n

# Others
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y


# Workaroud: fprotect and watchdog feed
# are not supported in NCS v2.6.0
CONFIG_FPROTECT=n
CONFIG_BOOT_WATCHDOG_FEED=n
CONFIG_POWEROFF=y

This file was deleted.

This file was deleted.

14 changes: 7 additions & 7 deletions samples/sid_end_device/sysbuild/mcuboot/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_MAIN_STACK_SIZE=10240

Expand All @@ -12,26 +13,25 @@ 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

# Disable logs
CONFIG_NCS_BOOT_BANNER=n
CONFIG_BOOT_BANNER=n
CONFIG_CONSOLE=n
CONFIG_NCS_BOOT_BANNER=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_CONSOLE_HANDLER=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_LOG=n
CONFIG_LOG_MODE_MINIMAL=n
CONFIG_PRINTK=n
CONFIG_ASSERT=n

# Bootloader size optimization
CONFIG_CONSOLE=n
CONFIG_CONSOLE_HANDLER=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_GPIO=n
CONFIG_TIMESLICING=n
Expand Down

0 comments on commit 9d5fe01

Please sign in to comment.