This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MCUBOOT slow with nRF52840 / Zephyr / USB CDC_ACM protocol

I have MCUBOOT compiled under Zephyr 3.0 working fine with my 52840 based project.  The transport is the CDC ACM "UART" using CONFIG_MCUBOOT_SERIAL

Using mcumgr.exe to load the application from Windows, it was taking 4 1/2 minutes to load/program a 220K app.  That is less than 1KB/sec.  

I was able to do a significant speedup by changing the mtu. This involved changing the config line CONFIG_BOOT_MAX_LINE_INPUT_LEN=4096 and modifying the following in boot_serial.c

That allowed me to change the mtu on the mcumgr as the following

mcumgr --conntype serial --connstring dev=COM4,mtu=4096 image upload signed-app.bin

It is now 1 1/2 minutes, which is still only 2.7KB/sec.  Any ideas on what could be keeping it still so slow?   

Prj.cnf is below

Parents
  • FIXED! I fixed this today.  The problem was in the mcumgr go software where it was throttling comms in Tx function in serial_xport.go  found in go\pkg\mod\mynewt.apache.org\newtmgr@v0.0.0-20201028150837-60b2da78788c\nmxact\nmserial\


    It was both doing a 20msec sleep for "slower platforms" with small buffers and restricting the real MTU to 128 bytes (even though the outer MTU was set to 4096. These are probably good for "real" UART and slower boards. With a USB virtual UART with Mbps speeds it is irrelevant.

    Once I rebuilt mcumgr it smoked. ~10 seconds instead of 1.5 minutes (or 6 before the other changes I showed in my first post). 

Reply
  • FIXED! I fixed this today.  The problem was in the mcumgr go software where it was throttling comms in Tx function in serial_xport.go  found in go\pkg\mod\mynewt.apache.org\newtmgr@v0.0.0-20201028150837-60b2da78788c\nmxact\nmserial\


    It was both doing a 20msec sleep for "slower platforms" with small buffers and restricting the real MTU to 128 bytes (even though the outer MTU was set to 4096. These are probably good for "real" UART and slower boards. With a USB virtual UART with Mbps speeds it is irrelevant.

    Once I rebuilt mcumgr it smoked. ~10 seconds instead of 1.5 minutes (or 6 before the other changes I showed in my first post). 

Children
No Data