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

  • Adding, though, that it is still defined twice.

    Just that both are set to the same value now.

  • Hayden Ball said:
    I suspect this is `zephyr/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake` and `nrf/sysbuild/CMakeLists.txt` fighting.

    You are 100% right, this is indeed the culprit. I see that Jamie was already on top of this (which he typically tends to be)

    So to confirm; with commit 4930977 added you also see that MCUboot mode is just configured once and thus the issue is resolved?

    Kind regards,
    Andreas

  • Yes - the issue is resolved for me having applied that commit.

  • Great, sorry I couldn't find that issue before you did, but nonetheless I'm glad that the original issue is resolved

    I'll mark your comment as the answer, and as always please feel free to open new cases for new questions

    Kind regards,
    Andreas

Reply Children
No Data
Related