U-Boot UMS on APF & OPOS

From ArmadeusWiki
Revision as of 19:09, 17 July 2015 by JulienB (Talk | contribs) (New page: Infos for U-Boot's USB Mass Storage gadget mode (or UMS) usage on APF6. * First branch a second usb cable on otg APF6_Dev port. And keep your usb debug cable. (then you need 2 usb-cable)...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Infos for U-Boot's USB Mass Storage gadget mode (or UMS) usage on APF6.

  • First branch a second usb cable on otg APF6_Dev port. And keep your usb debug cable. (then you need 2 usb-cable).
  • Under uboot type :
BIOS> ums 0 mmc 0
UMS: disk start sector: 0x0, count: 0x760000
|
  • On your host computer you should see the eMMC partition like a standard USB key.
$ dmesg
[...]
[26828.348088] sd 13:0:0:0: [sdc] Mode Sense: 0f 00 00 00
[26828.348395] sd 13:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[26828.354177]  sdc: sdc1 sdc2
[26828.356782] sd 13:0:0:0: [sdc] Attached SCSI disk

Here the device is /dev/sdc and all partition has been automounted by the host :

[26830.002168] EXT4-fs (sdc1): mounting ext2 file system using the ext4 subsystem
[26830.054358] EXT4-fs (sdc2): mounting ext2 file system using the ext4 subsystem
[26830.078638] EXT4-fs (sdc2): warning: mounting unchecked fs, running e2fsck is recommended
[26830.114382] EXT4-fs (sdc2): mounted filesystem without journal. Opts: (null)
[26830.135564] EXT4-fs (sdc1): warning: mounting unchecked fs, running e2fsck is recommended
[26830.268450] EXT4-fs (sdc1): mounted filesystem without journal. Opts: (null)
Warning Warning: Before doing the following procedure, be sure that your device name is correct. You can erase all your host datas if you do it wrong
  • The rootfs is under the sdc2 and is named "rootfs". In debian/ubunt it's mounted under /media/usb1 if no other usb keys present on system.
$ ls /media/usb1/
bin  boot  dev  etc  home  init  lib  lib32  linuxrc  lost+found  media  mnt  opt  proc  root  run  sbin  sys  tmp  usr  var
  • To flash rootfs entirelly, first erase all files on this partition :
$ sudo umount /media/usb1
$ sudo mkfs.ext4 /dev/sdc2
  • Then mount it under an arbitrary directory:
$ sudo mkdir /tmp/rootfs
$ sudo mount /dev/sdc2 /tmp/rootfs
  • Untar the archive generated by your bsp (in buildroot/output/images/)
$ cd /tmp/rootfs
$ sudo tar -xvf /usr/local/projects/armadeus/apf6/buildroot/output/images/apf6-rootfs.tar
  • then umount the filesystem:
$ sudo umount /tmp/rootfs/
$ sync
  • Once unmounted, you can kill the usb gadget uboot process with a Ctrl-C:
BIOS> ums 0 mmc 0
UMS: disk start sector: 0x0, count: 0x760000
CTRL+C - Operation aborted
BIOS>