1,搭建powerlink接口所需硬件平台:
· Zynq ZC702 board (used as openPOWERLINK MN)
· AVNET expander board (AES-FMC-ISMNET-G)
· Linux PC
· Micro SD card reader
· Micro SD card
· Ethernet cables
· 1 Mini USB serial cable
2,搭建powerlink接口所需软件平台:
· Ubuntu 14.04 or later version
· Vivado-2016.2
· CMake v2.8.7 or later version
openPOWERLINK Linux MN Demo
3,XILINX官网下载Xilinx Linux (https://github.com/Xilinx/linux-xlnx)
下载完成后,使用命令git checkout -b zynq-build xilinx-2016.2
4,安装 CMake and CMake GUI
sudo apt-get install cmake
sudo apt-get install cmake-gui
安装 libncurses5 library : sudo apt-get install libncurses5-dev
安装u-boot-tools package用于create uImage:sudo apt-get install u-boot-tools
5,从下面链接下载用于 Xilinx-linux编译用的RT Preempt 4.4-rt2 version:
https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/older/patch-4.4-rt2.patch.gz
· 从下面链接下载openPOWERLINK stack (2.5.0 or higher):
http://openpowerlink.sourceforge.net/web/openPOWERLINK/Download.html
将RT Preempt 4.4-rt2安装包解压剪切到内核编译包Xilinx-linux里面,然后编译内核
cd <Xilinx_Linux_directory>
Apply the patch 输入下面命令: patch -p1 < <(gunzip -c <path_to_patch-4.4-rt2.patch.gz>
导入交叉编译器环境变量:export CROSS_COMPILE=arm-linux-gnueabihf
使用ZYNQ配置文件配置Linux kernel:make ARCH=arm xilinx_zynq_defconfig
编译内核的命令:make ARCH=arm CROSS_COMPILE=<Xilinx_dir>/SDK/2016.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-
6,编译uImage文件的命令:make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage CROSS_COMPILE=<Xilinx_dir>/SDK/2016.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-modules
安装modules:make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage CROSS_COMPILE=<Xilinx_dir>/SDK/2016.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-modules_install
7,Change the path to the Xilinx Vivado directory:cd <Xilinx_dir>/Vivado/2016.2/bin
· Open Vivado TCL console 2016.2:./vivado -mode tcl
在tcl输入如下命令:
> xsct
> vivado -mode tcl
> vivado -mode batch
8,cd <openPOWERLINK_dir>/hardware/build/xilinx-microblaze
使用下面命令build the hardware 在 Debug 模式:
cmake -GUnix\ Makefiles -DCMAKE_TOOLCHAIN_FILE=../../../cmake/toolchain-xilinx-microblaze-gnu.cmake ../..
cmake ../.. -DCMAKE_BUILD_TYPE=Debug -DSKIP_BITSTREAM=OFF -DDEMO_Z702_MN_DUAL_SHMEM_GPIO=ON
make install
使用下面命令build the hardware在 Release 模式:
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DSKIP_BITSTREAM=OFF -DDEMO_Z702_MN_DUAL_SHMEM_GPIO=ON
make install
9. cd <openPOWERLINK_dir>/stack/build/xilinx-microblaze
使用下面命令build the PCP 在Debug 模式:
cmake -GUnix\ Makefiles -DCMAKE_TOOLCHAIN_FILE=../../../cmake/toolchain-xilinx-microblaze-gnu.cmake ../.. -DCMAKE_BUILD_TYPE=Debug -DCFG_COMPILE_LIB_MNDRV_DUALPROCSHM=ON
make install
使用下面命令build the PCP在 Release 模式:
cmake -GUnix\ Makefiles -DCMAKE_TOOLCHAIN_FILE=../../../cmake/toolchain-xilinx-microblaze-gnu.cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCFG_COMPILE_LIB_MNDRV_DUALPROCSHM=ON
make install
· Change directory:
> cd <openPOWERLINK_dir>/drivers/xilinx-microblaze/drv_daemon/build
> cmake -GUnix\ Makefiles -DCMAKE_TOOLCHAIN_FILE=../../../cmake/toolchain-xilinx-microblaze-gnu.cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCFG_BUILD_KERNEL_STACK=PCP\ Daemon\ Dual-Proc -DCFG_HW_LIB=xilinx-z702/mn-dual-shmem-gpio ..
> make install
10,产生FSBL
fsbl.elf (from <Xilinx_SDK_workspace>/<project_name>/Debug/)
download.bit (from <openPOWERLINK_dir>/bin/generic/microblaze/xilinx-z702/mn-dual-shmem-gpio)
u-boot.elf (from Zynq ZC702 package http://www.wiki.xilinx.com/Zynq+2016.2+Release)
oplkdrv-daemon_o.elf (from <openPOWERLINK_dir>/bin/generic/microblaze/xilinx-z702/mn-dual-shmem-gpio)
编译指令: <Xilinx_dir>/SDK/2016.2/bin/bootgen -image bootimage.bif -o i boot.bin
11,编译设备树命令:<Xilinx_Linux_dir>/scripts/dtc/dtc -I dts -O dtb -o devicetree.dtb system.dts
使用cakem-gui
> source <Xilinx_dir>/Vivado/2016.2/settings64.sh
> cmake-gui
12,英文步骤继续
- Refer to the link given below to convert the SD card to a bootable medium for the Zynq:
- http://www.wiki.xilinx.com/Prepare+Boot+Medium
- Refer to the link given below to download the Zynq ZC702 2016.2 pre-built Linux binaries:
- http://www.wiki.xilinx.com/Zynq+2016.2+Release
- Extract the Zynq ZC702 2016.2 pre-built Linux binaries package.
- Copy the following content to the boot partition of the SD card:
- uramdisk.image.gz from:
- Zynq ZC702 2016.2 pre-built Linux binaries package
- devicetree.dtb from:
- <openPOWERLINK_dir>/hardware/boards/xilinx-z702/mn-dual-shmem-gpio/sdk/handoff
- BOOT.bin from:
- <openPOWERLINK_dir>/tools/xilinx-zynqvivado
- openPOWERLINK driver and application folders from:
- <openPOWERLINK_dir>/bin/linux/arm/oplkdrv_kernelmodule_zynq
- <openPOWERLINK_dir>/bin/linux/arm/demo_mn_console
- The uImage from:
- <Xilinx_Linux_dir>/arch/arm/boot
- Hardware setup
- Connect the Avnet expander board to the J3 FMC1 connector of the Zynq ZC702 board.
- Now connect the Ethernet cable to any of the Ethernet ports J6/J2 of the Avnet extension board and to a CN in the network.
- To run openPOWERLINK
- Insert the SD card into the Zynq ZC702 board.
- Connect the USB UART port in the Zynq ZC702 board with the Linux PC.
- From the terminal, run minicom using the following command:
> sudo minicom -s
-
- Go to the serial port setup.
- Change the serial device to the USB serial device name. (Example: /dev/ttyUSB0)
- Set the hardware flow control settings to NO.
- Select Save setup as dfl.
- After saving the configuration, select Exit to proceed.
- Once the auto-boot finishes, enter root as username.
- Mount the SD card using the following command:
> mount /dev/mmcblk0p1 /mnt/
> cd /mnt/oplkdrv_kernelmodule_zynq/
- Insert the driver module using the following command:
> insmod oplkmnzynqintf.ko
> cd /mnt/demo_mn_console
- Run the openOWERLINK MN demo using the following command:
> ./demo_mn_console
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)