1.首先搭建硬件环境(导出hdf文件)

1)进入vivado工程选择合适的板子型号,题主的板卡是zc706,芯片型号如下:

2)创建IPdesign

3)本文硬件上,将在ZYNQ Processing system里启用TTC、UART、SD以及之后可能用到的USB、Ethernet(网口0在bank1,bank1电压要选1.8V,否则报错)

MDIO也得选

4)然后automation自动连接外设

5)generate block design and generate output products

选择global

6)create HDL wrapper

7) 然后综合和implement,最后export hardware 生成hdf硬件描述语言

2.petalinux构建镜像文件

2.1步骤:

1.创建petalinux工程

2.将.hdf文件导入petalinux工程中

3.配置petalinux工程(配置内核,配置uboot,以及根文件系统)

4.编译petalinux工程(uboot镜像,内核镜像,rootfs,bitstream,fsbl镜像文件)

5.启动开发板子

2.2实践:

进入petalinux目录

命令说明

petalinux -boot 启动开发板

petalinux -build编译

petalinux -config 配置

petalinux -create 创建

petalinux -package 打包

z@ubuntu:~/PetaLinux2019.1$ petalinux-create --help
petalinux-create             (c) 2005-2019 Xilinx, Inc.This command creates a new PetaLinux Project or componentUsage:petalinux-create [options] <-t|--type <TYPE> <-n|--name <COMPONENT_NAME>Required:-t, --type <TYPE>                     Available type:* project : PetaLinux project* apps    : Linux user application* modules : Linux user module-n, --name <COMPONENT_NAME>           specify a name for the component orproject. It is OPTIONAL to create aPROJECT. If you specify source BSP whenyou create a project, you are notrequired to specify the name.
Options:-p, --project <PROJECT>               specify full path to a PetaLinux projectthis option is NOT USED for PROJECT CREATION.default is the working project.--force                               force overwriting an existing componentdirectory.-h, --help                            show function usage--enable                              this option applies to all types exceptproject.enable the created componentOptions for project:--template <TEMPLATE>                 zynqMP|zynq|microblazeuser needs specify which template to use.-s|--source <SOURCE>                  specify a PetaLinux BSP as a projectsource.Options for apps:--template <TEMPLATE>                 <c|c++|autoconf|install>c   : c user application(default)c++ : c++ user applicationautoconf: autoconf user applicationinstall: install data only-s, --source <SOURCE>                 valid source name format:*.tar.gz, *.tgz, *.tar.bz2, *.tar,*.zip, app source directoryOptions for modules: (No specific options for modules)EXAMPLES:Create project from PetaLinux Project BSP:$ petalinux-create -t project -s <PATH_TO_PETALINUX_PROJECT_BSP>Create project from template:
For microblaze project,$ petalinux-create -t project -n <PROJECT> --template microblaze
For zynq project,$ petalinux-create -t project -n <PROJECT> --template zynq
For zynqMP project,$ petalinux-create -t project -n <PROJECT> --template zynqMPCreate an app and enable it:$ petalinux-create -t apps -n myapp --enable
The application "myapp" will be created with c template in:<PROJECT>/project-spec/meta-user/recipes-apps/myappCreate an module and enable it:$ petalinux-create -t modules -n mymodule --enable
The module "mymodule" will be created with template in:<PROJECT>/project-spec/meta-user/recipes-modules/mymodule

1.创建工程

z@ubuntu:~/PetaLinux2019.1$ petalinux-create -t project --template zynq -n zynq_linux
INFO: Create project: zynq_linux
INFO: New project successfully created in /home/z/PetaLinux2019.1/zynq_linux

2.将hdf 文件导入到工程中

导入成功进入字符图形配置界面

下面要配置开发板的调试串口

默认为uart_1为调试串口

首次运行比较慢。

直接运行petalinux-config直接打开界面

