The phyCORE-AM57x Development Kit brings out SATA mass storage device connectivity to the Molex data connector at X11 and the power connector at X12. This guide will walk you through the basic usage of this interface.

Requirements 

Item Item Numbers (Description)

SATA Power Cable

Image result for sata cable

SATA 22pin Serial ATA Data and Power Combo Cable

Hard Drive

Image result for sata hard

Connecting Hard Drive and SATA Cable

Image result for sata hard

Connecting Peripherals

  • Ensure that your phyCORE-AM57x development kit is turned off and the power supply has been disconnected.
  • Connect your SATA Mass Storage device to the connectors X11 and X12.
  • Reconnect the power supply and boot into Linux.
  • Check that your SATA storage device was configured correctly:  

    Target (Linux)

    dmesg | grep -i "scsi"
    CODE

    Expected Output

    root@am57xx-phycore-kit:~# dmesg | grep -i "scsi"
    [    0.427256] SCSI subsystem initialized
    [    6.035046] scsi host0: ahci
    [    6.663644] scsi 0:0:0:0: Direct-Access     ATA      ADATA SX900      1    PQ: 0 ANSI: 5
    [    6.729211] sd 0:0:0:0: [sda] Attached SCSI disk
    CODE

Testing SATA

  • Create a random file and copy it to the SATA drive. Notice in the above example output that the SATA drive was automatically mounted to the device sda. Make note of the device your drive was assigned to as you will need to specify this correctly in the following steps by replacing <x> (from the example above, since the SATA drive was attached to the device sda we would replace the the <x> in the following command with 'a'). 

    Target (Linux)

    dd if=/dev/urandom of=/home/root/test.dat bs=1M count=2
    cp /home/root/test.dat /run/media/sd<x>1/test_w.dat
    CODE
  • Copy the file back from the SATA drive to the root filesystem on the SD card. 

    Target (Linux)

    cp /run/media/sd<x>1/test_w.dat /home/root/test_r.dat
    CODE
  • Now lets check all the files to ensure they all match: 

    Target (Linux)

    md5sum /home/root/test.dat && md5sum /run/media/sd<x>1/test_w.dat && md5sum /home/root/test_r.dat
    CODE

    The above command will generate 3 hashes that uniquely identify each file. They should all be exactly the same.

  • Now remove the files we generated: 

    Target (Linux)

    rm /home/root/test.dat && rm /run/media/sd<x>1/test_w.dat && rm /home/root/test_r.dat
    CODE