Red Pitaya -kehityslaudan asennus, digitaalitekniikan kurssi

Red Pitaya

Toistaiseksi suositeltu image red_pitaya_OS-stable.img.zip

(redpitaya_ubuntu_15-04-44_23-feb-2017.img 3670016000 tavua, suosituksena kuitenkin vähintään 8GB microSD-kortti).

Jatkossa oletetaan, että siihen on pääsy SSH-yhteydellä.

Tarkistetaan versiot

uname -a && cat /proc/version && cat /etc/issue

Linux rp-f0041c 4.4.0-xilinx #1 SMP PREEMPT Thu Feb 23 12:21:44 CET 2017 armv7l armv7l armv7l GNU/Linux
Linux version 4.4.0-xilinx (jenkins@dragon) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #1 SMP PREEMPT Thu Feb 23 12:21:44 CET 2017
Ubuntu 16.04.2 LTS \n \l

gcc --version

gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

Nämä tai uudemmat versiot riittävät toistaiseksi kurssilla.

FCLK -kellolinjat

PS:n generoimat oletuskellot PL:lle kyseissä distrossa, näitä tarvitaan Vivadon projektia luodessa jolloin kellot pitää asettaa samoiksi jotta se osaa laskea ajoitukset oikein:

PS_CLK_MHZ = 33.333 MHz

ARM_PLL_MHZ = 1333.333 MHz
DDR_PLL_MHZ = 1066.667 MHz
IO_PLL_MHZ = 1000.000 MHz

FPGA0_CLK = IO_PLL_MHZ / 4 / 2 = 125.000 MHz
FPGA1_CLK = IO_PLL_MHZ / 7 / 1 = 142.857 MHz
FPGA2_CLK = IO_PLL_MHZ / 6 / 1 = 166.667 MHz
FPGA3_CLK = IO_PLL_MHZ / 5 / 1 = 200.000 MHz

SD-kortti

SD-kortille ei kannata jättää mitään arvokasta vaan pitää tallessa ohjeet omista säädöistä jotta voidaan aina tarvittaessa jyrätä kokonaan uudella versiolla.

Isomman SD-kortin käyttämätön osuus ext-partitiolle, omalla vastuulla vaikka onkin testattu toimivaksi tässä esimerkissä 8GB kortilla:

sudo fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/mmcblk0: 7.4 GiB, 7909408768 bytes, 15448064 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x21bf537a

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 249855 241664 118M e W95 FAT16 (LBA)
/dev/mmcblk0p2 249856 7167999 6918144 3.3G 83 Linux

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-15448063, default 2048): 249856
Last sector, +sectors or +size{K,M,G,T,P} (249856-15448063, default 15448063):

Created a new partition 2 of type ‘Linux’ and of size 7.3 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

reboot

Nyt partitio on levyn loppuun ja logataan uudestaan SSH:lla ja laajennetaan tiedostojärjestelmäkin:

resize2fs /dev/mmcblk0p2

resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 1899776 (4k) blocks long.

df -h

Filesystem Size Used Avail Use% Mounted on
/dev/root 7.1G 1.3G 5.5G 19% /
devtmpfs 210M 0 210M 0% /dev
tmpfs 218M 0 218M 0% /dev/shm
tmpfs 218M 3.0M 215M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 218M 0 218M 0% /sys/fs/cgroup
/dev/mmcblk0p1 118M 36M 83M 31% /boot