赞
踩
Xilinx Vivado‡用于建立FPGA及ARM核心
Xilinx SDK‡
Linux-Xlnx‡
U-Boot-Xlnx‡
Device-Tree-Xlnx‡
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 打开配置窗口;
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, 进行如下配置:
Section | Subsection | Peripheral IO Pins |
---|---|---|
Quad Spi Flash | 1-6 | |
Ethernet 0 | 16-27 | |
USB 0 | 28-39 | |
SD 0 | 40-45 | |
SPI 0 | EMIO | |
SPI 1 | EMIO | |
UART 0 | EMIO | |
UART 1 | 48,49 | |
I2C 0 | EMIO | |
I2C 1 | EMIO | |
CAN 0 | EMIO | |
GPIO MIO | 0, 7-15, 47, 50, 51 | |
GPIO MIO | USB PHY Reset | 46 |
GPIO EMIO | EMIO |
10、选择 Clock Configuration , 打开 Processor Memory Clocks, 按照如下配置(7020默认配置):
Component | Clock Source | Requested Frequency(MHz) |
---|---|---|
CPU | ARM PLL | 667 |
DDR | DDR PLL | 534 |
11、打开 IO Peripheral Clocks, 按照如下配置:
Component | Clock Source | Requested Frequency(MHz) |
---|---|---|
SMC | IO PLL | 100 |
QSPI | IO PLL | 200 |
ENET 0 | IO PLL | 1000 Mbps |
ENET 1 | IO PLL | 1000 Mbps |
SDIO | IO PLL | 100 |
SPI | IO PLL | 166.667 |
CAN | IO PLL | 100 |
12、打开PL Fabric Clocks, 配置如下:
Component | Clock Source | Requested Frequency(MHz) |
---|---|---|
FC_CLK0 | IO PLL | 100 |
FC_CLK0 | IO PLL | 50 |
13、打开 DDR配置
Name | Select |
---|---|
Memory Type | DDR3 |
Memory Part | MT41J128M16 HA-15E |
Effective DRAM Bus Width | 8 |
Burst Length | DDR3 |
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
在主配置界面添加如下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)
连接所有的 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
在源码管理窗口(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:
因为Sbus的输入反逻辑的UART协议,所以需要在生成的HDL文件中,添加如下verilog逻辑代码:
input sbus_in
⋮
wire sbus_rx;
wire sbus_tx;
assign sbus_rx = ~sbus_in;
实际上就是在SBUS的串口输入端加上了反向器。
which invert the SBUS line on a given (UART_PL_0 IP in our case) IP interface port.
Assigning Pins
在我们创建工程时创建了 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]
打开工程设计图 block diagram,在工作空间选择Address Editor ,配置成如下地址映射:
Cell | Offset Address |
---|---|
Offset Address | |
axi_iic_0 | 0x416_00000 |
xadc_wiz_0 | 0x43C5_00000 |
axi_iic_1 | 0x4161_0000 |
axi_iic_2 | 0x4162_0000 |
axi_iic_3 | 0x4163_0000 |
AXI_OcPoC_PWM_Controller_0 | 0x43C0_0000 |
RC_Receiver_Input_0 | 0x43CA_0000 |
axi_uart_16550_0 | 0x43C1_0000 |
axi_uart_16550_1 | 0x43C2_0000 |
axi_uart_16550_2 | 0x43C3_0000 |
axi_uart_16550_3 | 0x43C4_0000 |
axi_uart_16550_4 | 0x43C6_0000 |
axi_uart_16550_5 | 0x43C7_0000 |
axi_uart_16550_6 | 0x43C8_0000 |
axi_uart_16550_7 | 0x43C9_0000 |
保存所有设计后,左侧导航栏选择Start Implementation,根据提示完成相关操作,在综合完成后,选择导出硬件文件,并加载SDK。
generate bitstream->launch Xilinx SDK。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。