Ymodem support for zephyr based nrf connect SDK over UART interface

Hi Team,

Problem: I'm working on a project using the nRF52840 and nRF Connect SDK 2.2.0. I need to transfer some files from host over UART and store them in LittleFS. I've successfully used MCUMgr for firmware updates via bootloader but am now trying to enable it in my application for file transfer. However, I'm facing challenges as I'm already using the same UART for other communication.

Question:

  1. YModem Support: Does nRF Connect SDK 2.2.0 support YModem for file transfer over UART? If so, could you please provide guidance or examples on how to implement it?
  2. MCUMgr for File Transfer: Is MCUMgr suitable for file transfer in my scenario? If yes, could you provide specific configurations and code snippets to enable it in my application, especially considering the shared UART usage?

Additional Information:

  • I'm using LittleFS for file storage, it was verified, i am curretly using this little fs on ext Flash for configuration storage.
  • I've successfully used MCUMgr for firmware updates via bootloader over UART, Now I am encountering issues when trying to enable MCUMgr in my application for file transfer.

I would appreciate any insights, code examples, or troubleshooting tips to help me achieve file transfer over UART using either YModem or MCUMgr from host.

Thanks,

MK V

Parents
  • ++

    Here is proj config related to mcumgr used in my configs and corresponding snippet used in application.

    # Enable mcumgr
    CONFIG_MCUMGR=y

    # Enable file system commands
    CONFIG_MCUMGR_CMD_FS_MGMT=y

    # Enable the serial mcumgr transport
    CONFIG_MCUMGR_SMP_UART=y

    # Ensure an MCUboot-compatible binary is generated
    CONFIG_BOOTLOADER_MCUBOOT=y

    # Some command handlers require a large stack
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

    # Enable flash operations
    CONFIG_FLASH=y
    CONFIG_FLASH_MAP=y

    # Enable file system
    CONFIG_FILE_SYSTEM=y
    CONFIG_FILE_SYSTEM_LITTLEFS=y


    FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(storage1);
    static struct fs_mount_t _internalfs_mnt = {
    .type = FS_LITTLEFS,
    .fs_data = &storage1,
    .storage_dev = (void *)INTERNAL_STORAGE_PARTITION_ID,
    .mnt_point = "/lfs2",
    };

    err = fs_mount(internalfs_mnt);
    if (err < 0) {
    printk("FAIL: mount id %" PRIuPTR " at %s: %d\n",
    (uintptr_t)internalfs_mnt->storage_dev, internalfs_mnt->mnt_point, err);
    }
    printk("%s mount: %d\n", internalfs_mnt->mnt_point, err);

    fs_mgmt_register_group();

    Commands used in windows host to transfer file.

    ./mcumgr --conntype serial --connstring "COM7,baud=115200" fs upload myfile.txt /lfs/myfile.txt

    Error: NMP timeout => response of connection failed after timed-out

    let me know, anything got diverted here.

    Thanks,
    MK V

Reply
  • ++

    Here is proj config related to mcumgr used in my configs and corresponding snippet used in application.

    # Enable mcumgr
    CONFIG_MCUMGR=y

    # Enable file system commands
    CONFIG_MCUMGR_CMD_FS_MGMT=y

    # Enable the serial mcumgr transport
    CONFIG_MCUMGR_SMP_UART=y

    # Ensure an MCUboot-compatible binary is generated
    CONFIG_BOOTLOADER_MCUBOOT=y

    # Some command handlers require a large stack
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

    # Enable flash operations
    CONFIG_FLASH=y
    CONFIG_FLASH_MAP=y

    # Enable file system
    CONFIG_FILE_SYSTEM=y
    CONFIG_FILE_SYSTEM_LITTLEFS=y


    FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(storage1);
    static struct fs_mount_t _internalfs_mnt = {
    .type = FS_LITTLEFS,
    .fs_data = &storage1,
    .storage_dev = (void *)INTERNAL_STORAGE_PARTITION_ID,
    .mnt_point = "/lfs2",
    };

    err = fs_mount(internalfs_mnt);
    if (err < 0) {
    printk("FAIL: mount id %" PRIuPTR " at %s: %d\n",
    (uintptr_t)internalfs_mnt->storage_dev, internalfs_mnt->mnt_point, err);
    }
    printk("%s mount: %d\n", internalfs_mnt->mnt_point, err);

    fs_mgmt_register_group();

    Commands used in windows host to transfer file.

    ./mcumgr --conntype serial --connstring "COM7,baud=115200" fs upload myfile.txt /lfs/myfile.txt

    Error: NMP timeout => response of connection failed after timed-out

    let me know, anything got diverted here.

    Thanks,
    MK V

Children
No Data
Related