Sending and receiving mcumgr commands via BLE


Flavio Arieta <flavioarieta@...>
 

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.


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.


Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>
 

From: Cufi, Carles
Sent: Tuesday, October 09, 2018 11:30 AM
To: Flavio Arieta <flavioarieta@...>; zephyr-users@...; Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>
Subject: RE: [Zephyr-users] Sending and receiving mcumgr commands via BLE

 

+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.


Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>
 

Great that it works for you now.

 

Andrzej

 

From: Flavio Arieta [mailto:flavioarieta@...]
Sent: Wednesday, October 10, 2018 1:41 PM
To: Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>
Subject: Re: [Zephyr-users] Sending and receiving mcumgr commands via BLE

 

Hi Andrzej, thanks for the reply.

 

That could be the cause. I tried everything over again in a new branch to avoid previous issues and it worked.

 

Sorry for my mistake and thanks for the help.

 

 

Flávio Arieta Netto.