Write a file to littlefs using mcumgr and return The system cannot find the path specified

I tried to use mcumgr to write and read files to the littlefs of 9160. According to the instructions, I will enter mcumgr conn add acm0 type="serial" connstring="dev=/dev/ttyACM0,baud=115200,mtu=512" first, then enter mcumgr -c acm0 fs upload foo.txt /lfs/foo.txt, will get this error

I have also set CONFIG_MCUMGR_GRP_FS to y

How should I solve this problem?

Parents Reply Children
  • Hi llly,

    My results have been different, but things are still not working in either cases.

    PS C:\_w\c\c329113_littlefs_mcuboot\mcuboot_smp_uart> mcumgr -c com14 fs download /lfs/pattern.bin a2.bin
    Error: 5
    PS C:\_w\c\c329113_littlefs_mcuboot\mcuboot_smp_uart> mcumgr -c com14 fs upload hi.txt /lfs/hi.txt
    0
    Error: 5

    Assuming this is error from mcumgr, error 5 is MGMT_ERR_ENOENT, which is also no such file.

    This was going to resemble your initial issue somewhat. However, if I understand you correctly, you had some issue with your mcumgr connstring; and after fixing that, you get NMP Timeout errors instead. Is that right?

    That would make sense because after looking closely at your second screenshot, the stat commands are also failing with the same "cannot find the path specified" error. This means it is unlikely that the device's file system is the root cause.

    I am now also at the same point. A few stack and heap config changes get me to:

    CONFIG_HEAP_MEM_POOL_SIZE=4096
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192

    C:\_w\c\c329113_littlefs_mcuboot\mcuboot_smp_uart>mcumgr -c com14 fs upload ./hi.txt /lfs/hi.txt
    Error: NMP timeout
    
    C:\_w\c\c329113_littlefs_mcuboot\mcuboot_smp_uart>mcumgr -c com14 fs download /lfs/pattern.bin abc.bin
    Error: NMP timeout
    
    C:\_w\c\c329113_littlefs_mcuboot\mcuboot_smp_uart>mcumgr -c com14 fs download /lfs/pattern.bin abc.bin -t 300
    Error: NMP timeout

    (I switched from Windows PowerShell to Windows CMD in the second log there, but that should not be an issue.)

    I have been looking into the mcumgr Golang CLI too but haven't fully figured out what is going on yet. It would be very helpful if I can add logging as if it is a Python script, but it doesn't seem to be the same here. 

    I will try a few things more and pull in some help.

  • Hi Hieu

    Yes, the problem I am currently facing is NMP timeout, which looks the same as yours.

    Thank you for your efforts. I will continue to wait for your good news.

  • Hi llly,

    I return with mixed good-bad news.

    After thinking about my test results, I realized that my NMP timeout state is a worse state than my initial "Error 5" state.

    The reason is because in this the NMP timeout error state, I cannot even run image list, while in the "Error 5" state, I can run image list.

    However, I still cannot figure out why the fs commands don't work. 

    As for restarting from a fresh start, I tried using the File system shell but it would not work at all, NMP Timeout no matter what I tried...

    Unfortunately, I will now have to be out of office for a few weeks and cannot further investigate either of the issues. I will leave some notes now, and one of my colleagues will further support you.

    For the record, I reached the "Error 5" state by doing the following:

    From my other tests, I would expect that starting with the littlefs sample and then adding MCUmgr with the FS commands would yield the same results.

    Attached is my project. 
    The "Error 5" state can be reproduce with building by default, or with heap_stack_size.conf overlay.
    The "NMP Timeout" state cane be reproduced with building with the fs_shell.conf overlay.

    mcumgr_fs_tests_240716_01.zip

    P.s: I also see that I uploaded the wrong log for this "Error 5" state last time, so I have reproduced it and updated my last reply.

  • Hi Hieu

    Thank you for testing. I was able to reproduce error 5 using your project, but it still did not succeed.

Related