z@ubuntu:~/PetaLinux2019.1/zynq_linux$ petalinux-config --get-hw-description /home/z/hdf/petalinux_smallsystem.sdk/
INFO: Getting hardware description...
INFO: Rename design_1_wrapper.hdf to system.hdf
[INFO] generating Kconfig for project
[INFO] menuconfig project*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.[INFO] sourcing bitbake
[INFO] generating plnxtool conf
[INFO] generating meta-plnx-generated layer
[INFO] generating user layers
[INFO] generating machine configuration
[INFO] generating bbappends for project . This may take time !

因为太慢了我把处理器的内核改了一下,改成3GB,八核。然后终于成功了。

3.下面:petalinux-config -c u-boot 等待一段时间跳出图形化界面

然后在另外一个终端打开字符图形化界面:

同理

4.petalinux-config -c kernel

5.petalinux-config -c rootfs

6.编译整个petalinux工程,也可以单独编译0

petalinux-build

最后生成的结果是在images/linux生成镜像文件

7.制作启动镜像文件BOOT.bin文件

boot.bin是多个镜像文件组合而成的,包括fsbl镜像文件,bitstream镜像文件,用户程序镜像文件

petalinux-package --boot --fsbl --fpga --u-boot --force

--boot:生成BOOT.bin镜像文件

--fsbl:用于指向fsbl镜像文件路径

--fpga:用于指向bitstream文件

--u-boot 用于指定u-boot(用户镜像文件)

--force :强制覆盖

z@ubuntu:~/PetaLinux2019.1/zynq_linux/images/linux$ petalinux-package --boot --fsbl ./zynq_fsbl.elf  --fpga ./system.bit --u-boot ./u-boot.elf --force
INFO: File in BOOT BIN: "/home/z/PetaLinux2019.1/zynq_linux/images/linux/zynq_fsbl.elf"
INFO: File in BOOT BIN: "/home/z/PetaLinux2019.1/zynq_linux/images/linux/system.bit"
INFO: File in BOOT BIN: "/home/z/PetaLinux2019.1/zynq_linux/images/linux/u-boot.elf"
INFO: Generating Zynq binary package BOOT.BIN...****** Xilinx Bootgen v2019.1**** Build date : May 11 2019-11:15:10** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.INFO: Binary is ready.
WARNING: Unable to access the TFTPBOOT folder /tftpboot!!!
WARNING: Skip file copy to TFTPBOOT folder!!!

image.ub包括kernel,设备树和根文件系统。所有我们只需提供image.ub和BOOT.bin文件就可以了。

8.制作SD启动卡

将image.ub和BOOT.bin拷贝到SD卡的FAT32分区,再插入SD卡启动板卡。

首先将SD卡用读卡器读入,读入进入虚拟机,在虚拟机中查看板卡的挂载点:

z@ubuntu:~/PetaLinux2019.1/zynq_linux/images/linux$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.5G     0  1.5G   0% /dev
tmpfs           298M  8.8M  290M   3% /run
/dev/sda1       984G   36G  898G   4% /
tmpfs           1.5G  212K  1.5G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.5G     0  1.5G   0% /sys/fs/cgroup
vmhgfs-fuse     932G  623G  309G  67% /mnt/hgfs
tmpfs           298M   48K  298M   1% /run/user/1000
/dev/sdb1        60G  3.4G   57G   6% /media/z/DA18-EBFA

这张卡是旧卡,要把这个设备点卸载掉,创建一个新的FAT32分区。

z@ubuntu:~/PetaLinux2019.1/zynq_linux/images/linux$ umount /media/z/DA18-EBFA 

然后再用df命令就找不到挂载点了

下面我们要创建FAT32分区,

