MCUmgr how to choose where to store signed image after upload?

Hello, I have a problem that when uploading signed image to Thingy53 - nrf5340 it will save it on to external flash. At least I am thinking that because it uses address of external flash in writing to flash function.

My question is how can i choose target destination of uploaded image? There is a project with nrf5340 without external flash so with pretty similar configuration it will freeze during uploading.
(to be specific on thingy53 i use smpsrv sample with prj config and additional shown bellow, also the image from VScode after mcumgr image upload) 

# 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_SMP_CLIENT=y

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

# 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

# Enable most core commands.
CONFIG_IMG_MANAGER=y
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_MCUMGR_GRP_OS=y

# Enable logging
CONFIG_LOG=y
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y

# Disable debug logging
CONFIG_LOG_MAX_LEVEL=3

# Enable shell commands.
CONFIG_BASE64=y
CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_SERIAL=n
CONFIG_MCUMGR_GRP_SHELL=y

# Enable the serial MCUmgr transport.
CONFIG_MCUMGR_TRANSPORT_UART=y

  • Hi, 

    At least I am thinking that because it uses address of external flash in writing to flash function.

    You can use the memory report to check the memory layout. If it uses the external memory, the layout would look like this.

    My question is how can i choose target destination of uploaded image? There is a project with nrf5340 without external flash so with pretty similar configuration it will freeze during uploading.

    In general, the file will upload to the second slot to write the new image. You should use the static partitioning if you don't.   See Static partition requirement for DFU

    The pm_static.yml of smpsrv sample might be suitable for thingy53, so you could duplicate partitions.yml under the build folder and then rename and replace the pm_static.yml. 

    (to be specific on thingy53 i use smpsrv sample with prj config and additional shown bellow

    Not sure why you have "CONFIG_SMP_CLIENT=y". Are you making it as the SMP Client? What would you want to achieve? Could you explain the goal?

    I see you can work with the default configs in this post

    Regards,
    Amanda H.

  • Thank you for your answer. I'm pretty new to partitions and DTS configurations. I will try the approach you recommended and read more about Static partition requirement for DFU

    My goal is simply to make smpsrv work on the other device using same SoC (nrf5340) so I can perform OTA updates on the other device without using external flash.

  • During a FOTA update, there might not be enough space available in internal flash storage to store the existing application and network core images as well as the incoming images, so the incoming images must be stored in external flash storage. 

    Please take a look at the Thingy:53 application guide

Related