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
  • Hi llly,

    The error seems to be because the command line cannot find foo.txt on your system rather than a problem with the device.

    I am not sure where mcumgr expect foo.txt to be without any path, but can you try using an absolute path? Also avoid using any non-ASCII character in the path. Preferably only use alphanumeric character and maybe underscore "_".

    Hieu

  • Hi Hieu

    Can you help me check this question when you have time?

  • Hi llly,

    Sorry for the long absence. I have not forgot your question here, but I still haven't figured it out yet.

    I will try to keep you regularly updated.

  • Hi Hieu

    It's okay, but I want to know if your mcumgr is also in the same situation? Or can you read and write normally on your end? If you haven't encountered this problem, could it be a problem with my driver or something else?

  • 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.

Reply
  • 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.

Children
Related