How to use SMP Protocol Specification with nrf52840 to update nrf5340 ?

Hi,

I succed to update an nrf52840 with another nrf52840 with smp protocol specification, but for a nrf5340(here i use thingy:53) i don't know how tu upload the app_update, i have always an error that i didn't had with the nrf52840.

I succed to update the nrf5340 with the mobile phone application , suceed with netcore and appcore.

I used this sample : https://github.com/simon-iversen/ncs_samples/tree/master/central_smp_client_dfu for the nrf52840 that work as a central device and i use smp_srv for my other nrf52840.

But for the thingy:53 i used the thingy53_nrf5340_cpuapp.conf from bootloader\mcuboot\boot\zephyr\boards

I think the probleme can be the mcubootloader configuration, but i don't succed in the use of an MCUBootloader without : the CONFIG_UPDATEABLE_IMAGE_NUMBER=2

Can you help me solve this ?

Thanks you

Pierre-Yves

  • Hi Pierre-Yves,

    but for a nrf5340(here i use thingy:53) i don't know how tu upload the app_update, i have always an error that i didn't had with the nrf52840.

    What error are you getting?

    I think the probleme can be the mcubootloader configuration, but i don't succed in the use of an MCUBootloader without : the CONFIG_UPDATEABLE_IMAGE_NUMBER=2

    You should be able to get it to work without CONFIG_UPDATEABLE_IMAGE_NUMBER=2 as long as you are not trying to update both cores simultaneously.

    But for the thingy:53 i used the thingy53_nrf5340_cpuapp.conf from bootloader\mcuboot\boot\zephyr\boards

    Please try with the following for thingy53_nrf5340_cpuapp.conf instead:

    # Thingy:53 DFU
    
    CONFIG_MCUMGR=y
    CONFIG_MCUMGR_SMP_BT=y
    CONFIG_MCUMGR_SMP_BT_AUTHEN=n
    CONFIG_MCUMGR_SMP_BT_CONN_PARAM_CONTROL=y
    
    CONFIG_MCUMGR_CMD_IMG_MGMT=y
    CONFIG_MCUMGR_CMD_OS_MGMT=y
    
    # Enable 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_SMP_REASSEMBLY_BT=y
    CONFIG_MCUMGR_BUF_SIZE=2475
    CONFIG_OS_MGMT_MCUMGR_PARAMS=y
    
    # Enable custom SMP request to erase settings partition.
    CONFIG_MCUMGR_GRP_ZEPHYR_BASIC=y
    CONFIG_MCUMGR_GRP_BASIC_CMD_STORAGE_ERASE=y
    
    # Increase system workqueue stack size to prevent stack overflows while handling
    # SMP requests.
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    
    CONFIG_BT_L2CAP_TX_MTU=498
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_BUF_ACL_RX_SIZE=502
    
    # Use connection parameters that ensure quick data transfer
    CONFIG_BT_PERIPHERAL_PREF_MIN_INT=6
    CONFIG_BT_PERIPHERAL_PREF_MAX_INT=6
    CONFIG_BT_PERIPHERAL_PREF_LATENCY=99
    CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400
    
    # Use deferred logging
    CONFIG_NCS_SAMPLES_DEFAULTS=n
    CONFIG_LOG=y
    CONFIG_LOG_PRINTK=y
    CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024
    CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS=4000
    CONFIG_ASSERT=y
    CONFIG_ASSERT_NO_COND_INFO=y
    CONFIG_ASSERT_NO_MSG_INFO=y
    CONFIG_HW_STACK_PROTECTION=y
    
    ################################################################################
    # Bootloader configuration
    
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUBOOT_IMAGE_VERSION="2.0.0+0"
    #CONFIG_UPDATEABLE_IMAGE_NUMBER=2
    
    CONFIG_IMG_MANAGER=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    
    ################################################################################
    # External flash configuration
    
    CONFIG_NORDIC_QSPI_NOR=y
    CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
    
    ################################################################################
    # Enable USB CDC ACM
    
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_DEVICE_REMOTE_WAKEUP=n
    CONFIG_USB_DEVICE_PRODUCT="Thingy:53 Application"
    CONFIG_USB_DEVICE_VID=0x1915
    CONFIG_USB_DEVICE_PID=0x530C
    CONFIG_USB_CDC_ACM=y
    CONFIG_USB_CDC_ACM_LOG_LEVEL_ERR=y
    CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
    
    # Use CDC_ACM0 for logs
    CONFIG_LOG_BACKEND_UART=y
    CONFIG_USE_SEGGER_RTT=n
    CONFIG_LOG_BACKEND_RTT=n
    
    
    
    # Enable flash operations.
    CONFIG_FLASH=y

    Best regards,

    Marte

Related