Hi,
You can refer to the SMP server sample.
I use this command
west build -p -b nrf52840dk_nrf52840 zephyr/samples/subsys/mgmt/mcumgr/smp_svr -- -DOVERLAY_CONFIG='overlay-fs.conf;overlay-serial.conf' && west flash --recover
and get
Regards,
Amanda H.
Hi Amanda,
Thank you for your reply!
I could be able to run the smp server, that you cited and able to transfer small files.
My use case is to transfer 300kB of file to Filesystem, but It did not succeed. Even I tried low sized file, 108kB of file size, but it also failed with timeout.
Here
mu.txt file size is 1kB
mu108_kb.txt file size is108kB
C:\Users\MK\Downloads\serial_upgrade>mcumgr --conntype serial --connstring "COM10,baud=115200" fs upload mu.txt /lfs1/mu.txt
12
Done
C:\Users\MK\Downloads\serial_upgrade>mcumgr --conntype serial --connstring "COM10,baud=115200" fs upload mu108_kb.txt /lfs1/mu108_kb.txt
Error: NMP timeout
Any suggestion?
Thanks,
MK V
Hi Amanda,
Thank you for providing the test project.
I have incorporated some of the configuration settings from your code into my custom board's source code. Setting CONFIG_MCUMGR_BUF_SIZE=2475
resolved the UART issue for mcumgr in the application.
Now I could be able to successfully transfer my complete file to the External Flash.
However, I have noticed that transferring a 137 KB file takes approximately 1 minute and 10 seconds. Is there any potential to reduce this transfer time?
I have attempted to increase CONFIG_MCUMGR_BUF_SIZE
and utilize MTU values of 512 and 1024 as arguments for mcumgr, but these adjustments have not yielded any improvement.
I would appreciate any insights or suggestions on how to optimize this transfer process.
Thanks,
MK V
Hi,
MK_V said:Is there any potential to reduce this transfer time?
Check out this post. Maybe you can try the latest version of NCS v2.8.0.
MK_V said:I have attempted to increaseCONFIG_MCUMGR_BUF_SIZE
and utilize MTU values of 512 and 1024 as arguments for mcumgr, but these adjustments have not yielded any improvement.
I can increase CONFIG_MCUMGR_BUF_SIZE and CONFIG_MCUMGR_SMP_UART_MTU to 2475 without issue by using the following command with my test project.
west build -p -b nrf52840dk_nrf52840 zephyr/samples/subsys/mgmt/mcumgr/smp_svr -- -DOVERLAY_CONFIG='overlay-fs.conf;overlay-serial.conf' -DCONFIG_MCUMGR_BUF_SIZE=2475 -DCONFIG_MCUMGR_SMP_UART_MTU=2475 && west flash --recover
-Amanda H.
I can increase CONFIG_MCUMGR_BUF_SIZE and CONFIG_MCUMGR_SMP_UART_MTU to 2475 without issue by using the following command with my test project.
After this change, could you able to observe improvement in file transfer speed and overall upload time?
Check out this post. Maybe you can try the latest version of NCS v2.8.0.
Thanks! I will check it out!
As this post indicated mcumgr is known to be quite slow.
For now, see MCUBOOT slow with nRF52840 / Zephyr / USB CDC_ACM protocol for how to speed up mcumgr or use other alternatives than mcumgr-native-cli. See https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr.html for a list. Most of these will be faster than the old tool.
Sure, Thanks!
Sure, Thanks!