Minimal SMP configuration

Hi,

I have a project with the SMP enabled to do BLE OTA updates. The SMP is working well and I can upload firmware from a mobile app etc. The question I have is around the minimum configuration and flash usage. Part of the SMP is the filesystem and the stats blocks which are all enabled as part of the configuration in the example. When these are all enabled the flash usage suddenly jumps up as I am guessing it includes a whole load of modules to work. If i only want the firmware update part of the SMP is it possible to change the configuration to just do this? For example can i set CONFIG_STATS=n instead of yes if I do not want the stats? 

Below is my current configuration for the SMP:

CONFIG_NET_BUF=y
CONFIG_ZCBOR=y
CONFIG_CRC=y
CONFIG_STREAM_FLASH=y

# Enable mcumgr.
CONFIG_MCUMGR=y

# Some command handlers require a large stack.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Ensure an MCUboot-compatible binary is generated.
CONFIG_BOOTLOADER_MCUBOOT=y

# Enable flash operations. - defined above
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 log level watn for mcuboot
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_INF=y

# Enable the Bluetooth mcumgr transport (unauthenticated).
CONFIG_MCUMGR_TRANSPORT_BT=y
CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN=n
CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y

# Enable the Shell mcumgr transport.
CONFIG_BASE64=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

CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
Do you have an example of a configuration which only allows for firmware updates and not the file system and statistics modules?
Thanks
Parents
  • Hi,

    It seems like you have based your config on the smp_svr sample. You may also find the DFU related sample collections my colleague have here relevant, particularily this one, which is quite minimal and only includes what you need for DFU over BLE.

    Note that when you enable MCUboot, you will need parts of the flash for the bootloader, and the remaining flash will be split in half to have two application slots as that is needed for DFU. So if you have a large application, you may need to use external flash for the secondary slot.

Reply
  • Hi,

    It seems like you have based your config on the smp_svr sample. You may also find the DFU related sample collections my colleague have here relevant, particularily this one, which is quite minimal and only includes what you need for DFU over BLE.

    Note that when you enable MCUboot, you will need parts of the flash for the bootloader, and the remaining flash will be split in half to have two application slots as that is needed for DFU. So if you have a large application, you may need to use external flash for the secondary slot.

Children
No Data
Related