This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 disable Bootloader and SPM uart console print

I want to disable MCUBoot, SPM debug log on UART. 

CONFIG_BSD_LIBRARY=y
CONFIG_GPIO=n
CONFIG_SERIAL=y
#CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_AT_HOST_LIBRARY=n
CONFIG_TEST_RANDOM_GENERATOR=y
#CONFIG_HW_STACK_PROTECTION=y
CONFIG_REBOOT=y
CONFIG_NETWORKING=y
CONFIG_NET_BUF_USER_DATA_SIZE=1
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_RAW_MODE=y
#CONFIG_TRUSTED_EXECUTION_NONSECURE=y
CONFIG_LOG=n
CONFIG_LOG_DEFAULT_LEVEL=4

# Stacks and heaps
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_MAIN_STACK_SIZE=16384

# LTE link control
CONFIG_LTE_LINK_CONTROL=n
CONFIG_NO_OPTIMIZATIONS=y

CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=y
#CONFIG_PROVISION_CERTIFICATES=y
#CONFIG_CERTIFICATES_FILE="certificates.h"


# SPI
#CONFIG_SPI=y
#CONFIG_SPI_SLAVE=y
#CONFIG_SPI_3_NRF_SPIS=y
# 2 = slave only
#CONFIG_SPI_3_OP_MODES=2
#CONFIG_SPI_ASYNC=y

# Application Upgrade support
CONFIG_BOOTLOADER_MCUBOOT=y

