New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XILINX/Zynq 7z010/7z020 相关 #1006
Comments
zynq[2] Linux from scratch
Xilinx有个wiki讲述如何一步步做Linux from scratch。有些步骤是多余的,比如编译设备树的工具链。鉴于我们的EBAZ4205是块野生的板子,需要稍微做一些配置。 安装vivado、SDK时候顺便安装了arm-linux-gnueabihf-以及其他Xilinx自家的工具链,不妨将其export到PATH: gccexport PATH=/某某某/SDK/2017.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/:$PATH bootgen etc.export PATH=/某某某/SDK/2017.4/bin:$PATH export ARCH=arm
从https://github.com/Xilinx/u-boot-xlnx上下载Xilinx家的uboot,当然也可以选择去下载release版本的。 改改配置 @@ -21,7 +21,7 @@
make zynq_zc702_defconfig tftp之前得显式地设置serverip 生成BOOT.bin the_ROM_image: mv u-boot u-boot.elf 从https://github.com/Xilinx/linux-xlnx上下载Xilinx家的内核。目前版本是4.19.0,还是挺新的。 设备树
因为我们的野生板子外设很少,必须将不用的外设disabled掉,不然引脚配置会打架。 &can0 {
... &i2c0 {
&qspi {
&usb0 {
串口的引脚要改对: @@ -368,12 +382,12 @@
&gem0 {
&sdhci0 {
Creating 9 MTD partitions on "pl35x-nand": &nand0 {
groups的名字是在pinctrl-zynq.c第715行找到的。 由于在zynq-7000.dtsi里,nand0是smcc的子节点,所以还要使能smcc节点: &smcc {
编译 记得我们uboot会将内核放在32K开始的内存地址处。然后编译设备树。 make xilinx_zynq_defconfig mkimage -A arm -T ramdisk -C gzip -d arm_ramdisk.image.gz uramdisk.image.gz Booting kernel from Legacy Image at 00008000 ...Image Name: Linux-4.19.0-xilinx Loading init Ramdisk from Legacy Image at 01000000 ...Image Name: Flattened Device Tree blob at 00000000Booting using the fdt blob at 0x000000 Starting kernel ... Booting Linux on physical CPU 0x0 .... VFS: Mounted root (ext4 filesystem) on device 1:0. |
zynq[3] bootstrap UbuntuUbuntu、Debian之类的不同的发行版,其实就是不同的rootfs。Debian系的发行版有个工具叫debootstrap,可以从源那里下载最小的根文件系统。Arch相应的工具则是packstrap。 下完根文件系统之后chroot进去进行相应的配置,为了chroot到一个ARM的rootfs,我们需要用qemu-arm-static。进去之后apt-get你想要安装的东西。配完了之后烧进sd卡,通过内核参数root=xxxx告诉内核要挂载哪个rootfs,即可启动了。 要制作一个叉叉派的镜像都是这样的套路:bootstrap一个最小系统,安装内核模块,安装必要的应用程序,然后安装不同的桌面环境,最后打包。于是就制作出各种水果派的n多镜像,像Ubuntu core、Ubuntu mate、xubuntu、lubuntu、Debian,Arch等等,应有尽有。。 然而这些大型发行版的“最小系统”都相当的大,几百兆的样子,而我们的EBAZ4205只有128M的nand flash,所以只好从sd卡启动才能维持得了生活。 准备工作 准备镜像文件 dd if=/dev/zero of=ubuntu1804.img bs=1M count=3500 sudo losetup -f --show ubuntu1804.img 然后我们给它分区。可以用图形界面的工具如gparted,也可以用命令行工具如parted、fdisk等。比方说我们用fdisk。 sudo fdisk /dev/loop0
同步这些分区。这样会在/dev/mapper/下面生成对应的节点: sudo kpartx -av /dev/loop0 sudo mkfs.vfat /dev/mapper/loop0p1 mkdir boot rootfs
安装最小系统 sudo debootstrap --arch=armhf --foreign bionic ./rootfs sudo debootstrap --arch=armhf --foreign stretch ./rootfs https://mirrors.tuna.tsinghua.edu.cn/debian/ sudo cp -av /usr/bin/qemu-arm-static rootfs/usr/bin/ sudo cp /run/systemd/resolve/stub-resolv.conf rootfs/etc/resolv.conf sudo chroot ./rootfs chroot环境下面:export LANG=C deb http://ports.ubuntu.com/ubuntu-ports bionic main restricted universe multiverse apt-get update useradd -G sudo -m -s /bin/bash ubuntu passwd root echo armhf > /etc/hostname auto lo allow-hotplug eth0 设置默认挂载目录:改/etc/fstab,将启动分区挂载到/boot目录上: /dev/mmcblk0p1 /boot vfat defaults 0 0 注意,因为Xilinx的内核配置默认将所有驱动都直接编译进内核,所以不需要将模块安装到文件系统中,就一个放在启动分区的内核就够了。 烧录SD卡 sudo umount ./boot $ ls -sh ubuntu1804.img dd if=ubuntu1804.img of=/dev/sd某 上机测试 U-Boot 2018.01 (Apr 24 2019 - 00:24:09 +0800) Xilinx Zynq ZC702 Model: Zynq ZC702 Development Board ... Booting kernel from Legacy Image at 00008000 ...Image Name: Linux-4.19.0-xilinx Flattened Device Tree blob at 00000000Booting using the fdt blob at 0x000000 Starting kernel ... Booting Linux on physical CPU 0x0 ... VFS: Mounted root (ext4 filesystem) on device 179:2. Welcome to Ubuntu 18.04 LTS! systemd[1]: Set hostname to . ... [ OK ] Started resolvconf-pull-resolved.service. Ubuntu 18.04 LTS armhf ttyPS0 armhf login: ubuntu
ubuntu@armhf:~$ sf 参考资料 |
LED_BLINK
约束文件(管教分配) set_property IOSTANDARD LVCMOS33 [get_ports {led[1]}]
set_property IOSTANDARD LVCMOS33 [get_ports {led[0]}]
set_property PACKAGE_PIN U20 [get_ports {led[1]}]
set_property PACKAGE_PIN P19 [get_ports {led[0]}]
set_property IOSTANDARD LVCMOS33 [get_ports clk]
set_property IOSTANDARD LVCMOS33 [get_ports rst_n]
set_property PACKAGE_PIN P20 [get_ports rst_n]
set_property PACKAGE_PIN N17 [get_ports clk]
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2021/01/01 17:19:36
// Design Name:
// Module Name: led_twinkle
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module led_twinkle(
input clk,
input rst_n,
output [1:0] led
);
reg [25:0] cnt;
assign led = (cnt < 26'd2500_000) ? 2'b01 : 2'b10;
always @ (posedge clk or negedge rst_n) begin
if (!rst_n)
cnt <= 26'd0;
else if(cnt < 26'd5000_000)
cnt <= cnt + 1'b1;
else
cnt <= 26'd0;
end
endmodule
|
zynq7010之EBAZ4205入门改造https://blog.csdn.net/weixin_42741023/article/details/103335948 2、如果用 J4 的 6P 电源接口需要将背面的 D24 短接起来,或是焊接一个二极管就行,如下 图: 或者把原来的二极管管取下来,然后焊接到上面,然后按照下面的飞线,这样就引出了12V 1路 3.3V 2路 3、改 SD 卡启动,最简单的方法是将 R2577 短接起来,或者将 R2584 挪到 R2577 上,后面 要改成 nand 启动改回来就行了,如下图: 1、串口位 J7,焊接 TX、RX、GND 就可以,波特率为 115200。SD 卡直接焊接就好。 2、JTAG 口为 J8,需要用到的引脚为: Pin1(GND) Pin2(Vref) Pin4(TMS) Pin6(TCK) Pin8(TDO) Pin10(TDI) 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 |
楼主,请教一下:“定制环境变量,改include/configs/zynq-common.h,主要是来配置启动参数。”这一段主要的修改内容是什么?? |
总结
vivado
流程
创建工程
使用IP Integrator创建Processor System
生成顶层HDL
生成Bitstream,并导出到SDK
在SDK中创建应用工程
I/O Port 管脚分配
The text was updated successfully, but these errors were encountered: