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

Increased line-length / MTU results in hang #8

Open
mfikes opened this issue May 31, 2023 · 6 comments
Open

Increased line-length / MTU results in hang #8

mfikes opened this issue May 31, 2023 · 6 comments

Comments

@mfikes
Copy link
Contributor

mfikes commented May 31, 2023

For my setup with macOS 12.6.5, I get a hang if I try the -m 4096 -l 8192 increased buffer settings:

$ mcumgr-client -t 60 -m 4096 -l 8192 upload ext-flash-slot3.bin
mcumgr-client 0.0.2, Copyright © 2023 Vouch.io LLC

19:30:54 [INFO] One bootloader device found, setting device to: /dev/cu.usbmodem14301
19:30:54 [INFO] upload file: ext-flash-slot3.bin
19:30:54 [INFO] flashing to slot 3
19:30:54 [INFO] 22003712 bytes to transfer

with the above it just sits there.

$ uname -a
Darwin Mike-MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Thu Mar  9 20:08:59 PST 2023; root:xnu-8020.240.18.700.8~1/RELEASE_X86_64 x86_64
@Revival-Martijn
Copy link

For my setup with windows 11 it hangs with and without -m 4096 -l 8192

Without -m 4096 -l 8192 :

09:32:07 [INFO] flashing to slot 1
09:32:07 [INFO] 303136 bytes to transfer
09:32:07 [DEBUG] (1) mcumgr_client::image: try_length: 512
09:32:07 [DEBUG] (1) mcumgr_client::image: req: ImageUploadReq { data: [61, 184, 243, 150, 0, 0, 0, 0, 0, 2, 0, 0, 136, 157, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], image_num: 1, len: Some(303136), off: 0, data_sha: Some([54, 16, 163, 143, 3, 56, 111, 77, 147, 184, 242, 37, 138, 159, 62, 136, 48, 142, 161, 250, 119, 4, 145, 106, 12, 155, 54, 23, 177, 175, 200, 37]), upgrade: None }
09:32:07 [DEBUG] (1) mcumgr_client::transfer: request header: NmpHdr { op: Write, flags: 0, len: 580, group: Image, seq: 82, id: 1 }
09:32:07 [DEBUG] (1) mcumgr_client::transfer: serialized: 0200024400015201a564646174615902003db8f3960000000000020000889d040000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff65696d61676501636c656e1a0004a020636f6666006373686158203610a38f03386f4d93b8f2258a9f3e88308ea1fa7704916a0c9b3617b1afc825
09:32:07 [DEBUG] (1) mcumgr_client::transfer: encoded with packet length and checksum: 024e0200024400015201a564646174615902003db8f3960000000000020000889d040000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff65696d61676501636c656e1a0004a020636f6666006373686158203610a38f03386f4d93b8f2258a9f3e88308ea1fa7704916a0c9b3617b1afc82578e7
09:32:07 [DEBUG] (1) mcumgr_client::transfer: encoded: Ak4CAAJEAAFSAaVkZGF0YVkCAD2485YAAAAAAAIAAIidBAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ZWltYWdlAWNsZW4aAASgIGNvZmYAY3NoYVggNhCjjwM4b02TuPIlip8+iDCOofp3BJFqDJs2F7GvyCV45w==
09:32:07 [DEBUG] (1) mcumgr_client::image: new try_length: 284
09:32:07 [DEBUG] (1) mcumgr_client::image: req: ImageUploadReq { data: [61, 184, 243, 150, 0, 0, 0, 0, 0, 2, 0, 0, 136, 157, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], image_num: 1, len: Some(303136), off: 0, data_sha: Some([54, 16, 163, 143, 3, 56, 111, 77, 147, 184, 242, 37, 138, 159, 62, 136, 48, 142, 161, 250, 119, 4, 145, 106, 12, 155, 54, 23, 177, 175, 200, 37]), upgrade: None }
09:32:07 [DEBUG] (1) mcumgr_client::transfer: request header: NmpHdr { op: Write, flags: 0, len: 352, group: Image, seq: 82, id: 1 }
09:32:07 [DEBUG] (1) mcumgr_client::transfer: serialized: 0200016000015201a5646461746159011c3db8f3960000000000020000889d040000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff65696d61676501636c656e1a0004a020636f6666006373686158203610a38f03386f4d93b8f2258a9f3e88308ea1fa7704916a0c9b3617b1afc825
09:32:07 [DEBUG] (1) mcumgr_client::transfer: encoded with packet length and checksum: 016a0200016000015201a5646461746159011c3db8f3960000000000020000889d040000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff65696d61676501636c656e1a0004a020636f6666006373686158203610a38f03386f4d93b8f2258a9f3e88308ea1fa7704916a0c9b3617b1afc8256b69
09:32:07 [DEBUG] (1) mcumgr_client::transfer: encoded: AWoCAAFgAAFSAaVkZGF0YVkBHD2485YAAAAAAAIAAIidBAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ZWltYWdlAWNsZW4aAASgIGNvZmYAY3NoYVggNhCjjwM4b02TuPIlip8+iDCOofp3BJFqDJs2F7GvyCVraQ==

@Frank-Buss
Copy link
Contributor

@Revival-Martijn This might be related to the CDC-ACM bug I noted here: https://github.com/vouch-opensource/mcumgr-client#notes but should be only a problem in combination with STM32, maybe a mcumgr-client problem. Does it fix it, if you change CDC_ACM_BUFFER_SIZE in cdc_acm.c?
If not, I have a nRF52840-DK here and can try to reproduce it. Can you share your project, or do you have a sample project with mcuboot where you see this problem?

@Revival-Martijn
Copy link

Revival-Martijn commented Jun 27, 2023

@Frank-Buss
I've tried modifying the cdc.acm.c. Unfortunately this didn't help.

I've created a test project for you which you should be able to build and run straight away.
https://github.com/Revival-Martijn/MCUmgr_test
I've used nRF Connect SDK 2.3.0 with Visual Studio Code
I'm using nrf52840dk_nrf52840 development board.
Please check that the overlay (nrf52840dk_nrf52840.overlay) is used after you've build it.

You have to connect to the comport that appears when you connect the microusb port nRF USB

I can flash an image with the GO version of mcumgr.

After using PR #10 I can use mcumgr-client.exe -d COM8 list

But mcumgr-client.exe -d COM8 upload app_update.bin hangs again after one or several kib/s

Hope you can take a look at this.
I've you have problems getting it to build, let me know.

@Revival-Martijn
Copy link

Revival-Martijn commented Sep 5, 2023

Any news on this? :)

@Frank-Buss
Copy link
Contributor

@Revival-Martijn could you check if the new PR fixes it? Not merged so far, so checkout this fork: https://github.com/comap-smart-home/mcumgr-client/tree/main

@Frank-Buss
Copy link
Contributor

@Revival-Martijn I think this PR #25 could have fixed it. I created a new release, could you check it?

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

3 participants