Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NMP timeout when uploading image with mcumgr over BLE under Linux #28

Open
PhilippFinke opened this issue Jul 29, 2019 · 1 comment
Open

Comments

@PhilippFinke
Copy link

Describe the bug
Every second time I try to upload an image with mcumgr over BLE under Linux (both Fedora 30 and Yocto based on our custom board) I receive a NMP timeout and the upload aborts. After starting another upload after this timeout the upload succeeds.

The problem occurs with the smp_svr sample on a nrf52840_pca10056 board as well on our custom HW that is also based on a nrf52840. As BLE dongles I used a hama Bluetooth 4.0 USB dongle and the hci_usb sample running on a nrf52840_pca10056.

Additional information: We have a LED display and a status LED on our custom HW that strangely flickers when the NMP timeout occurs. This will last a few seconds and then everything goes back to normal operation.

To Reproduce
Steps to reproduce the behavior:

  1. Build and flash the smp_svr sample as described here.
  2. Upload the new image as described in the link above. This shouldn't give a NMP timeout.
  3. Right after 2. upload the same image again. This should give a NMP timeout.

Expected behavior
Uploading an image should work every time without a NMP timeout.

Screenshots or console output
Example output. Here I'm uploading an image for my custom HW but the problem occurs with any other too.

`root@gw-ppf:~# mcumgr --conntype ble --connstring ctlr_name=hci0,peer_id="de:e6:ba:92:2f:60" image upload pa_fw-V0.6.3.bin
166.34 KiB / 166.34 KiB [=======================================================================================================================================================================================================================] 100.00% 7.91 KiB/s 21s
Done

root@gw-ppf:~# mcumgr --conntype ble --connstring ctlr_name=hci0,peer_id="de:e6:ba:92:2f:60" image upload pa_fw-V0.6.3.bin
0 B / 166.34 KiB [---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0.00%
Error: NMP timeout

root@gw-ppf:~# mcumgr --conntype ble --connstring ctlr_name=hci0,peer_id="de:e6:ba:92:2f:60" image upload pa_fw-V0.6.3.bin
166.34 KiB / 166.34 KiB [=======================================================================================================================================================================================================================] 100.00% 7.94 KiB/s 20s
Done
`

Environment

  • OS: Linux Fedora 30 and Yocto based on custom board.
  • Toolchain: gnuarmemb
  • Zephyr v1.14.0
@AnanthJaisankar
Copy link

when you are giving upload command second time it will erase the first image then uploads second.
when flash erase is happening nrf52840 stops the other processes that's why you are getting disconnected and it says NMP timeout.
Try adding timeout 20 sec in upload command(Ex: mcumgr --conntype ble --connstring ctlr_name=hci0,peer_id="de:e6:ba:92:2f:60" image upload pa_fw-V0.6.3.bin -t 20)
Or else give erase command first then give upload command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants