element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
MicroZed Hardware Design Issues building Linux kernel
  • Forums
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Avnet Boards Forums requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 3 replies
  • Subscribers 45 subscribers
  • Views 148 views
  • Users 0 members are here
Related

Issues building Linux kernel

Former Member
Former Member over 8 years ago

I'm having issues building a Linux kernel for the MicroZed.  I think my issues are related to the kernel because I can use the kernel and DTB from QSPI with a NFS root filesystem (Ubuntu core arm hf) and it seems stable.  But with my own kernel and the DTB from QSPI it's very unstable.

My development machine is ubuntu 12.04.3 x86_64

To get the kernel I do the following:

git clone git://github.com/Xilinx/linux-xlnx.git

One of the AvNet tutorials suggest that I do the following, but Xilinx doesn't have it in their build instructions.  I've tried it both ways, currently not in my latest kernel though:

git checkout -b xilinx-14.2-build1-trd

Here is my kernel build script:

# Clean environment
make distclean

# Setup environment variables for the kernel build
export INSTALL_MOD_PATH=../rootfs
export ARCH=arm

# Ubuntu provided ARM hard float toolchain
export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-

# Xilinx Vivado Toolchain
# export CROSS_COMPILE=~/Xilinx/SDK/2013.2/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-

# Updates the .config file
make xilinx_zynq_defconfig

# We would make menuconfig here if we needed to customize build options, but I'm not customizing yet

### **** Steps to make kernel and convert to u-boot format manually ****
### This step will compile both the kernel and modules
### make -j8
##
### Convert the Image to a uImage (U-Boot format image)
### cd arch/arm/boot
### mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 -n ZynqKernel -d Image uImage
### cd ../../..
### **** End steps to make kernel and convert to u-boot format manually ****

# Make the kernel and automatically convert it into a u-boot image
# mkimage will need to be in the path for this to work
make -j8 UIMAGE_LOADADDR=0x8000 uImage
make -j8 modules

# Install modules
make modules_install
sudo cp -R ../rootfs/lib/modules/* /media/media2/nfs_export/zynqroot/lib/modules/

# Copy kernel to tftp server storage folder
sudo cp arch/arm/boot/uImage /srv/tftp/uImage-hf

U-boot configuration:
baudrate=115200
bootargs=console=ttyPS0,115200 root=/dev/nfs nfsroot=192.168.1.26:/media/media2/nfs_export/zynqroot, tcp ip=192.168.1.20:192.168.1.26:192.168.1.1:255.255.255.0::eth0:off rw
devicetree_size=0x20000
ethact=Gem.e000b000
ethaddr=##:##:##:##:##:##
kernel_image=uImage-hf
kernel_size=0x500000
loadbit_addr=0x100000
modeboot=qspiboot
qspiboot=echo Copying Linux from QSPI flash to RAM... && sf probe 0 0 0 && sf read ${loadbit_addr} 0xC00000 ${bitstream_size} && mw 0xF8007080 0x30800100 0x4 && fpga load 0 ${loadbit_addr} ${bitstream_size} && sf read 0x3000000 0x100000 ${kernel_size} && sf read 0x2A00000 0x600000 ${devicetree_size} && echo Copying ramdisk... && sf read 0x2000000 0x620000 ${ramdisk_size} && bootm 0x3000000 0x2000000 0x2A00000
ramdisk_image=uramdisk.image.gz
ramdisk_size=0x5E0000
serverip=192.168.1.26
stderr=serial
stdin=serial
stdout=serial
testboot=sf probe 0 0 0; sf read 0x2A00000 0x600000 0x20000; tftpboot 0x3000000 ${serverip}:${kernel_image}

To boot it, I do the following in u-boot
run testboot
bootm 0x3000000 - 0x2A00000


It boots up, I can SSH into the system, maybe run a few commands, but the console will become unresponsive within a minute or two.

If I use the AvNet provided kernel, it runs fine (following u-boot commands):
zynq-uboot> sf probe 0 0 0
SF: Detected S25FL129P_64K with page size 64 KiB, total 16 MiB
zynq-uboot>  sf read 0x3000000 0x100000 ${kernel_size}
zynq-uboot> sf read 0x2A00000 0x600000 ${devicetree_size}
zynq-uboot>  bootm 0x3000000 - 0x2a00000

I can run openssl speed aes-256-cbc, ping, apt-get, etc.  runs great.

This is one of my first embedded linux projects, so I've tried to verbose as to what I'm doing.  I've really been struggling to figure this out...  Can anyone point to something I'm doing wrong here?

  • Reply
  • Cancel
  • Cancel
Parents
  • zedhed
    0 zedhed over 8 years ago

    Hi mwales,

    Is your end goal to get Ubuntu running on your MicroZed as well as your ZC706 board?  If so, we will be releasing an Ubuntu tutorial for our new display kit running on MicroZed in the next few days.  You could leverage some of this material for building the 14.4 kernel release:

    http://www.wiki.xilinx.com/Zynq+Release+14.4

    In any case, I would strongly recommend updating your U-Boot and Linux kernel to the 14.4 release or later.

    If you follow the Vivado Tutorials 1-4, that should get you a stable PS configuration and an up to date FSBL that you can tie up to your U-Boot for booting Linux on MicroZed.

    http://www.microzed.org/design/1519/10

    Regards,

    -Kevin

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
Reply
  • zedhed
    0 zedhed over 8 years ago

    Hi mwales,

    Is your end goal to get Ubuntu running on your MicroZed as well as your ZC706 board?  If so, we will be releasing an Ubuntu tutorial for our new display kit running on MicroZed in the next few days.  You could leverage some of this material for building the 14.4 kernel release:

    http://www.wiki.xilinx.com/Zynq+Release+14.4

    In any case, I would strongly recommend updating your U-Boot and Linux kernel to the 14.4 release or later.

    If you follow the Vivado Tutorials 1-4, that should get you a stable PS configuration and an up to date FSBL that you can tie up to your U-Boot for booting Linux on MicroZed.

    http://www.microzed.org/design/1519/10

    Regards,

    -Kevin

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
Children
  • bpwilliams
    0 bpwilliams over 8 years ago in reply to zedhed

    The zip file for the Ubuntu/MicroZed tutorial is bad. Check?

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube