電子發(fā)燒友網(wǎng)訊:ZedBoard開發(fā)板上的Zynq是一個ARM PS(processing system, 雙核A9 + 存儲管理 + 外設(shè))+ PL(programable Logic) 結(jié)構(gòu),如果不使用PL,zynq的開發(fā)和普通的ARM 開發(fā)一樣。不同的是ARM PS是可配置,因而硬件信息是不固定的。這也是zynq靈活性的一個表現(xiàn)。電子發(fā)燒友網(wǎng)編輯現(xiàn)為讀者整合《玩轉(zhuǎn)賽靈思Zedboard開發(fā)板》系列文章, 其中包括在ZedBoard開發(fā)板上的一些應(yīng)用實例。其內(nèi)容包括:
玩轉(zhuǎn)賽靈思Zedboard開發(fā)板(1):ZedBoard詳解
玩轉(zhuǎn)賽靈思Zedboard開發(fā)板(2):ZedBoard最簡單的測試工程
玩轉(zhuǎn)賽靈思Zedboard開發(fā)板(3):基于Zynq PL的流水燈
玩轉(zhuǎn)賽靈思Zedboard開發(fā)板(4):如何使用自帶外設(shè)IP讓ARM PS訪問FPGA?
從本小節(jié)開始,講著重介紹Zedboard上的嵌入式linux應(yīng)用,包括使用SDK設(shè)計最簡單的linux應(yīng)用程序、linux交叉編譯環(huán)境搭建、設(shè)備驅(qū)動編寫等內(nèi)容。本小節(jié)使用的linux系統(tǒng)是Digilent官方提供的OOB設(shè)計,它是Digilent官網(wǎng)給出的一個完整的、Zedboard可運行的linux 系統(tǒng),包含了Zedboard上的幾個重要的設(shè)備驅(qū)動如串口、USB、以太網(wǎng)、OLED、HDMI等。當(dāng)linux在Zedboard上運行起來后,Zedboard就是一個小型的嵌入式系統(tǒng),使用SDK及Xilinx ARM Linux工具鏈編譯生成的可執(zhí)行文件可以在這個系統(tǒng)執(zhí)行。
硬件平臺:Digilent ZedBoard;開發(fā)環(huán)境:Windows XP 32 bit;軟件: SDK 14.2。
一、獲取Zedboard可運行的linux
Digilent官網(wǎng)給出Zedboard的可運行l(wèi)inux設(shè)計ZedBoard_OOB_Design包,可從http://www.digilentinc.com/Data/Documents/Other/ZedBoard_OOB_Design.zip獲取,下載后解壓,可以看到包的結(jié)構(gòu)和內(nèi)容:
boot_image目錄:
-- system.bit – 配置FPGA的bit文件
-- u-boot.elf – 引導(dǎo)linux需要的Second-Stage boot loader
-- zynq_fsbl.elf – 配置ARM PS系統(tǒng)的First-Stage boot loader(FSBL)
doc目錄:
-- README.txt – 說明文件
hw目錄:
-- EDK 14.1版本的XPS工程,用來生成硬件文件和bit文件
linux目錄:
-- devicetree_ramdisk.dts – 設(shè)備樹源代碼
-- .config – Linux內(nèi)核配置文件,用來生成zImage
sd_image目錄:
-- BOOT.BIN – 使用boot_images中的三個文件生成的Zynq配置文件
-- devicetree_ramdisk.dtb – 編譯后的設(shè)備樹文件
-- ramdisk8M.image.gz – 編譯后的文件系統(tǒng)
-- README – 介紹如何運行OOB設(shè)計的說明文檔
-- zImage – 編譯后的內(nèi)核
sw目錄:
--硬件配置
--FSBL源代碼
其中sd_image目錄中包含了ZedBoard上能夠運行l(wèi)inux的所有文件。將SD卡格式化為Fat32,把sd_image目錄文件拷貝到SD 卡根目錄下;然后將JP7~JP11設(shè)置為SD卡啟動模式,將JP2短路,JP3斷開,這樣可以下一步我們可以把U盤作為USB 從設(shè)備掛載到Zedboard上。
圖 Zedboard的連接和短路塊設(shè)置
上電后,等待ARM PS的配置、FPGA的配置(藍(lán)色LED DONE 亮起),之后開始引導(dǎo)Linux系統(tǒng)了??梢詮某壗K端上看到一系列的引導(dǎo)信息:
1 U-Boot 2012.04.01-00297-gc319bf9-dirty (Sep 13 2012 - 09:30:49)
2
3 DRAM: 512 MiB
4 WARNING: Caches not enabled
5 MMC: SDHCI: 0
6 Using default environment
7
8 In: serial
9 Out: serial
10 Err: serial
11 Net: zynq_gemHit any key to stop autoboot: 0
12 Copying Linux from SD to RAM.。。
13 Device: SDHCI
14 Manufacturer ID: 1b
15 OEM: 534d
16 Name: 00000
17 Tran Speed: 25000000
18 Rd Block Len: 512
19 SD version 1.0
20 High Capacity: Yes
21 Capacity: 3.7 GiB
22 Bus Width: 1-bit
23 reading zImage
24
25 2479640 bytes read
26 reading devicetree_ramdisk.dtb
27
28 5817 bytes read
29 reading ramdisk8M.image.gz
30
31 3694108 bytes read
32 ## Starting application at 0x00008000 。。。
33 Uncompressing Linux.。。 done, booting the kernel.
34 [ 0.000000] Booting Linux on physical CPU 0
35 [ 0.000000] Linux version 3.3.0-digilent-12.07-zed-beta (tinghui.wang@DIGILENT_LINUX) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-50) ) #2 SMP PREEMPT Thu Jul 12 21:01:42 PDT 2012
36 [ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
37 [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
38 [ 0.000000] Machine: Xilinx Zynq Platform, model: Xilinx Zynq ZED
39 [ 0.000000] bootconsole [earlycon0] enabled
40 [ 0.000000] Memory policy: ECC disabled, Data cache writealloc
41 [ 0.000000] BUG: mapping for 0xf8f00000 at 0xfe00c000 out of vmalloc space
42 [ 0.000000] BUG: mapping for 0xe0000000 at 0xfe000000 out of vmalloc space
43 [ 0.000000] BUG: mapping for 0xffff1000 at 0xfe200000 out of vmalloc space
44 [ 0.000000] PERCPU: Embedded 7 pages/cpu @c1489000 s5696 r8192 d14784 u32768
45 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 125824
46 [ 0.000000] Kernel command line: console=ttyPS0,115200 root=/dev/ram rw initrd=0x800000,8M earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=0
47 [ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
48 [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
49 [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
50 [ 0.000000] Memory: 240MB 256MB = 496MB total
51 [ 0.000000] Memory: 489856k/489856k available, 34432k reserved, 0K highmem
52 [ 0.000000] Virtual kernel memory layout:
53 [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
54 [ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
55 [ 0.000000] vmalloc : 0xe0800000 - 0xfd000000 ( 456 MB)
56 [ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
57 [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
58 [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
59 [ 0.000000] .text : 0xc0008000 - 0xc042f040 (4253 kB)
60 [ 0.000000] .init : 0xc0430000 - 0xc0456640 ( 154 kB)
61 [ 0.000000] .data : 0xc0458000 - 0xc0485dc0 ( 184 kB)
62 [ 0.000000] .bss : 0xc0485de4 - 0xc049d734 ( 95 kB)
63 [ 0.000000] Preemptible hierarchical RCU implementation.
64 [ 0.000000] Verbose stalled-CPUs detection is disabled.
65 [ 0.000000] NR_IRQS:128
66 [ 0.000000] xlnx,ps7-ttc-1.00.a #0 at 0xe0800000, irq=43
67 [ 0.000000] Console: colour dummy device 80x30
68 [ 0.000000] Calibrating delay loop.。。 1594.16 BogoMIPS (lpj=7970816)
69 [ 0.090000] pid_max: default: 32768 minimum: 301
70 [ 0.090000] Mount-cache hash table entries: 512
71 [ 0.090000] CPU: Testing write buffer coherency: ok
72 [ 0.090000] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
73 [ 0.100000] smp_twd: clock not found: -2
74 [ 0.100000] Calibrating local timer.。。 399.36MHz.
75 [ 0.170000] hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
76 [ 0.170000] Setting up static identity map for 0x2f8d48 - 0x2f8d7c
77 [ 0.270000] CPU1: Booted secondary processor
78 [ 0.310000] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
79 [ 0.310000] Brought up 2 CPUs
80 [ 0.310000] SMP: Total of 2 processors activated (3188.32 BogoMIPS)。
81 [ 0.320000] devtmpfs: initialized
82 [ 0.320000] ------------[ cut here ]------------
83 [ 0.320000] WARNING: at arch/arm/mm/dma-mapping.c:198 consistent_init+0x70/0x104()
84 [ 0.330000] Modules linked in:
85 [ 0.330000] [《c0012920》] (unwind_backtrace+0x0/0xe0) from [《c001e924》] (warn_slowpath_common+0x4c/0x64)
86 [ 0.340000] [《c001e924》] (warn_slowpath_common+0x4c/0x64) from [《c001e954》] (warn_slowpath_null+0x18/0x1c)
87 [ 0.350000] [《c001e954》] (warn_slowpath_null+0x18/0x1c) from [《c04345a8》] (consistent_init+0x70/0x104)
88 [ 0.360000] [《c04345a8》] (consistent_init+0x70/0x104) from [《c000858c》] (do_one_initcall+0x90/0x160)
89 [ 0.360000] [《c000858c》] (do_one_initcall+0x90/0x160) from [《c043085c》] (kernel_init+0x84/0x128)
90 [ 0.370000] [《c043085c》] (kernel_init+0x84/0x128) from [《c000dfcc》] (kernel_thread_exit+0x0/0x8)
91 [ 0.380000] ---[ end trace 1b75b31a2719ed1c ]---
92 [ 0.380000] ------------[ cut here ]------------
93 [ 0.390000] WARNING: at arch/arm/mm/dma-mapping.c:198 consistent_init+0x70/0x104()
94 [ 0.390000] Modules linked in:
95 [ 0.390000] [《c0012920》] (unwind_backtrace+0x0/0xe0) from [《c001e924》] (warn_slowpath_common+0x4c/0x64)
96 [ 0.400000] [《c001e924》] (warn_slowpath_common+0x4c/0x64) from [《c001e954》] (warn_slowpath_null+0x18/0x1c)
97 [ 0.410000] [《c001e954》] (warn_slowpath_null+0x18/0x1c) from [《c04345a8》] (consistent_init+0x70/0x104)
98 [ 0.420000] [《c04345a8》] (consistent_init+0x70/0x104) from [《c000858c》] (do_one_initcall+0x90/0x160)
99 [ 0.430000] [《c000858c》] (do_one_initcall+0x90/0x160) from [《c043085c》] (kernel_init+0x84/0x128)
100 [ 0.430000] [《c043085c》] (kernel_init+0x84/0x128) from [《c000dfcc》] (kernel_thread_exit+0x0/0x8)
101 [ 0.440000] ---[ end trace 1b75b31a2719ed1d ]---
102 [ 0.440000] NET: Registered protocol family 16
103 [ 0.460000] L310 cache controller enabled
104 [ 0.460000] l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72060000, Cache size: 524288 B
105 [ 0.460000] registering platform device ‘pl330’ id 0
106 [ 0.470000] registering platform device ‘a(chǎn)rm-pmu’ id 0
107 [ 0.470000]
108 [ 0.470000] ###############################################
109 [ 0.480000] # #
110 [ 0.480000] # Board ZED Init #
111 [ 0.480000] # #
112 [ 0.490000] ###############################################
113 [ 0.490000]
114 [ 0.500000] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpointregisters.
115 [ 0.500000] hw-breakpoint: maximum watchpoint size is 4 bytes.
116 [ 0.530000] xslcr xslcr.0: at 0xF8000000 mapped to 0xE0808000
117 [ 0.540000] bio: create slab 《bio-0》 at 0
118 [ 0.540000] gpiochip_add: registered GPIOs 0 to 245 on device: xgpiops
119 [ 0.540000] xgpiops e000a000.gpio: gpio at 0xe000a000 mapped to 0xe080a000
120 [ 0.550000] SCSI subsystem initialized
121 [ 0.550000] usbcore: registered new interface driver usbfs
122 [ 0.560000] usbcore: registered new interface driver hub
123 [ 0.560000] usbcore: registered new device driver usb
124 [ 0.570000] Advanced Linux Sound Architecture Driver Version 1.0.24.
125 [ 0.570000] Switching to clocksource xttcpss_timer1
126 [ 0.590000] NET: Registered protocol family 2
127 [ 0.590000] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
128 [ 0.590000] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
129 [ 0.600000] TCP bind hash table entries: 16384 (order: 5, 196608 bytes)
130 [ 0.600000] TCP: Hash tables configured (established 16384 bind 16384)
131 [ 0.610000] TCP reno registered
132 [ 0.610000] UDP hash table entries: 256 (order: 1, 8192 bytes)
133 [ 0.620000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
134 [ 0.620000] NET: Registered protocol family 1
135 [ 0.630000] Trying to unpack rootfs image as initramfs.。。
136 [ 0.630000] rootfs image is not initramfs (no cpio magic); looks like an initrd
137 [ 0.670000] Freeing initrd memory: 8192K
138 [ 0.670000] xscugtimer xscugtimer.0: ioremap fe00c200 to e0810200 with size 400
139 [ 0.670000] pl330 dev 0 probe success
140 [ 0.680000] msgmni has been set to 972
141 [ 0.680000] io scheduler noop registered
142 [ 0.680000] io scheduler deadline registered
143 [ 0.680000] io scheduler cfq registered (default)
144 [ 0.690000] e00 0.690000] console [ttyPS0] enabled, bootconsole disabled
145 [ 0.690000] console [ttyPS0] enabled, bootconsole disabled
146 [ 0.700000] xdevcfg f8007000.devcfg: ioremap f8007000 to e0814000 with size 1000
147 [ 0.710000] [drm] Initialized drm 1.1.0 20060810
148 [ 0.720000] brd: module loaded
149 [ 0.730000] loop: module loaded
150 [ 0.730000] xqspips e000d000.qspi: at 0xE000D000 mapped to 0xE0816000, irq=51
151 [ 0.740000] GEM: BASEADDRESS hw: e000b000 virt: e0818000
152 [ 0.740000] XEMACPS mii bus: probed
153 [ 0.750000] eth0, pdev-》id -1, baseaddr 0xe000b000, irq 54
154 [ 0.750000] ehci_hcd: USB 2.0 ‘Enhanced’ Host Controller (EHCI) Driver
155 [ 0.760000] usb_hcd_xusbps_probe: No OTG assigned!
156 [ 0.760000] usb_hcd_xusbps_probe: OTG now assigned!
157 [ 0.770000] xusbps-ehci xusbps-ehci.0: Xilinx PS USB EHCI Host Controller
158 [ 0.770000] xusbps-ehci xusbps-ehci.0: new USB bus registered, assigned bus number 1
159 [ 0.810000] xusbps-ehci xusbps-ehci.0: irq 53, io mem 0x00000000
160 [ 0.830000] xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00
161 [ 0.830000] hub 1-0:1.0: USB hub found
162 [ 0.830000] hub 1-0:1.0: 1 port detected
163 [ 0.840000] Initializing USB Mass Storage driver.。。
164 [ 0.840000] usbcore: registered new interface driver usb-storage
165 [ 0.850000] USB Mass Storage support registered.
166 [ 0.850000] Xilinx PS USB Device Controller driver (Apr 01, 2011)
167 [ 0.860000] mousedev: PS/2 mouse device common for all mice
168 [ 0.860000] Linux video capture interface: v2.00
169 [ 0.870000] gspca_main: v2.14.0 registered
170 [ 0.870000] usbcore: registered new interface driver uvcvideo
171 [ 0.870000] USB Video Class driver (1.1.1)
172 [ 0.880000] WDT OF probe
173 [ 0.880000] xwdtps f8005000.swdt: Xilinx Watchdog Timer at 0xe081c000 with timeout 10 seconds
174 [ 0.890000] sdhci: Secure Digital Host Controller Interface driver
175 [ 0.890000] sdhci: Copyright(c) Pierre Ossman
176 [ 0.900000] sdhci-pltfm: SDHCI platform and OF driver helper
177 [ 0.900000] mmc0: Invalid maximum block size, assuming 512 bytes
178 [ 0.910000] mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
179 [ 0.910000] usbcore: registered new interface driver usbhid
180 [ 0.920000] usbhid: USB HID core driver
181 [ 0.920000] No connectors reported connected with modes
182 [ 0.930000] adv7511 0-0039: Failed to add route DAI IN-》TMDS
183 [ 0.940000] [drm] Cannot find any crtc or sizes - going 1024x768
184 [ 0.940000] drivers/gpu/drm/analog/analog_drm_fbdev.c:analog_drm_fbdev_probe[241]
185 [ 0.960000] asoc: adv7511 《-》 75c00000.axi-spdif-tx mapping ok
186 [ 0.960000] axi-spdif 75c00000.axi-spdif-tx: Failed to set DAI format: -22
187 [ 0.980000] ALSA device list:
188 [ 0.980000] #0: HDMI monitor
189 [ 0.980000] TCP cubic registered
190 [ 0.980000] NET: Registered protocol family 17
191 [ 0.980000] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
192 [ 0.980000] Registering SWP/SWPB emulation handler
193 [ 0.980000] registered taskstats version 1
194 [ 0.980000] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
195 [ 0.980000] Console: switching to colour frame buffer device 128x48
196 [ 1.000000] mmc0: new high speed SDHC card at address 0002
197 [ 1.030000] fb0: frame buffer device
198 [ 1.030000] mmcblk0: mmc0:0002 00000 3.70 GiB
199 [ 1.040000] drm: registered panic notifier
200 [ 1.040000] [drm] Initialized analog_drm 1.0.0 20110530 on minor 0
201 [ 1.050000] mmcblk0: p1
202 [ 1.050000] RAMDISK: gzip image found at block 0
203 [ 1.310000] EXT4-fs (ram0): warning: mounting unchecked fs, running e2fsck is recommended
204 [ 1.320000] EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
205 [ 1.320000] VFS: Mounted root (ext4 filesystem) on device 1:0.
206 [ 1.330000] Freeing init memory: 152K
207 Starting rcS.。。
208 ++ Mounting filesystem
209 ++ Setting up mdev
210 ++ Configure static IP 192.168.1.10
211 [ 1.510000] GEM: lp-》tx_bd ffdfb000 lp-》tx_bd_dma 181a9000 lp-》tx_skb d816b0c0
212 [ 1.520000] GEM: lp-》rx_bd ffdfc000 lp-》rx_bd_dma 181a8000 lp-》rx_skb d816b1c0
213 [ 1.520000] GEM: MAC 0x00350a00, 0x00002201, 00:0a:35:00:01:22
214 [ 1.530000] GEM: phydev d8b81400, phydev-》phy_id 0x1410dd1, phydev-》addr 0x0
215 [ 1.540000] eth0, phy_addr 0x0, phy_id 0x01410dd1
216 [ 1.540000] eth0, attach [Marvell 88E1510] phy driver
217 ++ Starting telnet daemon
218 ++ Starting http daemon
219 ++ Starting ftp daemon
220 ++ Starting dropbear (ssh) daemon
221 ++ Starting OLED Display
222 [ 1.580000] pmodoled-gpio-spi [zed_oled] SPI Probing
223 [ 1.730000] usb 1-1: new high-speed USB device number 2 using xusbps-ehci
224 ++ Exporting LEDs & SWs
225 rcS Complete
226 zynq>
至此,linux已經(jīng)在Zedboard上啟動起來。從超級終端輸出的信息我們打開可以知道,“這個”linux系統(tǒng)的一些基本情況,如8~10行
In: serial
Out: serial
Err: serial
輸入輸出調(diào)試信息使用的都是serial,即串口,這里是超級終端,因而超級終端就如同linux系統(tǒng)下的控制臺,我們可以鍵入linux的命令對系統(tǒng)進(jìn)行操作,例如輸入ls命令,可以顯示當(dāng)前目錄內(nèi)容:
其他命令如cd、mkdir、cp、rm等基本命令均可以執(zhí)行。
77~79行提示信息
?。?0.270000] CPU1: Booted secondary processor
[ 0.310000] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.310000] Brought up 2 CPUs
可以知道ARM PS的兩個CPU均被啟動
再如163~171行
?。?0.840000] Initializing USB Mass Storage driver.。。
[ 0.840000] usbcore: registered new interface driver usb-storage
?。?0.850000] USB Mass Storage support registered.
[ 0.850000] Xilinx PS USB Device Controller driver (Apr 01, 2011)
[ 0.860000] mousedev: PS/2 mouse device common for all mice
?。?0.860000] Linux video capture interface: v2.00
[ 0.870000] gspca_main: v2.14.0 registered
?。?0.870000] usbcore: registered new interface driver uvcvideo
[ 0.870000] USB Video Class driver (1.1.1)
可以知道大容量USB設(shè)備驅(qū)動已經(jīng)安裝,包括PS USB設(shè)備等驅(qū)動均安裝了,因此可以使用U盤、USB鍵盤、鼠標(biāo)、攝像頭等設(shè)備。
二、使用SDK設(shè)計linux應(yīng)用程序
接下來我們就可以像其他的嵌入式linux開發(fā)一樣來使用Zedboard了。SDK提供了標(biāo)準(zhǔn)可視化的linux-arm交叉編譯鏈,不需要再進(jìn)行交叉編譯環(huán)境的搭建。
啟動SDK,new-》C project,選擇工程類型為“Xilinx ARM Linux Executable”,工具鏈為“Xilinx ARM GNU/Linux Toolchain”
在工程配置選項中,去掉Debug(因為我們不需要進(jìn)行調(diào)試),只保留Release
???
工程建立后好,新建main.c文件,修改內(nèi)容如下:
1 /*
2 * hello.c
3 *
4 * Created on: 2012-11-8
5 * @超群天晴 http://www.cnblogs.com/surpassal/
6 */
7
8 #include 《stdio.h》
9
10 int main()
11 {
12 printf(“HelloWorld! ”);
13 printf(“This is from Zedboard Linux! ”);
14 printf(“2012年11月8日16:43:22 by 超群天晴 ”);
15 return 0;
16 }
就是一個簡單的從控制臺輸出helloworld信息。編譯后生成了lab_6.elf可執(zhí)行文件,將其拷貝到了U盤上。
三、運行l(wèi)inux可執(zhí)行程序
將U盤連接到Zedboard,控制臺會提示有USB device連接上,分配給這個設(shè)備的名稱是sda1
1 zynq> [ 2263.970000] usb 1-1: new high-speed USB device number 2 using xusbps-ehci
2 [ 2264.120000] scsi0 : usb-storage 1-1:1.0
3 [ 2265.130000] scsi 0:0:0:0: Direct-Access Generic Flash Disk 8.07 PQ: 0 ANSI: 4
4 [ 2265.140000] sd 0:0:0:0: [sda] 3932160 512-byte logical blocks: (2.01 GB/1.87GiB)
5 [ 2265.140000] sd 0:0:0:0: Attached scsi generic sg0 type 0
6 [ 2265.150000] sd 0:0:0:0: [sda] Write Protect is off
7 [ 2265.150000] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn‘t support DPO or FUA
8 [ 2265.170000] sda: sda1
9 [ 2265.180000] sd 0:0:0:0: [sda] Attached SCSI removable disk
10
11 zynq>
使用mount命令
mount /dev/sda1 /mnt/
將設(shè)備掛載到mnt目錄下,
輸入命令
cd /mnt
切換到mnt目錄
輸入命令
ls
可以看到目錄下有我們剛剛生成的lab_6.elf可執(zhí)行文件
輸入命令
./lab_6.elf
運行,可以看到執(zhí)行結(jié)果,控制臺輸出了我們需要的信息
===============================
Digilent官方OOB設(shè)計參考:http://www.digilentinc.com/Data/Documents/Other/ZedBoard_OOB_Design.zip
完整工程下載:【詳見】
評論
查看更多