z@ubuntu:~/PetaLinux2019.1/zynq_linux/images/linux$ sudo fdisk /dev/sdbWelcome 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): mHelp:DOS (MBR)a   toggle a bootable flagb   edit nested BSD disklabelc   toggle the dos compatibility flagGenericd   delete a partitionF   list free unpartitioned spacel   list known partition typesn   add a new partitionp   print the partition tablet   change a partition typev   verify the partition tablei   print information about a partitionMiscm   print this menuu   change display/entry unitsx   extra functionality (experts only)ScriptI   load disk layout from sfdisk script fileO   dump disk layout to sfdisk script fileSave & Exitw   write table to disk and exitq   quit without saving changesCreate a new labelg   create a new empty GPT partition tableG   create a new empty SGI (IRIX) partition tableo   create a new empty DOS partition tables   create a new empty Sun partition tableCommand (m for help):

查看设备分区:

Command (m for help): p
Disk /dev/sdb: 59.7 GiB, 64088965120 bytes, 125173760 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: 0x06f41121Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1       32768 125173759 125140992 59.7G  c W95 FAT32 (LBA)

现在把这个分区删掉:

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

下面创建新的分区

Command (m for help): p
Disk /dev/sdb: 59.7 GiB, 64088965120 bytes, 125173760 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: 0x06f41121Command (m for help): n
Partition typep   primary (0 primary, 0 extended, 4 free)e   extended (container for logical partitions)
Select (default p): Using default response p.
Partition number (1-4, default 1): 1
First sector (2048-125173759, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-125173759, default 125173759): Created a new partition 1 of type 'Linux' and of size 59.7 GiB.

指定分区为FAT32

