This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Uploading files using the filesystem module with MCUMGR

I'm trying to upload image asset binary files onto a custom hw that uses the nrf52833 mcu. I use mcumgr for performing DFUs and I would like to use it to upload the binary files which is outlined here:

docs.zephyrproject.org/.../mcumgr.html

Unfortunately when I try to perform a upload I get back an error code 8 which according to the MCUMGR sdk file mgmt.h signifies that the operation i attempted is not supported. What do I need to configure to make uploading files via MCUMGR possible? I uploaded my conf files, let me know if you have any questions.

 release_devzone.confprj_devzone.conf

  • Hi

    I were able to upload a file to the nRF52833DK using the zephyr SMP server sample.

    To flash I did:

    west build -p -b nrf52833dk_nrf52833 -- -DOVERLAY_CONFIG='overlay-bt.conf'

    And then I used a laptop with Bluetooth and mcumgr to do:

    mcumgr --conntype ble --connstring peer_name="device123" fs upload send.txt /lfs1/tmp.txt
    mcumgr --conntype ble --connstring peer_name="device123" fs download /lfs1/tmp.txt receive.txt

    Does this work for you?

    Regards,
    Sigurd Hellesvik

  • Unfortunatly I tried this using my custom board config based on the nRF52833DK and it caused a crash. I should mention that my board has the littlefs partition on a external flash that communicates via spi, which is where the crash occurs

  • GOOD-ish NEWS! After messing around with the logging kconfigs, I managed to get J-Link RTT viewer to print out all the logs, which is showing this usage fault error whenever I try to run a fs upload command. Does anyone know how or why this is caused?

    [00:00:35.650,756] <err> os: ***** USAGE FAULT *****
    [00:00:35.650,756] <err> os:   Illegal load of EXC_RETURN into PC
    [00:00:35.650,787] <err> os: r0/a1:  0x200019c4  r1/a2:  0x000000ff  r2/a3:  0x200026dc[0m
    [00:00:35.650,787] <err> os: r3/a4:  0x00000000 r12/ip:  0x2000b63c r14/lr:  0x00000000
    [00:00:35.650,787] <err> os:  xpsr:  0xfffffe00
    [00:00:35.650,817] <err> os: r4/v1:  0x2000b63c  r5/v2:  0x00000000  r6/v3:  0xffffffff
    [00:00:35.650,817] <err> os: r7/v4:  0xffffffff  r8/v5:  0x00000800  r9/v6:  0x0000000b
    [00:00:35.650,817] <err> os: r10/v7: 0x200099f4  r11/v8: 0x00000004    psp:  0x20013fc0
    [00:00:35.650,817] <err> os: EXC_RETURN: 0xfffffffd
    [00:00:35.650,848] <err> os: Faulting instruction address (r15/pc): 0xffffffff
    [00:00:35.650,878] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
    [00:00:35.650,878] <err> os: Current thread: 0x20004268 (sysworkq)
    [00:00:36.005,371] <err> os: Halting system

  • So during tuning my project's kconfig settings I found out that by increasing the value of 

    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE
    it fixed the usage fault. For anyone else that is having the same issue uploading files using mcumgr fs, try modifying this setting.

Related