TA的每日心情 | 开心 2015-3-31 12:52 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]初来乍到
|
本帖最后由 人生如梦_3019120 于 2020-5-17 23:29 编辑
一、板子上电
可以先预览下文档,这样比较稳妥。光盘目录下用户手册/2-1-开发板快速体验.pdf
上电后,由于没有安装驱动,串口还不能识别。 安装串口驱动后会发现有两个串口,一个是ps端的串口,一个是pl端的串口。
二、uboot
- U-Boot 2017.01-gf812dfb (Aug 28 2018 - 13:56:47 +0800)
- Model: Zynq ZC702 Development Board
- Board: Xilinx Zynq
- I2C: ready
- DRAM: ECC disabled 512 MiB
- MMC: sdhci_transfer_data: Error detected in status(0x208000)!
- sdhci@e0100000: 0 (SD), sdhci@e0101000: 1 (eMMC)
- SF: Detected n25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
- *** Warning - bad CRC, using default environment
- In: serial@e0001000
- Out: serial@e0001000
- Err: serial@e0001000
- Model: Zynq ZC702 Development Board
- Board: Xilinx Zynq
- Net: No ethernet found.
- Hit any key to stop autoboot: 0
复制代码
可知 uboot 才用的是比较老的2017年版本。uboot 支持 sd卡和eMMC。
sdhci_transfer_data: Error detected in status(0x208000)! 可知 mmc 某个设备没有正确识别。
通过下面操作可知 eMMC 有问题或者板子就没有eMMC。
mmc 一系列命令简介
- Zynq> ? mmc
- mmc - MMC sub system
- Usage:
- mmc info - display info of the current MMC device
- mmc read addr blk# cnt
- mmc write addr blk# cnt
- mmc erase blk# cnt
- mmc rescan
- mmc part - lists available partition on current mmc device
- mmc dev [dev] [part] - show or set current mmc device [partition]
- mmc list - lists available devices
- mmc hwpartition [args...] - does hardware partitioning
- arguments (sizes in 512-byte blocks):
- [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
- [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
- [check|set|complete] - mode, complete set partitioning completed
- WARNING: Partitioning is a write-once setting once it is set to complete.
- Power cycling is required to initialize partitions after set to complete.
- mmc setdsr <value> - set DSR register value
- //查看有哪些mmc 设备。
- Zynq> mmc list
- sdhci@e0100000: 0 (SD)
- sdhci@e0101000: 1 (eMMC)
- //查看 当前mmc 设备分区。
- Zynq> mmc part
- Partition Map for MMC device 0 -- Partition Type: DOS
- Part Start Sector Num Sectors UUID Type
- 1 2048 6215680 000db5af-01 0c Boot
- 2 6217728 12433408 000db5af-02 83
- 3 18651136 12433408 000db5af-03 83
- // 选择 某个mmc 设备
- Zynq> mmc dev 1
- sdhci_transfer_data: Error detected in status(0x208000)!
- switch to partitions #0, OK
- mmc1(part 0) is current device
复制代码
- arch_number = 0x00000000
- boot_params = 0x00000000
- DRAM bank = 0x00000000
- -> start = 0x00000000
- -> size = 0x20000000
- baudrate = 115200 bps
- TLB addr = 0x1FFF0000
- relocaddr = 0x1FF43000
- reloc off = 0x1BF43000
- irq_sp = 0x1EB22ED0
- sp start = 0x1EB22EC0
- ARM frequency = 666 MHz
- DSP frequency = 0 MHz
- DDR frequency = 533 MHz
- Early malloc usage: 49c / 800
复制代码- ? - alias for 'help'
- base - print or set address offset
- bdinfo - print Board Info structure
- boot - boot default, i.e., run 'bootcmd'
- bootd - boot default, i.e., run 'bootcmd'
- bootefi - Boots an EFI payload from memory
- bootelf - Boot from an ELF image in memory
- bootm - boot application image from memory
- bootp - boot image via network using BOOTP/TFTP protocol
- bootvx - Boot vxWorks from an ELF image
- bootz - boot Linux zImage image from memory
- clk - CLK sub-system
- cmp - memory compare
- coninfo - print console devices and information
- cp - memory copy
- crc32 - checksum calculation
- dcache - enable or disable data cache
- dfu - Device Firmware Upgrade
- dhcp - boot image via network using DHCP/TFTP protocol
- dm - Driver model low level access
- echo - echo args to console
- editenv - edit environment variable
- eeprom - EEPROM sub-system
- env - environment handling commands
- exit - exit script
- ext2load- load binary file from a Ext2 filesystem
- ext2ls - list files in a directory (default /)
- ext4load- load binary file from a Ext4 filesystem
- ext4ls - list files in a directory (default /)
- ext4size- determine a file's size
- ext4write- create a file in the root directory
- false - do nothing, unsuccessfully
- fatinfo - print information about filesystem
- fatload - load binary file from a dos filesystem
- fatls - list files in a directory (default /)
- fatsize - determine a file's size
- fatwrite- write file into a dos filesystem
- fdt - flattened device tree utility commands
- fpga - loadable FPGA image support
- fstype - Look up a filesystem type
- go - start application at address 'addr'
- gpio - query and control gpio pins
- help - print command description/usage
- i2c - I2C sub-system
- icache - enable or disable instruction cache
- iminfo - print header information for application image
- imxtract- extract a part of a multi-image
- itest - return true/false on integer compare
- load - load binary file from a filesystem
- loadb - load binary file over serial line (kermit mode)
- loads - load S-Record file over serial line
- loadx - load binary file over serial line (xmodem mode)
- loady - load binary file over serial line (ymodem mode)
- loop - infinite loop on address range
- ls - list files in a directory (default /)
- md - memory display
- mdio - MDIO utility commands
- mii - MII utility commands
- mm - memory modify (auto-incrementing address)
- mmc - MMC sub system
- mmcinfo - display MMC info
- mw - memory write (fill)
- nfs - boot image via network using NFS protocol
- nm - memory modify (constant address)
- ping - send ICMP ECHO_REQUEST to network host
- printenv- print environment variables
- reset - Perform RESET of the CPU
- run - run commands in an environment variable
- save - save file to a filesystem
- saveenv - save environment variables to persistent storage
- setenv - set environment variables
- sf - SPI flash sub-system
- showvar - print local hushshell variables
- size - determine a file's size
- sleep - delay execution for some time
- source - run script from memory
- spl - SPL configuration
- test - minimal test like /bin/sh
- tftpboot- boot image via network using TFTP protocol
- tftpput - TFTP put command, for uploading files to a server
- thordown- TIZEN "THOR" downloader
- true - do nothing, successfully
- usb - USB sub-system
- usbboot - boot from USB device
- version - print monitor, compiler and linker version
复制代码 可知包含 FAT 格式文件系统操作命令。
可用于在 uboot 中对 SD 卡或者 EMMC 中存储的文件进行操作。
可知包含 EXT 格式文件系统操作命令。可以通过如下命令查看
- Zynq> ext4ls mmc 0:2
- <DIR> 4096 .
- <DIR> 4096 ..
- <DIR> 16384 lost+found
- <DIR> 4096 etc
- <DIR> 4096 run
- <DIR> 4096 bin
- <DIR> 4096 sys
- <DIR> 4096 dev
- <DIR> 4096 proc
- <DIR> 4096 sbin
- <DIR> 4096 var
- <DIR> 4096 www
- <DIR> 4096 boot
- <DIR> 4096 usr
- <DIR> 4096 lib
- <DIR> 4096 home
- <SYM> 8 tmp
- <DIR> 4096 mnt
- <DIR> 4096 media
- <DIR> 4096 opt
复制代码 网络命令 ping,nfs,tftpboot。通过这几个命令更新 内核根文件系统还是比较方便的。
三、linux
1.开机日志问题
- Device: sdhci@e0101000
- Manufacturer ID: 13
- OEM: 14e
- Name: Q2J54
- Tran Speed: 25000000
- Rd Block Len: 512
- MMC version 5.0
- High Capacity: Yes
- Capacity: 3.6 GiB
- Bus Width: 4-bit
- Erase Group Size: 512 KiB
- HC WP Group Size: 8 MiB
- User Capacity: 3.6 GiB WRREL
- Boot Capacity: 16 MiB ENH
- RPMB Capacity: 512 KiB ENH
- reading uEnv.txt
- ** Unable to read file uEnv.txt **
- Copying Linux from SD to RAM...
- 3806216 bytes read in 414 ms (8.8 MiB/s)
- 18021 bytes read in 94 ms (186.5 KiB/s)
- ## Booting kernel from Legacy Image at 02080000 ...
- Image Name: Linux-4.9.0-xilinx-gee6f0c1
- Image Type: ARM Linux Kernel Image (uncompressed)
- Data Size: 3806152 Bytes = 3.6 MiB
- Load Address: 02080000
- Entry Point: 02080000
- Verifying Checksum ... OK
- ## Flattened Device Tree blob at 02000000
- Booting using the fdt blob at 0x2000000
- Loading Kernel Image ... OK
- Loading Device Tree to 1eb1a000, end 1eb21664 ... OK
复制代码- Hit any key to stop autoboot: 0
- Device: sdhci@e0100000
- Manufacturer ID: 3
- OEM: 5344
- Name: SS16G
- Tran Speed: 50000000
- Rd Block Len: 512
- SD version 3.0
- High Capacity: Yes
- Capacity: 14.8 GiB
- Bus Width: 4-bit
- Erase Group Size: 512 Bytes
- reading uEnv.txt
- ** Unable to read file uEnv.txt **
- Copying Linux from SD to RAM...
- 3806216 bytes read in 414 ms (8.8 MiB/s)
- 18021 bytes read in 94 ms (186.5 KiB/s)
- ## Booting kernel from Legacy Image at 02080000 ...
- Image Name: Linux-4.9.0-xilinx-gee6f0c1
- Image Type: ARM Linux Kernel Image (uncompressed)
- Data Size: 3806152 Bytes = 3.6 MiB
- Load Address: 02080000
- Entry Point: 02080000
- Verifying Checksum ... OK
- ## Flattened Device Tree blob at 02000000
- Booting using the fdt blob at 0x2000000
- Loading Kernel Image ... OK
- Loading Device Tree to 1eb1a000, end 1eb21664 ... OK
复制代码 打印的居然都是 Copying Linux from SD to RAM...
有如下打印输出还是很不错的。
- 3806216 bytes read in 414 ms (8.8 MiB/s)
- 18021 bytes read in 94 ms (186.5 KiB/s)
复制代码
2.led 控制
底板只有一个是留个PS端控制,通过如下命令可以查看,其中 user-led0 是底板上的led。
- root@Zynq-Tronlong:~# ls -l /sys/class/leds/
- lrwxrwxrwx 1 root root 0 Jan 1 1970 disc -> ../../devices/soc0/leds/leds/disc
- lrwxrwxrwx 1 root root 0 Jan 1 1970 heartbeat -> ../../devices/soc0/leds/leds/hear tbeat
- lrwxrwxrwx 1 root root 0 Jan 1 1970 mmc0:: -> ../../devices/soc0/amba/e0100000.sdh ci/leds/mmc0::
- lrwxrwxrwx 1 root root 0 Jan 1 1970 mmc1:: -> ../../devices/soc0/amba/e0101000.sdh ci/leds/mmc1::
- lrwxrwxrwx 1 root root 0 Jan 1 1970 user-led0 -> ../../devices/soc0/leds/leds/user -led0
复制代码 可以通过下面的命令控制led 亮灭
- root@Zynq-Tronlong:~# echo 0 > /sys/class/leds/user-led0/brightness
- root@Zynq-Tronlong:~# echo 1 > /sys/class/leds/user-led0/brightness
复制代码 3.key 值获取
底板只有一个key提供给了PS端, 通过hexdump 获取按键信息如下。
- root@Zynq-Tronlong:~# hexdump /dev/input/event0
- 0000000 7351 5cbd 4143 0002 0001 0094 0001 0000
- 0000010 7351 5cbd 4143 0002 0000 0000 0000 0000
- 0000020 7351 5cbd 9c93 0005 0001 0094 0000 0000
- 0000030 7351 5cbd 9c93 0005 0000 0000 0000 0000
复制代码 其中 0094 是事件编码与设备树code 一致。其前面的 0001 表示 EV_KEY事件。其后面的 0001/0000 表示按键按下/松开。0x20字节表示一次按键事件。
|
|