Command (m for help): t
Selected partition 1
Partition type (type L to list all types): L0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris        1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden or  c6  DRDOS/sec (FAT-4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx         5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data    6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility   8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt         9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access     a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O        b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor      c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi ea  Rufus alignmente  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         eb  BeOS fs        f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ee  GPT
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        ef  EFI (FAT-12/16/
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f0  Linux/PA-RISC b
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f1  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f4  SpeedStor
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      f2  DOS secondary
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fb  VMware VMFS
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fc  VMware VMKCORE
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fd  Linux raid auto
1c  Hidden W95 FAT3 75  PC/IX           bc  Acronis FAT32 L fe  LANstep
1e  Hidden W95 FAT1 80  Old Minix       be  Solaris boot    ff  BBT
Partition type (type L to list all types): c
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

保存退出:

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

格式化:

z@ubuntu:~/PetaLinux2019.1/zynq_linux/images/linux$ sudo mkfs.vfat -F 32 -n boot /dev/sdb1
mkfs.fat 3.0.28 (2015-05-16)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows

然后手动挂载查看挂载点df -h

拷贝文件:

z@ubuntu:~/PetaLinux2019.1/zynq_linux/images/linux$ cp -a BOOT.BIN image.ub /media/z/boot/

同步和卸载:

z@ubuntu:~/PetaLinux2019.1/zynq_linux/images/linux$ sync
z@ubuntu:~/PetaLinux2019.1/zynq_linux/images/linux$ umount /media/z/boot

用户名和密码默认都是root.

ZC706+petalinux+vivado最小系统建立实践相关推荐

  1. 【Vivado那些事儿】MicroBlaze最小系统搭建及程序固化

    MicroBlaze是AMD-Xilinx提供的一个可以在FPGA中运行的嵌入式软核IP,其本质是一个32位RISC处理器软核,可以在150MHz时钟下,提供125 D-MIPS性能,具有运行速度快. ...

  2. ZynqLinux最小系统系列—— 4、Petalinux工程创建与编译以及烧写到FLASH(二)

    提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 ZynqLinux最小系统系列-- 4.Petalinux工程创建与编译以及烧写到FLASH(二) 写在前面 接上一篇 烧写FLASH ...

  3. ZynqLinux最小系统系列—— 9、一般Linux系统搭建(非Petalinux)

    提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 ZynqLinux最小系统系列-- 9.一般Linux系统搭建(非Petalinux) 前言 准备工作 操作流程 前言 前面petal ...

  4. 【利用proteus建立8086最小系统】MASM32的安装下载问题

    工具:proteus 8 ,电脑,masm32 这一个小问题困扰了我好几天,所以发出来和大家讨论一下,希望有所帮助吧! 在利用proteus建立8086最小系统这个作业中,当在新建项目时,大家是不是遇 ...

  5. 三分钟学会用SpringMVC搭建最小系统(超详细)_转载

    前言 做 Java Web 开发的你,一定听说过SpringMVC的大名,作为现在运用最广泛的Java框架,它到目前为止依然保持着强大的活力和广泛的用户群. 本文介绍如何用eclipse一步一步搭建S ...

  6. sap系统搭建教程_Nios ii最小系统搭建教程

    本教程以最小系统的概念为切入点,详细演示最小系统搭建的每一个步骤:外加嵌入式IP CORE详细的理论剖析和详细的实践演示,提供部分工程集源码下载链接.本手稿为实践总结,只是提供了一个思路,比如,驱动都 ...

  7. 升讯威微信营销系统开发实践:(3)功能介绍与此项目推广过程的一些体会( 完整开源于 Github)...

    GitHub:https://github.com/iccb1013/Sheng.WeixinConstruction因为个人精力时间有限,不会再对现有代码进行更新维护,不过微信接口比较稳定,经测试至 ...

  8. 小米网抢购系统开发实践和我的个人观察

    本文个人观察部分,为自己的一点看法. 正文内容,转载于 <程序员>2014年11月刊:电商峰值系统架构设计 http://www.csdn.net/article/2014-11-04/2 ...

  9. 51单片机计算机实物焊接,基于51单片机的最小系统焊接图 浅谈单片机最小系统...

    本文主要是关于51单片机的相关介绍,并对基于51单片机的最小系统焊接进行了详尽的阐述. 单片机最小系统 单片机最小系统主要由电源.复位.振荡电路以及扩展部分等部分组成. 对于一个完整的电子设计来讲,首 ...

最新文章

  1. C#类方法中使用数组参数params关键字的作用
  2. Java并发编程—说说Runnable与Callable
  3. IE 8 开发人员工具详解 【转载】
  4. 利用“多说”制作留言板、评论系统
  5. 三菱modbusRTU通讯实例_实例 | 三菱PLC接线图干货,FX5U模块硬件
  6. 完爆 Best Fit,看阿里如何优化 Sigma 在线调度策略节约亿级成本
  7. Educational Codeforces Round 1(D. Igor In the Museum) (BFS+离线访问)
  8. VBA_输出SQL查询数据
  9. 数据科学入门与实战:Seaborn001
  10. 计算机视觉CV中特征点提取SURF算法的学习笔记
  11. AI 专业人才缺口上百万,年薪 80 万远超同行
  12. 为 ASP.NET 创建缓存配置对象[转载]
  13. HoloLens1开发(三):Trilib插件动态加载模型-Part2
  14. 云上的日子电台php源码,云上的日子超炫酷音乐电台源码2.0更新,支持全网收费音乐外链获取...
  15. 本地搭建wooyun图片无法加载问题解决
  16. 认知突围_移动应用:突围
  17. Redhat Linux 5.3环境实施DB2 V9.7 HADR
  18. 【CVE-2021-4043】Linux本地提权漏洞复现
  19. 查询加日期oracle,Oracle查询优化日期运算实例详解
  20. 最长等差数列_最长等差子序列的长度

热门文章

  1. 理解vue之element-ui中的 template slot-scope=scope
  2. 单例模式的懒汉式和饿汉式的线程安全问题
  3. NoSQL数据库入门与实践——整理(一)
  4. 英雄使命服务器维修,《英雄使命》明天开启测试 10分钟极速体检
  5. 《机器学习实战》学习笔记(三)
  6. jQuery代码设置input输入框 不可编辑的切换
  7. 5G NR PDCCH
  8. 移动立方体(Marching Cubes,MC)算法
  9. 走近测试:对于软件测试的十大常见误解
  10. 如何利用函数指针在c语言中实现面向对象编程