AnsweredAssumed Answered

Can't synchronize files from Windows to f_mass_storage

Question asked by 计龙 杨 on Jul 24, 2019
Latest reply on Jul 29, 2019 by igorpadykov

Our bsp version is based on 4.14.98_2.0.1, I also tried 4.14.98_2.1.0, but still failed to synchronize files: ls command can't shows files created from Windows before rebooting board. Maybe remount should works, but shoundn't be synchronized once the file was created from Windows? I also tried refresh folder on Windows and sync from our board, but nothing happened.


Here are my settings. Is there something I missed?


Device Tree



function mount_udisk() {
    local img=/run/camel/fat.img
    local mpoint=/run/camel/udisk

    mkdir -p $mpoint
    echo "mount_udisk($1, $2) to $mpoint"
    dd if=/dev/zero of=$img bs=$2 count=1
    mkfs.vfat $img
    mount $img $mpoint

    mkdir -p /sys/kernel/config/usb_gadget/$1
    cd /sys/kernel/config/usb_gadget/$1

    echo 0x066F > idVendor
    echo 0x37FF > idProduct

    mkdir -p strings/0x409
    echo 0000000000000000 > strings/0x409/serialnumber
    echo "FSL i.MX Board" > strings/0x409/product
    mkdir -p configs/c.1
    echo 5 > configs/c.1/MaxPower

    mkdir -p functions/mass_storage.1
    # echo "" > functions/mass_storage.1/iSerialNumber
    echo 0 > functions/mass_storage.1/stall 
    echo 1 > functions/mass_storage.1/lun.0/removable
    echo $img > functions/mass_storage.1/lun.0/file
    ln -s functions/mass_storage.1 configs/c.1/

    echo $1 > UDC

    return 0

mount_udisk ci_hdrc.0 16M





console log, full debug log also attached

root@imx6qsabreauto:~# ./
[ 19.906909] Mass Storage Function, version: 2009/09/11
[ 19.912733] LUN: removable file: (no medium)
[ 20.105326] configfs-gadget gadget: high-speed config #1: c