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

ncs1.6.0 ota problem b0 or (immutable MCUboot)

Hello 

I want to test ncs ota function. b0 module following this link.

ncs1.6.0 

borad:nrf52840dk_nrf52840

projece: ncs/zephyr/samples/hello_world

1. b0 + spm test.

prj.conf

# nothing here
CONFIG_SECURE_BOOT=y

CONFIG_MCUMGR=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_MCUMGR_CMD_IMG_MGMT=y

CONFIG_MCUMGR_SMP_BT=y
CONFIG_MCUMGR_SMP_BT_AUTHEN=n

copy ncs/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c to  ncs/zephyr/samples/hello_world/src

copy ncs/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/src/common.h to  ncs/zephyr/samples/hello_world/src

Change CMakeLists.txt

# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)

target_sources(app PRIVATE src/main.c)
target_sources(app PRIVATE src/bluetooth.c )
Change main.c
/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <sys/printk.h>

#include "os_mgmt/os_mgmt.h"
#include "img_mgmt/img_mgmt.h"
#include "mgmt/mcumgr/smp_bt.h"

#include "common.h"

void main(void)
{
	os_mgmt_register_group();
	img_mgmt_register_group();
	smp_bt_register();
	start_smp_bluetooth();
	printk("Hello World! %s\n", CONFIG_BOARD);
}

I can't build it without problems.

I notised that  CONFIG_BOOTLOADER_MCUBOOT=y need configed but I don't want to test MCUBoot, so I go to the next step adding MCUboot as an immutable bootloader.

2.adding MCUboot as an immutable bootloader

Change the first step prj.conf 

# nothing here
CONFIG_BOOTLOADER_MCUBOOT=y

CONFIG_MCUMGR=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_MCUMGR_CMD_IMG_MGMT=y

CONFIG_MCUMGR_SMP_BT=y
CONFIG_MCUMGR_SMP_BT_AUTHEN=n

Copy ncs/zephyr/samples/hello_world/build/zephyr/app_update.bin to android app nRF Connect,But I can't update it below is the video.

Thank you.

Parents Reply Children
No Data
Related