Difference between revisions of "RockpiE/dev/usb-mass-storage"
(→Attention) |
(→Attention) |
||
Line 80: | Line 80: | ||
$ ls /mnt | $ ls /mnt | ||
a.c | a.c | ||
− | It just have one file a.c, | + | It just have one file a.c, now you should remount to update it. |
$ sudo umount /mnt | $ sudo umount /mnt | ||
$ sudo mount /dev/sdd /mnt | $ sudo mount /dev/sdd /mnt |
Latest revision as of 06:15, 24 September 2021
ROCK Pi E > Development > USB Mass Storage
Contents
Description
This guide describes how to setup USB Mass Storage OTG on ROCK Pi E.
Requirement
- ROCK Pi E mainboard
- eMMC module
- Power adapter
- USB Male A to Dupont cable.
- One port is Male A type and the other includes three Dupont lines.
- Hardware connection
ROCK Pi E 40-pin Header | USB Interface | USB Male A to Dupont Cable |
---|---|---|
PIN#18 | Data+ | Green wire |
PIN#16 | Data- | White wire |
PIN#14 | GND | Black wire |
Support
Support hardware platform:
- ROCK Pi E V1.1 or later
You'd better follow the installation steps.
Operations on ROCK Pi E
For example, my testing borad is Rock pi E V1.2 on Debian buster, Linux rockpie 4.4.194-19-rockchip-g287ff75afc47
You can use ssh or serial console to access ROCK Pi E.
Step 1: Add the following line to file /boot/uEnv.txt.
overlays=rk3328-uart2 rk3328-usb-otg
Step 2: Update rockchip-overlay, kernel, rockchip-adbd kernel packages.
$ sudo apt-get install -y rockchip-overlay $ sudo apt-get install -y linux-4.4-rock-pi-e-latest
Step 3: Reboot the device.
$ sudo reboot
Step 4: Create a file to be a shared space and make it FAT32 type.
$ sudo dd if=/dev/zero of=/home/rock/share bs=1M count=512 status=progress $ sudo apt-get install dosfstools $ sudo mkfs.fat /home/rock/share -F 32 -I
Step 5: Enable usb mass storage with the file
$ sudo modprobe g_mass_storage file=/home/rock/share stall=0 removable=1 $ sudo mount /home/rock/share /mnt/ $ sudo touch /mnt/a.c $ ls /mnt a.c
Operations on PC
Now, you can see the new partition /dev/sdx is mounted.
$ lsblk ...... sdd 8:48 1 512M 0 disk /mnt $ ls /mnt a.c
Attention
When add files to this shared space, the other side needs to be unmounted and remounted the shared space. For example:
On Rock Pi E:
Create a new file to it.
$ sudo touch /mnt/b.c $ ls /mnt a.c b.c
On PC:
$ ls /mnt a.c
It just have one file a.c, now you should remount to update it.
$ sudo umount /mnt $ sudo mount /dev/sdd /mnt $ ls /mnt a.c b.c
Troubleshooting
- If you have issue with USB Mass Storage OTG, start a new post on the forum. https://forum.radxa.com/c/rockpie