Re: Sending and receiving mcumgr commands via BLE


Carles Cufi
 

+Andrzej

 

Carles

 

From: users@... <users@...> On Behalf Of Flavio Arieta
Sent: 05 October 2018 19:57
To: zephyr-users@...
Subject: [Zephyr-users] Sending and receiving mcumgr commands via BLE

 

Hi,

 

I'm trying to send an image to my board (nrf52_pca10040) using mcumgr via BLE (Zephyr v1.13.0) and encountered some problems while doing so.

 

Example followed: "samples/subsys/mgmt/mcumgr/smp_svr". The only thing that I changed was disabling CONFIG_MCUMGR_CMD_FS_MGMT and CONFIG_FILE_SYSTEM_NFFS since I am not going to use nffs fs.

 

I started doing some tests with easier commands:

Command:

sudo mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Zephyr' image list

Reply:

Images:

 slot=0

    version: 1.2.0

    bootable: true

    flags: active confirmed

    hash: 4a9fab74e71499df7dfe71c605852a5e63d794920a705e264d980f7374873166

Split status: N/A (0)

and:

Command: 

sudo mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Zephyr' reset

Result:

Board resets normally


Then I tried to both test the current image and upload a new image:

sudo mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Zephyr' image test 4a9fab74e71499df7dfe71c605852a5e63d794920a705e264d980f7374873166 -t 100

sudo mcumgr --conntype ble --connstring ctlr_name=hci0,peer_name='Zephyr' -t 90 image upload dfu-zephyr.bin

 

 

They do connect via BLE every time, but unfortunately these last 2 commands end up hanging (always 0% on the image upload).

On the upload command it even erases the flash, but don't go as further as to receive any part of the new image.

 

 

Logs from mcumgr:

 

Am I missing something? Because it seems that the communication from both are right, but some reply messages seem to never arrive to my notebook using mcumgr-cli.

 

 

Thanks,

Flávio Arieta Netto.

Join users@lists.zephyrproject.org to automatically receive all group messages.