BOOT_SWAP_USING_MOVE set more than once.

I have just upgraded my project to NCS 3.1.0 and I'm now getting this error

BOOT_SWAP_USING_MOVE (defined at C:/ncs/v3.1.0/bootloader/mcuboot/boot/zephyr/Kconfig:575) set more than once.

If I look at that file in the build directory I do indeed see conflicting settings

# sysbuild controlled configuration settings
...
CONFIG_SINGLE_APPLICATION_SLOT=n
CONFIG_BOOT_SWAP_USING_MOVE=n
CONFIG_BOOT_SWAP_USING_SCRATCH=n
CONFIG_BOOT_UPGRADE_ONLY=n
...
CONFIG_SINGLE_APPLICATION_SLOT=n
CONFIG_BOOT_SWAP_USING_OFFSET=n
CONFIG_BOOT_SWAP_USING_SCRATCH=n
CONFIG_BOOT_UPGRADE_ONLY=n
CONFIG_BOOT_SWAP_USING_MOVE=y
...
I don't set these values in my own config file as far as I can tell, so looks like this conflict comes from NCS 3.1.0 itself
Am I doing something wrong?
Simon
Parents
  • Hello Simon!

    Based on the Kconfig you list and since you have MCUboot my guess is that you have one config that sets CONFIG_BOOT_SWAP_USING_MOVE=n and one that sets CONFIG_BOOT_SWAP_USING_MOVE=y. It could be something in the project configuration that implies (which is stronger than selecting or declaring) a Kconfig. An example of such a config isthe CONFIG_NCS_SAMPLE_ configurations, such as https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU.

    Could you either share your prj.conf, sysbuild.conf as well as sysbuild<companion component>/prf.conf? 

    Do you get these warnings for a custom board, or is it from a custom board that pulls in certain configurations from a Kconfig file (for instance through an "Ifdefine <this board> use these kconfigs for configurations")?

    Kind regards,
    Andreas

  • sysbuild<companion component>/prf.conf

    Not sure what you mean by this. nRF52840 single core chip, no companion chips.

    sysbuild.conf

    # Enable MCUboot in the build
    SB_CONFIG_BOOTLOADER_MCUBOOT=y

    # This is the private key file used for signing images.
    SB_CONFIG_BOOT_SIGNATURE_KEY_FILE=(redacted)

    prj.conf

    CONFIG_GPIO=y

    CONFIG_SPEED_OPTIMIZATIONS=y

    CONFIG_HEAP_MEM_POOL_SIZE=4096

    CONFIG_CLOCK_CONTROL=y
    CONFIG_SERIAL=y

    CONFIG_SHELL=y
    CONFIG_SHELL_LOG_BACKEND=y

    CONFIG_MPSL=y
    CONFIG_MPSL_TIMESLOT_SESSION_COUNT=1
    CONFIG_RING_BUFFER=y

    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="My Device"
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1
    CONFIG_BT_RX_STACK_SIZE=1536
    CONFIG_BT_GATT_CLIENT=y

    # Connection interval and latency
    CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n
    CONFIG_BT_CONN_PARAM_UPDATE_TIMEOUT=1000

    # Enable PHY updates
    CONFIG_BT_USER_PHY_UPDATE=y

    # Set maximum MTU
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    CONFIG_BT_BUF_ACL_RX_SIZE=502
    CONFIG_BT_BUF_ACL_TX_SIZE=502
    CONFIG_BT_L2CAP_TX_MTU=498

    # Enable the NUS service
    CONFIG_BT_NUS=y

    # Enable bonding
    CONFIG_BT_SETTINGS=n
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=n
    CONFIG_SETTINGS=n

    # Enable CMSIS DSP library
    CONFIG_FPU=y
    CONFIG_CMSIS_DSP=y
    CONFIG_CMSIS_DSP_FILTERING=y

    # Enable random number generator
    CONFIG_XOSHIRO_RANDOM_GENERATOR=y

    # This example requires more workqueue stack
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1024

    # Config logger
    CONFIG_LOG=y
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_BACKEND_RTT=n
    CONFIG_LOG_DEFAULT_LEVEL=3

    # enable console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y

    # enable power management
    CONFIG_PM_DEVICE=y

    CONFIG_ASSERT=n

    # PDM Support
    CONFIG_NRFX_PDM0=y

    # RTC support
    CONFIG_NRFX_RTC2=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y

    # SPI devices
    CONFIG_SPI=y
    CONFIG_SPI_NOR=y
    CONFIG_SPI_NOR_SLEEP_WHILE_WAITING_UNTIL_READY=y
    CONFIG_SPI_NOR_SFDP_RUNTIME=y
    CONFIG_FLASH_JESD216_API=y

    # I2C devices
    CONFIG_I2C=y

    CONFIG_ADC=y

    CONFIG_REGULATOR=y

    # Provides restart cause
    CONFIG_HWINFO=y

    # Bootloader
    CONFIG_REBOOT=y
    CONFIG_STREAM_FLASH=y
    CONFIG_IMG_MANAGER=y
    CONFIG_DFU_TARGET=y
    CONFIG_DFU_TARGET_MCUBOOT=y
    CONFIG_BOOTLOADER_MCUBOOT=y

    # MBED TLS for cryptography
    CONFIG_MBEDTLS=y
    CONFIG_MBEDTLS_BUILTIN=y
    # Enable Nordic security backend and PSA APIs
    CONFIG_NRF_SECURITY=y
    CONFIG_MBEDTLS_PSA_CRYPTO_C=y
    # Heap configuration
    CONFIG_MBEDTLS_ENABLE_HEAP=y
    CONFIG_MBEDTLS_HEAP_SIZE=8192
    # Cipher support
    CONFIG_PSA_WANT_KEY_TYPE_AES=y
    CONFIG_PSA_WANT_AES_KEY_SIZE_128=y
    CONFIG_PSA_WANT_ALG_CTR=y

  • I'm observing the same behaviour after updating NCS to v3.1.0.

    The CONFIG_BOOT_SWAP_USING_MOVE in build output is at the same time set to n and y.
    Also the flash command triggers full rebuild even right after performing a pristine build.

  • Hello

    Apologies for the delay in response, I've been OoO with the flu for the past 3 days

    simonhwm said:
    Not sure what you mean by this. nRF52840 single core chip, no companion chips.

    No worries, just to be clear a companion image could also be a bootloader and not just an image running on a different core/MCU. In this case I was referring to if you had any specific configurations for MCUboot, i.e sysbuild/mcuboot/prj.conf or sysbuild/mcuboot.conf

    MCUboot chooses CONFIG_BOOT_SWAP_USING_MOVE as the default method to swap the running firmware image with the candidate image, but I don't quite see why this config is also set as n in the generated .conf.

    I will have to check this for myself in 3.1.0 early next week. 

    Kind regards,
    Andreas

  • Hi,

    No unfortunately not. I spent a bit last week and again today attempting to recreate what you see and I can't find a configuration that triggers this behavior.

    You mention that you see the behavior when doing a pristine build. Do you also see the same when deleting the existing build folders before rebuilding? If yes, do you have a minimal sample that reproduces on a 52840DK?

    Kind regards,
    Andreas

  • Just to add, I'm also seeing this while upgrading our project.

    It persists across pristine build/deleting build folder/etc.

    Looking in `build/mcuboot/zephyr/.config.sysbuild`, there are indeed two entries for `CONFIG_BOOT_SWAP_USING_MOVE`

Reply Children
Related