# Image manager
CONFIG_IMG_MANAGER=y
CONFIG_FLASH=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y
CONFIG_DFU_TARGET=y

  • Hi! 

    To disable MCUBoot just set this config negative

    CONFIG_BOOTLOADER_MCUBOOT=n.

    To disable the output from the SPM, you could set

    CONFIG_SERIAL=n.

    Best regards,

    Heidi

  • When i set CONFIG_SERIAL=n, undefined reference to UART APIs error received.

    I am using UART0 in my application.

  • In Short, I want to disable Logs on UART0 mentioned Below:

    13:31:29.263> <0><0>þ<0>***** Booting <0>***** Booting Zephyr OS build v2.0.99-ncs1-rc1-761-g7e20180c004a *****
    13:31:29.263> [00:00:00.007,629] [0m<inf> mcuboot: Starting bootloader[0m
    13:31:29.263> [00:00:00.016,265] [0m<inf> mcuboot: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x1[0m
    13:31:29.263> [00:00:00.029,541] [0m<inf> mcuboot: Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3[0m
    13:31:29.263> [00:00:00.042,266] [0m<inf> mcuboot: Boot source: none[0m
    13:31:29.263> [00:00:00.049,560] [0m<inf> mcuboot: Swap type: none[0m
    13:31:29.762> [00:00:00.517,089] [0m<inf> mcuboot: Bootloader chainload address offset: 0xc000[0m
    13:31:29.762> [00:00:00.524,810] [0m<inf> mcuboot: Jumping to the first image slot[0m
    13:31:29.762> ***** Booting Zephyr OS build v2.0.99-ncs1-rc1-761-g7e20180c004a *****
    13:31:29.762> Flash region Domain Permissions
    13:31:29.762> 00 0x00000 0x08000 Secure rwxl
    13:31:29.762> 01 0x08000 0x10000 Secure rwxl
    13:31:29.762> 02 0x10000 0x18000 Secure rwxl
    13:31:29.762> 03 0x18000 0x20000 Non-Secure rwxl
    13:31:29.762> 04 0x20000 0x28000 Non-Secure rwxl
    13:31:29.762> 05 0x28000 0x30000 Non-Secure rwxl
    13:31:29.762> 06 0x30000 0x38000 Non-Secure rwxl
    13:31:29.762> 07 0x38000 0x40000 Non-Secure rwxl
    13:31:29.762> 08 0x40000 0x48000 Non-Secure rwxl
    13:31:29.762> 09 0x48000 0x50000 Non-Secure rwxl
    13:31:29.762> 10 0x50000 0x58000 Non-Secure rwxl
    13:31:29.762> 11 0x58000 0x60000 Non-Secure rwxl
    13:31:29.762> 12 0x60000 0x68000 Non-Secure rwxl
    13:31:29.762> 13 0x68000 0x70000 Non-Secure rwxl
    13:31:29.762> 14 0x70000 0x78000 Non-Secure rwxl
    13:31:29.762> 15 0x78000 0x80000 Non-Secure rwxl
    13:31:29.762> 16 0x80000 0x88000 Non-Secure rwxl
    13:31:29.762> 17 0x88000 0x90000 Non-Secure rwxl
    13:31:29.762> 18 0x90000 0x98000 Non-Secure rwxl
    13:31:29.762> 19 0x98000 0xa0000 Non-Secure rwxl
    13:31:29.762> 20 0xa0000 0xa8000 Non-Secure rwxl
    13:31:29.762> 21 0xa8000 0xb0000 Non-Secure rwxl
    13:31:29.762> 22 0xb0000 0xb8000 Non-Secure rwxl
    13:31:29.762> 23 0xb8000 0xc0000 Non-Secure rwxl
    13:31:29.762> 24 0xc0000 0xc8000 Non-Secure rwxl
    13:31:29.762> 25 0xc8000 0xd0000 Non-Secure rwxl
    13:31:29.762> 26 0xd0000 0xd8000 Non-Secure rwxl
    13:31:29.762> 27 0xd8000 0xe0000 Non-Secure rwxl
    13:31:29.762> 28 0xe0000 0xe8000 Non-Secure rwxl
    13:31:29.762> 29 0xe8000 0xf0000 Non-Secure rwxl
    13:31:29.762> 30 0xf0000 0xf8000 Non-Secure rwxl
    13:31:29.762> 31 0xf8000 0x100000 Non-Secure rwxl
    13:31:29.762> Non-secure callable region 0 placed in flash region 2 with size 32.
    13:31:29.762> 
    13:31:30.431> 
    13:31:30.431> SRAM region Domain Permissions
    13:31:30.431> 00 0x00000 0x02000 Secure rwxl
    13:31:30.431> 01 0x02000 0x04000 Secure rwxl
    13:31:30.431> 02 0x04000 0x06000 Secure rwxl
    13:31:30.431> 03 0x06000 0x08000 Secure rwxl
    13:31:30.431> 04 0x08000 0x0a000 Secure rwxl
    13:31:30.431> 05 0x0a000 0x0c000 Secure rwxl
    13:31:30.431> 06 0x0c000 0x0e000 Secure rwxl
    13:31:30.431> 07 0x0e000 0x10000 Secure rwxl
    13:31:30.431> 08 0x10000 0x12000 Non-Secure rwxl
    13:31:30.431> 09 0x12000 0x14000 Non-Secure rwxl
    13:31:30.431> 10 0x14000 0x16000 Non-Secure rwxl
    13:31:30.431> 11 0x16000 0x18000 Non-Secure rwxl
    13:31:30.431> 12 0x18000 0x1a000 Non-Secure rwxl
    13:31:30.431> 13 0x1a000 0x1c000 Non-Secure rwxl
    13:31:30.431> 14 0x1c000 0x1e000 Non-Secure rwxl
    13:31:30.431> 15 0x1e000 0x20000 Non-Secure rwxl
    13:31:30.431> 16 0x20000 0x22000 Non-Secure rwxl
    13:31:30.431> 17 0x22000 0x24000 Non-Secure rwxl
    13:31:30.431> 18 0x24000 0x26000 Non-Secure rwxl
    13:31:30.431> 19 0x26000 0x28000 Non-Secure rwxl
    13:31:30.431> 20 0x28000 0x2a000 Non-Secure rwxl
    13:31:30.431> 21 0x2a000 0x2c000 Non-Secure rwxl
    13:31:30.431> 22 0x2c000 0x2e000 Non-Secure rwxl
    13:31:30.431> 23 0x2e000 0x30000 Non-Secure rwxl
    13:31:30.431> 24 0x30000 0x32000 Non-Secure rwxl
    13:31:30.431> 25 0x32000 0x34000 Non-Secure rwxl
    13:31:30.431> 26 0x34000 0x36000 Non-Secure rwxl
    13:31:30.431> 27 0x36000 0x38000 Non-Secure rwxl
    13:31:30.431> 28 0x38000 0x3a000 Non-Secure rwxl
    13:31:30.431> 29 0x3a000 0x3c000 Non-Secure rwxl
    13:31:30.431> 30 0x3c000 0x3e000 Non-Secure rwxl
    13:31:30.431> 31 0x3e000 0x40000 Non-Secure rwxl
    13:31:30.431> 
    13:31:30.431> Peripheral Domain Status
    13:31:30.431> 00 NRF_P0 Non-Secure OK
    13:31:30.431> 01 NRF_CLOCK Non-Secure OK
    13:31:30.431> 02 NRF_RTC1 Non-Secure OK
    13:31:30.431> 03 NRF_NVMC Non-Secure OK
    13:31:30.431> 04 NRF_UARTE1 Non-Secure OK
    13:31:30.431> 05 NRF_UARTE2 Secure SKIP
    13:31:30.431> 06 NRF_TWIM2 Non-Secure OK
    13:31:30.431> 07 NRF_SPIM3 Non-Secure OK
    13:31:30.431> 08 NRF_TIMER0 Non-Secure OK
    13:31:30.431> 09 NRF_TIMER1 Non-Secure OK
    13:31:30.431> 10 NRF_TIMER2 Non-Secure OK
    13:31:30.431> 11 NRF_SAADC Non-Secure OK
    13:31:30.431> 12 NRF_PWM0 Non-Secure OK
    13:31:30.431> 13 NRF_PWM1 Non-Secure OK
    13:31:30.431> 14 NRF_PWM2 Non-Secure OK
    13:31:30.431> 15 NRF_PWM3 Non-Secure OK
    13:31:30.431> 16 NRF_WDT Secure SKIP
    13:31:30.431> 17 NRF_IPC Non-Secure OK
    13:31:30.431> 18 NRF_VMC Non-Secure OK
    13:31:30.431> 19 NRF_FPU Non-Secure OK
    13:31:30.431> 20 NRF_EGU1 Non-Secure OK
    13:31:30.431> 21 NRF_EGU2 Non-Secure OK
    13:31:30.431> 22 NRF_DPPIC Non-Secure OK
    13:31:30.431> 23 NRF_GPIOTE1 Non-Secure OK
    13:31:30.431> 24 NRF_REGULATORS Secure SKIP
    13:31:30.431> 
    13:31:30.431> SPM: NS image at 0x18200
    13:31:30.431> SPM: NS MSP at 0x2002e220
    13:31:30.431> SPM: NS reset vector at 0x1db71
    13:31:30.431> SPM: prepare to jump to Non-Secure image.
    13:31:31.704> ***** Booting Zephyr OS build v2.0.99-ncs1-rc1-761-g7e20180c004a *****

  • Hi!

    Add this to your CMakeLists.txt file:

    set(spm_CONF_FILE
        prj.conf
        $(CMAKE_CURRENT_LIST_DIR)/spm.conf
        )

    and create a file called spm.conf in the same location as prj.conf that holds 

    CONFIG_SERIAL=n

  • will it disable MCUBoot Bootloader Logs printed on UART as well? 

Related