[LPC55S69] Zephyr MCUboot for Device Firmware Update Over UART Not Working with MCUmgr on LPC55S69

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[LPC55S69] Zephyr MCUboot for Device Firmware Update Over UART Not Working with MCUmgr on LPC55S69

37件の閲覧回数
ZQ2
Fresh Out Contributor

Hi, I've been trying to get Zephyr's MCUboot to work on the LPC55XpressoS69 using core 0. I am running the simple Blinky sample application in Zephyr. 

Running the application just fine without any errors.

However, I've been trying to send a device firmware update (DFU) over UART using mcumgr and for some reason I can't even establish a connection between mcumgr and my device. I keep getting a "NMP timeout."

For context, my directory structure looks like the following:

|
__boards

                |__ lpcxpresso55s69_lpc55s69_cpu0.overlay
__ src
               |__main.c
__sysbuild
              |__mcuboot.conf

               __mcuboot.overlay
__prj.conf

__sysbuild.conf

 

My prj.conf looks as follows:

 
# Enable MCUMGR subsystem and OS/Image management commands
CONFIG_MCUMGR=y
CONFIG_MCUMGR_GRP_OS=y
CONFIG_MCUMGR_GRP_IMG=y

# DIRECT SMP over UART
CONFIG_MCUMGR_TRANSPORT_UART=y
CONFIG_MCUMGR_TRANSPORT_SHELL=n

# Dedicate flexcomm0 to SMP — nothing else on the UART
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_LOG=n
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# Required for SMP UART processing thread
CONFIG_NET_BUF=y
CONFIG_ZCBOR=y
CONFIG_BASE64=y

# Required subsystems for DFU
CONFIG_FLASH=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUBOOT_IMG_MANAGER=y

# Dependencies for System/Reboot management via DFU
CONFIG_REBOOT=y



My sysbuild.conf is as follows:

 
SB_CONFIG_BOOTLOADER_MCUBOOT=y
SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y

My mcuboot.conf looks like 

 
CONFIG_LOG=y
CONFIG_MCUBOOT_LOG_LEVEL_INF=y

CONFIG_MCUBOOT_SERIAL=y
CONFIG_BOOT_SERIAL_UART=y

CONFIG_UART_CONSOLE=n
 
My mcuboot.overlay looks like
/* Step 3.4 - Configure button and LED for Serial Recovery */

// zephyr,console = &flexcomm0;
// zephyr,uart-mcumgr = &flexcomm0;

/ {
	chosen {
		zephyr,code-partition = &boot_partition;
        zephyr,uart-mcumgr = &flexcomm0;
		zephyr,shell-uart = &flexcomm0;
	};
};

&flexcomm0 {
	status = "okay";
};



/ {
  aliases {
		mcuboot-button0 = &user_button_3;
		mcuboot-led0 = &blue_led;
  };
};

&gpio0 {
    status = "okay";
};

&gpio1 {
    status = "okay";
};

&blue_led {
    status = "okay";
};

/* Enlarge boot partition to 64KB to fit MCUboot with serial recovery */
&boot_partition {
    reg = <0x00000000 DT_SIZE_K(64)>;
};

&slot0_partition {
    reg = <0x00010000 DT_SIZE_K(160)>;
};

&slot1_partition {
    reg = <0x00038000 DT_SIZE_K(160)>;
};

&storage_partition {
    reg = <0x00060000 DT_SIZE_K(50)>;
};


And finally my lpcxpresso55s69_lpc55s69_cpu0.overlay looks like

/ {
	chosen {
		zephyr,code-partition = &slot0_partition;
		zephyr,mgmt-smp = &flexcomm0;
		zephyr,uart-mcumgr = &flexcomm0;

    };
};


&flexcomm0 {
	status = "okay";
};


/* Enlarge boot partition to 64KB to fit MCUboot with serial recovery */
&boot_partition {
    reg = <0x00000000 DT_SIZE_K(64)>;
};

&slot0_partition {
    reg = <0x00010000 DT_SIZE_K(160)>;
};

&slot1_partition {
    reg = <0x00038000 DT_SIZE_K(160)>;
};

&storage_partition {
    reg = <0x00060000 DT_SIZE_K(50)>;
};


When I run the following MCUmgr command, I get back an NMP timeout, as seen below:

> mcumgr --conntype serial --connstring "dev=COM11,baud=115200" echo "test"
Error: NMP timeout

 

So the mcumgr definitely realizes that the port is available (it would deny access otherwise), but it keeps getting timed out.

I'm pretty sure this is a config option error. I've tried changing the config options numerous times but nothing quite seems to do the trick. I'm also pretty sure I'm missing some config option somewhere which is crucial for this to work. 

I've looked through about as many application notes and user manuals out there as I can. None of them seem to help for my particular case: DFU using Zephyr MCUboot on an LPC55Sxx chip running a Zephyr application.

Any help would is appreciated, though it may be best if someone tried it out on their board e.g. LPCXpresso55S69 and confirm they can carry out a UART DFU with any simple program.

LPC55S6x LPC55S69-EVK 

ラベル(1)
0 件の賞賛
返信
1 返信

5件の閲覧回数
Harry_Zhang
NXP Employee
NXP Employee

Hi @ZQ2 

Since mcumgr echo is already returning NMP timeout, I think you can  verify the MCUmgr UART communication before debugging the MCUboot DFU flow.

You can  confirm the following:

flexcomm0 is the UART connected to COM11 on the LPCXpresso55S69 board.
The application is running normally (not staying in MCUboot serial recovery mode).
No console, shell, or log output is sharing the same UART used by MCUmgr.

As a quick validation, I would recommend starting from Zephyr's smp_svr sample
and verifying that the following command works first:
mcumgr --conntype serial --connstring "dev=COM11,baud=115200" echo "test"

BR

Harry

0 件の賞賛
返信