Can't synchronize files from Windows to f_mass_storage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't synchronize files from Windows to f_mass_storage

713 Views
csoapy
Contributor III

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

pastedImage_2.png

udisk.sh

#!/bin/sh

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

menuconfig:

pastedImage_5.png

pastedImage_11.png

console log, full debug log also attached

root@imx6qsabreauto:~# ./udisk.sh
[ 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

Labels (3)
Tags (2)
0 Kudos
1 Reply

554 Views
igorpadykov
NXP Employee
NXP Employee

Hi 计龙 杨 

one can look on

Syncing folders and files between a Windows and Linux system - Super User 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos