Hello everyone.
I'm using the nRF Connect SDK v1.6.1 (it's an old project) on a nRF5340. Our project is based on the central_bas sample.
I want to use MCUBoot to update the application in the field.
I added the necessary configs to the prj.conf of both our central_bas project as well as the MCUBoot project.
Now whenever I add "CONFIG_MCUMGR_SMP_UART=y" to the prj.conf of the central_bas project, it sets CONFIG_UART_0_ASYNC (everything applies to UART_1 as well) to false (or "n") and won't let me change it. Adding "CONFIG_UART_0_ASYNC=y" in the prj.conf does not change anything and I can't change it via "Configure nRF Connect SDK Project..." in Segger Embedded Studio as it is greyed out there.
Without "CONFIG_UART_0_ASYNC" our UART init fails during startup of our application.
What causes "CONFIG_MCUMGR_SMP_UART" to disable and lock "CONFIG_UART_0_ASYNC"?
Best regards,
Alex
prj.conf of central_bas:
# # Copyright (c) 2019 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_NCS_SAMPLES_DEFAULTS=y CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_GATT_CLIENT=y CONFIG_BT_GATT_DM=y # was before CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_HEAP_MEM_POOL_SIZE=2048 CONFIG_BT_BAS_CLIENT=y CONFIG_BT_SCAN=y CONFIG_BT_SCAN_FILTER_ENABLE=y CONFIG_BT_SCAN_UUID_CNT=1 CONFIG_BT_PRIVACY=y CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_DK_LIBRARY=y ### START added from peripheral_UART example ### # Enable the UART driver CONFIG_UART_ASYNC_API=y CONFIG_NRFX_UARTE0=y CONFIG_NRFX_UARTE1=y CONFIG_SERIAL=y CONFIG_GPIO=y # Make sure printk is not printing to the UART console CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y ### END added from peripheral_UART example ### # Enable nordic security backend and PSA APIs CONFIG_MBEDTLS_LIBRARY_NRF_SECURITY=y CONFIG_NORDIC_SECURITY_BACKEND=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=8192 ### Added MCUBoot as first-stage bootloader ### CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_MCUBOOT_IMAGE_VERSION="1.3.0+1" # maj.min.rev+build #CONFIG_BOOT_SIGNATURE_KEY_FILE="privMCUBoot.pem" #CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT=y # available in NCS v2.0.0 and above # Enable mcumgr. CONFIG_MCUMGR=y # Enable most core commands. CONFIG_MCUMGR_CMD_IMG_MGMT=y CONFIG_MCUMGR_CMD_OS_MGMT=y # Enable the serial mcumgr transport. CONFIG_MCUMGR_SMP_UART=y CONFIG_UART_MCUMGR_ON_DEV_NAME="UART_0" #CONFIG_UART_0_ASYNC=y #CONFIG_UART_1_ASYNC=y # Some command handlers require a large stack. Important for mcumgr, would otherwise timeout CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 ### "UART_0" is the default value, other values like "UARTE_0" or "UART_1" prohibit output #CONFIG_UART_CONSOLE_ON_DEV_NAME="UART_0" ### Fixed necessary project config ### #CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y #CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y #CONFIG_SOC_LFXO_CAP_EXTERNAL=y #CONFIG_SOC_HFXO_CAP_EXTERNAL=y #CONFIG_NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED=n #CONFIG_NRFX_CLOCK=y ### End of necessary project config ###
prj.conf of MCUBoot:
#CONFIG_CONSOLE_HANDLER=y #CONFIG_SYSTEM_CLOCK_DISABLE=y #CONFIG_SYS_POWER_MANAGEMENT=n CONFIG_PM=n CONFIG_MAIN_STACK_SIZE=10240 CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" CONFIG_BOOT_SWAP_SAVE_ENCTLV=n CONFIG_BOOT_ENCRYPT_RSA=n CONFIG_BOOT_ENCRYPT_EC256=n CONFIG_BOOT_ENCRYPT_X25519=n CONFIG_BOOT_UPGRADE_ONLY=n CONFIG_BOOT_BOOTSTRAP=n ### mbedTLS has its own heap # CONFIG_HEAP_MEM_POOL_SIZE is not set ### We never want Zephyr's copy of tinycrypt. If tinycrypt is needed, ### MCUboot has its own copy in tree. # CONFIG_TINYCRYPT is not set # CONFIG_TINYCRYPT_ECC_DSA is not set # CONFIG_TINYCRYPT_SHA256 is not set CONFIG_FLASH=y CONFIG_FPROTECT=y ### Various Zephyr boards enable features that we don't want. # CONFIG_BT is not set # CONFIG_BT_CTLR is not set # CONFIG_I2C is not set CONFIG_LOG=y CONFIG_LOG_MODE_MINIMAL=y # former CONFIG_MODE_MINIMAL ### Ensure Zephyr logging changes don't use more resources CONFIG_LOG_DEFAULT_LEVEL=0 ### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y CONFIG_CBPRINTF_NANO=y ### Added for compatibility with our central_bas ### CONFIG_BOOT_DIRECT_XIP=y ### Should be "y" per default, CONFIG_SERIAL=n disables the output from MCUBoot #CONFIG_SERIAL=y #CONFIG_UART_CONSOLE_ON_DEV_NAME="UART_0" ### Fixed necessary project config ### #CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y #CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y #CONFIG_SOC_LFXO_CAP_EXTERNAL=y #CONFIG_SOC_HFXO_CAP_EXTERNAL=y #CONFIG_NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED=n #CONFIG_NRFX_CLOCK=y ### End of necessary project config ###
Devicetree overlay of central_bas:
&uart0
{ tx-pin = < 0x1c >; rx-pin = < 0x1a >; rts-pin = < 0x1e >; cts-pin = < 0x1f >; }
;
&uart1
{ status = "okay"; current-speed = < 0x1c200 >; tx-pin = < 0x22 >; rx-pin = < 0x0d >; }
;
&i2c1
{ sda-pin = < 0x16 >; scl-pin = < 0x17 >; status = "disabled"; }
;
&pwm0
{ ch0-pin = < 0x10 >; }
;
&qspi
{ io-pins = < 0xf >; status = "disabled"; }
;
&{/} {
leds {
compatible = "gpio-leds";
led0: led_0
{ gpios = < &gpio0 0x13 0x1 >; label = "Green LED 0"; }
;
led1: led_1
{ gpios = < &gpio0 0x15 0x1 >; label = "Green LED 1"; }
;
led2: led_2
{ gpios = < &gpio1 0x08 0x1 >; label = "Green LED 2"; }
;
led3: led_3
{ gpios = < &gpio1 0x06 0x1 >; label = "Green LED 3"; }
;
led4: led_4
{ gpios = < &gpio1 0x04 0x1 >; label = "Green LED 4"; }
;
};
aliases
{ led0 = &led0; led1 = &led1; led2 = &led2; led3 = &led3; led4 = &led4; pwm-led0 = &pwm_led0; sw0 = &button0; sw1 = &button1; sw2 = &button2; sw3 = &button3; bootloader-led0 = &led0; }
;
};
Devicetree overlay of MCUBoot:
/ {
chosen {
zephyr,code-partition = &boot_partition;
};
};
&uart0
{ tx-pin = < 0x1c >; rx-pin = < 0x1a >; rts-pin = < 0x1e >; cts-pin = < 0x1f >; }
;
&uart1
{ status = "okay"; current-speed = < 0x1c200 >; tx-pin = < 0x22 >; rx-pin = < 0x0d >; }
;
&i2c1
{ sda-pin = < 0x16 >; scl-pin = < 0x17 >; status = "disabled"; }
;
&pwm0
{ ch0-pin = < 0x10 >; }
;
&qspi
{ io-pins = < 0xf >; status = "disabled"; }
;
&{/} {
leds {
compatible = "gpio-leds";
led0: led_0
{ gpios = < &gpio0 0x13 0x1 >; label = "Green LED 0"; }
;
led1: led_1
{ gpios = < &gpio0 0x15 0x1 >; label = "Green LED 1"; }
;
led2: led_2
{ gpios = < &gpio1 0x08 0x1 >; label = "Green LED 2"; }
;
led3: led_3
{ gpios = < &gpio1 0x06 0x1 >; label = "Green LED 3"; }
;
led4: led_4
{ gpios = < &gpio1 0x04 0x1 >; label = "Green LED 4"; }
;
};
aliases
{ led0 = &led0; led1 = &led1; led2 = &led2; led3 = &led3; led4 = &led4; pwm-led0 = &pwm_led0; sw0 = &button0; sw1 = &button1; sw2 = &button2; sw3 = &button3; bootloader-led0 = &led0; }
;
};