-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nrf noup] samples: mgmt: mcumgr: smp_svr: Add nrf5340dk-optimised sa…
…mple Adds a configuration to this sample that is optimised for testing/usage with the nRF5340 which enables the Bluetooth transport, enables most management groups, has a static partition manager file with secondary partitions on QSPI flash, configures MCUboot in overwrite only mode with network core update support Signed-off-by: Jamie McCrae <[email protected]>
- Loading branch information
Showing
6 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/ { | ||
chosen { | ||
nordic,pm-ext-flash = &mx25r64; | ||
}; | ||
}; |
55 changes: 55 additions & 0 deletions
55
samples/subsys/mgmt/mcumgr/smp_svr/pm_static_nrf5340_bt.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
app: | ||
address: 0x10200 | ||
region: flash_primary | ||
size: 0xdfe00 | ||
mcuboot: | ||
address: 0x0 | ||
region: flash_primary | ||
size: 0x10000 | ||
mcuboot_pad: | ||
address: 0x10000 | ||
region: flash_primary | ||
size: 0x200 | ||
mcuboot_primary: | ||
address: 0x10000 | ||
orig_span: &id001 | ||
- mcuboot_pad | ||
- app | ||
region: flash_primary | ||
size: 0xe0000 | ||
span: *id001 | ||
mcuboot_primary_app: | ||
address: 0x10200 | ||
orig_span: &id002 | ||
- app | ||
region: flash_primary | ||
size: 0xdfe00 | ||
span: *id002 | ||
settings_storage: | ||
address: 0xf0000 | ||
region: flash_primary | ||
size: 0x10000 | ||
mcuboot_primary_1: | ||
address: 0x0 | ||
size: 0x40000 | ||
device: flash_ctrl | ||
region: ram_flash | ||
mcuboot_secondary: | ||
address: 0x00000 | ||
size: 0xe0000 | ||
device: MX25R64 | ||
region: external_flash | ||
mcuboot_secondary_1: | ||
address: 0xe0000 | ||
size: 0x40000 | ||
device: MX25R64 | ||
region: external_flash | ||
external_flash: | ||
address: 0x120000 | ||
size: 0x6e0000 | ||
device: MX25R64 | ||
region: external_flash | ||
pcd_sram: | ||
address: 0x20000000 | ||
size: 0x2000 | ||
region: sram_primary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Enable MCUmgr and dependencies. | ||
CONFIG_NET_BUF=y | ||
CONFIG_ZCBOR=y | ||
CONFIG_CRC=y | ||
CONFIG_MCUMGR=y | ||
CONFIG_STREAM_FLASH=y | ||
CONFIG_FLASH_MAP=y | ||
CONFIG_BT=y | ||
CONFIG_BT_PERIPHERAL=y | ||
|
||
# Some command handlers require a large stack. | ||
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304 | ||
CONFIG_MAIN_STACK_SIZE=2176 | ||
|
||
# Ensure an MCUboot-compatible binary is generated. | ||
CONFIG_BOOTLOADER_MCUBOOT=y | ||
|
||
# Enable flash operations. | ||
CONFIG_FLASH=y | ||
|
||
# Required by the `taskstat` command. | ||
CONFIG_THREAD_MONITOR=y | ||
|
||
# Support for taskstat command | ||
CONFIG_MCUMGR_GRP_OS_TASKSTAT=y | ||
|
||
# Enable statistics and statistic names. | ||
CONFIG_STATS=y | ||
CONFIG_STATS_NAMES=y | ||
|
||
# Enable most core commands. | ||
CONFIG_FLASH=y | ||
CONFIG_IMG_MANAGER=y | ||
CONFIG_MCUMGR_GRP_IMG=y | ||
CONFIG_MCUMGR_GRP_OS=y | ||
CONFIG_MCUMGR_GRP_STAT=y | ||
|
||
# Enable logging | ||
CONFIG_LOG=y | ||
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y | ||
|
||
# Disable debug logging | ||
CONFIG_LOG_MAX_LEVEL=3 | ||
|
||
# Allow for large Bluetooth data packets. | ||
CONFIG_BT_L2CAP_TX_MTU=498 | ||
CONFIG_BT_BUF_ACL_RX_SIZE=502 | ||
CONFIG_BT_BUF_ACL_TX_SIZE=502 | ||
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 | ||
|
||
# Enable the Bluetooth mcumgr transport (unauthenticated). | ||
CONFIG_MCUMGR_TRANSPORT_BT=y | ||
CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y | ||
|
||
# Enable the Shell mcumgr transport. | ||
CONFIG_BASE64=y | ||
CONFIG_CRC=y | ||
CONFIG_SHELL=y | ||
CONFIG_SHELL_BACKEND_SERIAL=y | ||
CONFIG_MCUMGR_TRANSPORT_SHELL=y | ||
|
||
# Enable the mcumgr Packet Reassembly feature over Bluetooth and its configuration dependencies. | ||
# MCUmgr buffer size is optimized to fit one SMP packet divided into five Bluetooth Write Commands, | ||
# transmitted with the maximum possible MTU value: 498 bytes. | ||
CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY=y | ||
CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=2475 | ||
CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y | ||
CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=4608 | ||
|
||
# Enable the LittleFS file system. | ||
CONFIG_FILE_SYSTEM=y | ||
CONFIG_FILE_SYSTEM_LITTLEFS=y | ||
|
||
# Enable file system commands | ||
CONFIG_MCUMGR_GRP_FS=y | ||
|
||
# Enable the storage erase command. | ||
CONFIG_MCUMGR_GRP_ZBASIC=y | ||
CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=y | ||
|
||
# Disable Bluetooth ping support | ||
CONFIG_BT_CTLR_LE_PING=n | ||
|
||
# Disable shell commands that are not needed | ||
CONFIG_CLOCK_CONTROL_NRF_SHELL=n | ||
CONFIG_DEVICE_SHELL=n | ||
CONFIG_DEVMEM_SHELL=n | ||
CONFIG_FLASH_SHELL=n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
if(FILE_SUFFIX STREQUAL "nrf5340_bt") | ||
if(SB_CONFIG_SOC_NRF5340_CPUAPP) | ||
# nRF5340 with Bluetooth configuration, add partition manager configuration to MCUboot image | ||
list(APPEND mcuboot_EXTRA_DTC_OVERLAY_FILE ${CMAKE_CURRENT_LIST_DIR}/app_nrf5340_bt.overlay) | ||
list(REMOVE_DUPLICATES mcuboot_EXTRA_DTC_OVERLAY_FILE) | ||
set(mcuboot_EXTRA_DTC_OVERLAY_FILE ${mcuboot_EXTRA_DTC_OVERLAY_FILE} CACHE INTERNAL "" FORCE) | ||
else() | ||
message(FATAL_ERROR "File suffix 'nrf5340_bt' can only be used on an nRF5340 CPUAPP board target") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Enable MCUboot bootloader support | ||
SB_CONFIG_BOOTLOADER_MCUBOOT=y | ||
SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y | ||
SB_CONFIG_NETCORE_HCI_IPC=y | ||
SB_CONFIG_SECURE_BOOT_NETCORE=y | ||
SB_CONFIG_NETCORE_APP_UPDATE=y | ||
SB_CONFIG_MCUBOOT_NRF53_MULTI_IMAGE_UPDATE=y | ||
SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y |