Just a list of a few new steps required to install and run Vivado, XSDK and Petalinux 2016.2 on Ubuntu 64bit 16.04:
In order to run XSDK which can't use default GTK v3 we have to export new environmental variable. I usually add them at the end of my ~/.bashrc:
export SWT_GTK3=0
Another problem I discovered is when I open the Xilinx License Configuration Manager (XLCM) in Vivado Design Suite 2016.2, the HOST ID Matches column is shown as No. However, the host ID in the license file is correct. Looks like problem lies in new Ubuntu ethernet interface names and changing it back to eth0 fixes the issue. In order to make a change we have to add next settings to grub config in /etc/default/grub".
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
Dont forget to update grub:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-31-generic
Found initrd image: /boot/initrd.img-4.4.0-31-generic
Found linux image: /boot/vmlinuz-4.4.0-21-generic
Found initrd image: /boot/initrd.img-4.4.0-21-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Make changes to /etc/networking/interfaces and reboot:
auto eth0
iface eth0 inet dhcp
Yet another source of problems - Vivado's settings64.sh: it sets LD_LIBRARY_PATH to point to Vivado/2016.2/lib/lnx64.o, but because its global it affects all binaries run within the shell where we source settings64.sh. In my case, I noticed problems with starting gedit and failed compilation of U-boot with error "awk: undefined symbol: mpfr_z_sub".
Anyway, we actually can remove setting LD_LIBRARY_PATH from settings64.sh if your hardware design doesn't include AXI-BFM IP.
#############################################################
# Copyright (c) 1986-2016 Xilinx, Inc. All rights reserved. #
##############################################################
export XILINX_VIVADO=/opt/Xilinx/Vivado/2016.2
if [ -n "${PATH}" ]; then
export PATH=/opt/Xilinx/Vivado/2016.2/bin:$PATH
else
export PATH=/opt/Xilinx/Vivado/2016.2/bin
fi
A small HowTo (and reminder for myself) on how to use Eclipse (Xilinx SDK) to develop, cross-compile and upload Linux kernel modules for Zynq (ARM-based) embedded board using Xilinx SDK and Xilinx Embedded Linux aka Petalinux. But most steps are universal, you just have to setup cross-compiler and possibly some missing packages, like sshpass and scp.
Set Project Type to Makefile Project > Empty Project.
Select Xilinx ARM GNU/Linux Toolchain for Toolchain.
Click Finish.
In C/C++ General properties for AXIDMAProject:
Check Enable project specific settings.
Select Indexer on left menu:
Check Enable project specific settings.
Uncheck Index source files not included in the build and check Index all header variants.
Select Preprocessor Include Paths, Macros etc. on left menu:
Select GNU C in Languages
Select CDT User Settings Entries for Settings Entries.
Click Add... button on right.
Select Preprocessor Macros File in top-left drop-down menu.
Select File System Path in top-right left drop-down menu.
Set File to /home/d9/Projects/ZedBoardPetalinux/build/linux/kernel/xlnx-4.0/include/generated/autoconf.h.
Now click on Providers tab and check CDT GCC Built-in Compiler Settings.
Uncheck Use global provider shared between projects and add -nostdinc to Command to get compiler specs:.
Now select Paths and Symbols on left menu:
Select Includes tab.
Select GNU C on left languages list.
Click Add... button on right.
Check Add to all configurations and click File system... button.
Select /opt/Petalinux/petalinux-v2015.4-final/components/linux-kernel/xlnx-4.0/arch/arm/include and click OK.
Repeat prev. steps and add /opt/Petalinux/petalinux-v2015.4-final/components/linux-kernel/xlnx-4.0/include.
Now we have to set some symbols, so select #Symbols tab.
Select GNU C on left languages list.
Click Add... button on right.
Type name __KERNEL__ and value 1, check Add to all configurations and click OK.
You may need other symbols too, like DEBUG and CONFIG_OF.
Now we must exclude staff we don't need, so select Source Location tab.
Click on your project and click Link Folder... button on right.
Check Link to folder in the file system and click Browse... button.
Browse to /opt/Petalinux/petalinux-v2015.4-final/components/linux-kernel/xlnx-4.0 and click OK.
Next expand project, select Filter and click on Edit Filter...button. Here we can add folders which we want to exclude from the indexing. All paths are relative to project folder. What to exclude is up to you, but the minimum will be all architectures except ARM.
Apply changes and click OK to close all dialogs.
We can exclude kernel source folders from indexer other way too:
Expand AXIDMATest in Project Explorer tab.
Expand xlnx-4.0, select source folders you think you don't need to be indexed and right click on them.
Select Resource Configuration and click on Exclude from Build....
Select project build configurations in which you want to exclude selected sources. In this case you must have the only Default, so select it and click Ok.
Verify that previously selected folders and sources now greyed out and icons "crossed".
If you want to enable them back - do same steps and uncheck related "build configuration" in Resource configuration.
Add sources to project:
Add new Sources Folder and name it sources.
Copy into it axidmatest.c from "/opt/Petalinux/petalinux-v2015.4-final/components/linux-kernel/xlnx-4.0/drivers/dma/xilinx"
Open axidmatest.c and make sure Indexer did it job (you don't have indexer markers complaining about syntax errors).
Now we need a Makefile:
Add new File to the project folder and name it Makefile.
Code below represents Makefile in my case. You have to modify at least path to your configured kernel folder:
Set Execute permissions for this script in console or by right clicking on it and selecting Properties and checking permission boxes.
In Run -> External Tools -> External Tools Configurations... add New launch configuration for Program. For some reason it is filtered by default in XSDK 2015.4. So, uncheck Filter Configuration Types in menu on top.
In Main tab:
Type name: AXIDMATest
For Location: select ${workspace_loc:/AXIDMATest/utils/upload_insmod.sh}
For Working Directory: select ${workspace_loc:/AXIDMATest/sources}
In Build tab:
Check Build before launch box.
Select Specific projects radio-button.
Click Projects... button to select projects to build.
Check AXIDMATest box and click OK.
In Common tab:
Check Allocate console (necessary for input) box.
Check Launch in background box.
Click Apply and Close button.
Now we can just run this "External Tool" after making changes to source and it will compile project, upload module to remote system, overwrite existin file, rmmod previous and insmod new version of the module. Output related to script execution will be captured in Eclipse console and module output will be posted on remote system stdout.
axidmatest requires an entrance in DTS in order to work and without it insmod and rmmod are silent. So, to make it print something to stdout add pr_info() to the module __init() and __exit():
What a nice day. New long term support Ubuntu just got released. It will be supported for 5 year, currently features Linux kernel 3.13.9, Xorg 15.0.1, Mesa 10.1. http://releases.ubuntu.com/14.04/