MCUBoot not outputting via UART on boot

Hi everyone.

I am using nRF Connect SDK v1.6.1 (it's an old project) on a custom board with a nRF5340 on it.

The firmware is based on the central_bas sample project with some added files from our side.

I want to add MCUBoot as a first stage bootloader to the project.

Adding it in the prj.conf file and building shows the correct flash layout where MCUBoot sits at 0x0 and my application starts at 0xc000.

Upon booting the board and listening on pins connected to UART_0 of the nRF5340 I get the usual boot output from the central_bas project, but not from MCUBoot.

*** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***

I: 2 Sectors of 4096 bytes

I: alloc wra: 0, fd8

I: data wra: 0, 1c

I: HW Platform: Nordic Semiconductor (0x0002)

I: HW Variant: nRF53x (0x0003)

I: Firmware: Standard Bluetooth controller (0x00) Version 239.2307 Build 3063314844

W: ECC HCI commands not available

I: No ID address. App must call settings_load()

Bluetooth initialized

I: Identity: F4:0F:80:D0:C0:B3 (random)

I: HCI: version 5.2 (0x0b) revision 0x222b, manufacturer 0x0059

I: LMP: version 5.2 (0x0b) subver 0x222b

Scanning successfully started

...

Normally I would expect MCUBoot to print something like this before the other output:

*** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***

I: Starting bootloader

I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3

I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3

I: Boot source: none

I: Swap type: none

I: Bootloader chainload address offset: 0xc000

I: Jumping to the first image slot

But this simply does not show.

I was able to reproduce this on a nRF5340DK board by adding "CONFIG_SERIAL=n" to the prj.conf of MCUBoot. However, this config line is not present in my main project where the MCUBoot output is not shown. Therefore I'm really not sure what could prevent MCUBoot from printing its startup output.

Are there other options that prevent MCUBoot from printing or something?

Best regards,

Alex

prj.conf of the main project:

#
# 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

CONFIG_BOOTLOADER_MCUBOOT=y

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

devicetree overlay (nrf5340dk_nrf5340_cpuapp.overlay) for our board:

&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;    }

;

};

Related