当前位置:   article > 正文

ZYNQ飞控的设计-bitstream文件的设计_non-securepl bitstream

non-securepl bitstream

一、需要的开发工具

Xilinx Vivado‡用于建立FPGA及ARM核心
Xilinx SDK‡
Linux-Xlnx‡
U-Boot-Xlnx‡
Device-Tree-Xlnx‡
  • 1
  • 2
  • 3
  • 4
  • 5

二、操作步骤

1.创建一个基础的RTL工程

1、打开Vivado
2、Create a new Project in Vivado, 选择RTL Project;
3、不要导入任何源文件,只创建一个pin_constr文件;
4、zynq-7000系列,clg400,速度等级-2,选择xc7z020;
5、点击完成,这样就有了一个工作环境;
6、选择Create Block Design,命名为armps;
7、在新的界面中点击添加IP按键,添加一个ZYNQ7 Processing System;
8、双击ZYNQ7 Processing System 打开配置窗口;

2.配置ARMPS

1、选择PS-PL配置,打开下拉窗口;
2、Create a new Project in Vivado, 选择RTL Project;
3、不要导入任何源文件,只创建一个pin_constr文件;
4、zynq-7000系列,clg400,速度等级-2,选择xc7z020;
5、点击完成,这样就有了一个工作环境;
6、选择Create Block Design,命名为armps;
7、在新的界面中点击添加IP按键,添加一个ZYNQ7 Processing System;
8、双击ZYNQ7 Processing System 打开配置窗口;
9、选 PS-PL 配置, 打开 AXI non-secure 使能下拉菜单, 打开 GP Master AXI interface, 选择 M AXI GPO Interface(默认配置);
10、选择Peripheral I/O Pins, 进行如下配置:

SectionSubsectionPeripheral IO Pins
Quad Spi Flash1-6
Ethernet 016-27
USB 028-39
SD 040-45
SPI 0EMIO
SPI 1EMIO
UART 0EMIO
UART 148,49
I2C 0EMIO
I2C 1EMIO
CAN 0EMIO
GPIO MIO0, 7-15, 47, 50, 51
GPIO MIOUSB PHY Reset46
GPIO EMIOEMIO

10、选择 Clock Configuration , 打开 Processor Memory Clocks, 按照如下配置(7020默认配置):

ComponentClock SourceRequested Frequency(MHz)
CPUARM PLL667
DDRDDR PLL534

11、打开 IO Peripheral Clocks, 按照如下配置:

ComponentClock SourceRequested Frequency(MHz)
SMCIO PLL100
QSPIIO PLL200
ENET 0IO PLL1000 Mbps
ENET 1IO PLL1000 Mbps
SDIOIO PLL100
SPIIO PLL166.667
CANIO PLL100

12、打开PL Fabric Clocks, 配置如下:

ComponentClock SourceRequested Frequency(MHz)
FC_CLK0IO PLL100
FC_CLK0IO PLL50

13、打开 DDR配置

NameSelect
Memory TypeDDR3
Memory PartMT41J128M16 HA-15E
Effective DRAM Bus Width8
Burst LengthDDR3

14、打开 Interrupts, 打开 Fabric Interrupts 子菜单, 打开 PL-PS Interrupt Ports, 选择 box for IRQ_F2P,返回 block diagram, 添加如下接口 :

DDR
FIXED_IO
UART_PS_0
IIC_PS_0
IIC_PS_1
SPI_PS_0
SPI _PS_1
CAN_PS_0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

2.添加其它的IP

在主配置界面添加如下IP核,添加IP核时选择connection Automation,添加AXI_OCPOC_PWM和RC_RECEIVER_INPUT时必须选择50MHz的时钟输入。

添加下面下面的IP核,选择connection Automation,选择100MHz 时钟输入,双击确认。

8 AXI_UART16550
    ·16550
    ·▢ Use External CLK for BAUD rate
    ·▢ Enable External Receiver CLK
4 AXI_I2C
    ·SCL Clock Frequency - 100
    ·Address Mode - 7 bits
    ·SCL Inertial Delay - 30
    ·SDA Inertial Delay - 5
    ·Active State of SDA - 1
    ·General Purpose Output Width - 1
    ·Default GPO Port Output Value - 0x00
1 XADC_WIZ
1 xlconcat
2 xlconstant (set the value in one to 0 and one set to 1)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

连接所有的 UART and I2C interrupts to the xlconcat - xlconcat IP 可以管理16个中断信号 ,但是我们需要在 IP core settings里手动修改它.
The default project requires 12 interrupts, however it’s recommended that you use only as many as necessary.
Expand all the UART output, Connect all the CTSN and RIN to the xlconstant with the value of 0 in it. Repeat with DCDN & DSRN, and set to 1 Create interface ports for all the I2C, UART, PWM, and RC_RECEIVER

3.打包设计Wrapping the Block Diagram

在源码管理窗口(Source),右键单击设计表, 选择armps. 右键选择 Create HDL Wrapper.
Double wrapping the Block Diagram

This section is currently required for users using SBUS communication, if not sure, then do this part as well.

For the default build, create a new verilog source based on APPENDIX A

That block of code effectively creates a module of the previous wrapper block design, and inverts the RX line of the SBUS serial line. At the time of writing, it wasn’t possible to isolate the RX line of a serial IP without a wrapper.

If you’re already familiar with verilog, then it should be fairly straight forward. The parts of interest are:

4.修改SBUS的配置

因为Sbus的输入反逻辑的UART协议,所以需要在生成的HDL文件中,添加如下verilog逻辑代码:

input sbus_in
⋮
wire sbus_rx;
wire sbus_tx;
assign sbus_rx = ~sbus_in;
  • 1
  • 2
  • 3
  • 4
  • 5

实际上就是在SBUS的串口输入端加上了反向器。

which invert the SBUS line on a given (UART_PL_0 IP in our case) IP interface port.
Assigning Pins

4.IO约束文件的配置

在我们创建工程时创建了 pin_constr 约束文件,我们需要使用 TCL 命令去约束IO引脚,例如:

set_property PACKAGE_PIN H18 [get_ports CAN_PS_0_rx]
set_property IOSTANDARD LVCMOS33 [get_ports CAN_PS_0_rx]
on the I2C lines also be sure to include something like:
//在I2C的引脚约束中还需要添加如下约束:
set_property PULLUP true [get_ports IIC_PL_1_scl_io]
  • 1
  • 2
  • 3
  • 4
  • 5

6.外设的地址映射

打开工程设计图 block diagram,在工作空间选择Address Editor ,配置成如下地址映射:

CellOffset Address
Offset Address
axi_iic_00x416_00000
xadc_wiz_00x43C5_00000
axi_iic_10x4161_0000
axi_iic_20x4162_0000
axi_iic_30x4163_0000
AXI_OcPoC_PWM_Controller_00x43C0_0000
RC_Receiver_Input_00x43CA_0000
axi_uart_16550_00x43C1_0000
axi_uart_16550_10x43C2_0000
axi_uart_16550_20x43C3_0000
axi_uart_16550_30x43C4_0000
axi_uart_16550_40x43C6_0000
axi_uart_16550_50x43C7_0000
axi_uart_16550_60x43C8_0000
axi_uart_16550_70x43C9_0000

7.综合生成工程文件

保存所有设计后,左侧导航栏选择Start Implementation,根据提示完成相关操作,在综合完成后,选择导出硬件文件,并加载SDK。
generate bitstream->launch Xilinx SDK。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/172394
推荐阅读
相关标签
  

闽ICP备14008679号