PetaLinux Frequently Asked Questions

  1. General
    1. Why should I use PetaLinux?
    2. Why should I switch to PetaLinux?
    3. What's the difference between PetaLinux and plain old uClinux-dist?
  2. Installation
    1. Why does PetaLinux need so much disk space?
    2. Why must I use Linux? What about Windows?
    3. Our corporate SOE is Windows - How can I use PetaLinux?
  3. Licensing
    1. We have a team of 20 developers - can they all use PetaLinux?
    2. We sell widgets, and our widgets contain MicroBlaze Linux systems built …
    3. We build boards - can we bundle PetaLinux with our hardware for customers …
    4. We provide training courses - can we use PetaLinux in these courses?
    5. Why aren't the PetaLinux BSP or helper scripts GPL-licensed?
  4. FS-Boot Bootloader
  5. U-Boot Bootloader
  6. Linux Kernel
  7. User Applications
  8. Hardware Reference Designs
    1. How do I determine/change the MAC address of the reference design …
  9. Custom Hardware Platforms
  10. Build Environment
    1. Is it possible to write program in assembler?
  11. Other
    1. How do I change the MDT (flash memory) partitions?

General

Why should I use PetaLinux?

  • It's easy! Want to add a new application to your embedded Linux build? Don't scratch around looking for a Makefile template, just type petalinux-new-app. Need to add a new platform to your kernel build? petalinux-new-platform.
  • It's supported: PetaLinux is the build system we use all day, every day. By maintaining it in-house we can ensure it works with the latest Xilinx tools, and add support for the most recent hardware boards.
  • It's self-contained: PetaLinux includes all source code and compiler tools in a single distribution. It is not necessary to download and install a separate compiler toolchain.
  • Archive a snapshot of your PetaLinux environment at any time, and that servers as a complete backup of your project - kernel, applications, compiler, build scripts, hardware files, everything.

Why should I switch to PetaLinux?

  • If you are already using uClinux-dist with your own build environment in place, then you are of course free to stay with that approach.
  • Due to the large (and continually growing) size of uClinux-dist, it is impossible for us to guarantee that everything in a vanilla uClinux-dist will work for MicroBlaze. IF you are happy to go it alone, then that's fine.
  • The same applies to the kernel trees - we test PetaLinux to make sure it works, and pass on the benefits of that testing to you.
  • For those who like to roll their own, you are of course welcome to take GCC tools, kernel sources and any other GPL-licensed code from PetaLinux and use it as you wish.

What's the difference between PetaLinux and plain old uClinux-dist?

  • uClinux-dist is a great tool for building embedded Linux systems. In fact it's so good, we've customised it and included it in PetaLinux.
  • Add to that a suite of hardware reference designs, pre-built and tested GCC toolchains, templates for applications and new platforms, and helper scripts to tie it all together, and you have PetaLinux.

Installation

Why does PetaLinux need so much disk space?

  • The goal of PetaLinux is to be self-contained. To achieve this, in addition to the kernel, library and application sources, we also bundle the GCC tools.
  • The MicroBlaze GCC toolchain is large - several hundred megabytes. Why? MicroBlaze is a highly parameterisable CPU - you can selectively enable or disable hardware support for multiplication, division, floating point, and numerous other features. PetaLinux includes a customised GCC compiler toolchain that contains optimised versions of the MicroBlaze-Linux C libraries specifically for every possible combination of CPU parameters. And of course, PetaLogix Auto-Config technology means the optimal combination is automatically selected for your hardware platform. However, with so many options, and so many variants of the C libraries, the disk space requirement is increased. We think it's a small price to pay.

Why must I use Linux? What about Windows?

  • Cross-compiling embedded Linux systems under Windows (or actually the Cygwin compatibility layer) is possible, but painful. Cygwin is slow, and different enough from real Linux to make life very difficult. It can be done, but currently PetaLinux does not support Cygwin. Some things to think about:
    • If you are developing embedded Linux systems, your software development team should be living, breathing, eating and sleeping Linux. Doing Linux development on a Windows machine makes no sense at all. One of the key benefits of using Embedded Linux is your ability to develop in a POSIX-compatible environment, with standard C libraries and so on. An advantage of this is the ability to prototype and test your application code on a desktop Linux machine.
    • A few issues aside, the Xilinx tools run beautifully under Linux. The main problems most people encounter relate to the host parallel port and USB drivers for JTAG programming. See our page on running Xilinx tools under Linux for some helpful suggestions and links to solve these problems.
    • There is experimental evidence to suggest that the Xilinx tools actually run *better* under Linux, especially on very large designs and workstations with lots of memory.

Our corporate SOE is Windows - How can I use PetaLinux?

  • Use a virtual machine solution, such as VMWare. Install Linux inside the virtual machine, and then install PetaLinux into that.
  • Install Linux on a commodity greybox PC for the embedded Linux / software development part of your flow, and run the Xilinx tools under Windows. See our documentation on Non-standard PetaLinux installations for ideas on how to do this effectively. This also works for a Virtual Machine configuration.

Licensing

We have a team of 20 developers - can they all use PetaLinux?

  • Yes - you are free to distribute PetaLinux to as many internal developers or sub-contractors as you like

We sell widgets, and our widgets contain MicroBlaze Linux systems built using PetaLinux. Do we have to license anything from PetaLogix?

  • No. You must still honour your GPL obligations since you are distributing (and probably modifying) GPL-licensed code, and binaries built from such code.

We build boards - can we bundle PetaLinux with our hardware for customers to use?

  • Not without talking to us first. See the PetaLinux Licensing page for full details. You can extract all of the GPL-licensed code (essentially the entire ${PETALINUX}/software subtree), and do what you like with it. However, you are not free to distribute the PetaLinux BSP tools (MLD/TCL scripts), nor are you free to distribute the petalinux-* helper applications.
  • PetaLogix offers a very reasonable licensing package for OEMs who wish to bundle a complete PetaLinux suite with their hardware. Talk to us about creating a PetaLinux environment customised for your products - your customers will thank you.

We provide training courses - can we use PetaLinux in these courses?

  • Not without talking to us first. Once again, you are free to take any GPL-licensed material from a PetaLinux distribution and do what you wish. To use PetaLinux as a complete environment, please talk to us first.

Why aren't the PetaLinux BSP or helper scripts GPL-licensed?

  • We have invested a lot of time and energy into developing these scripts from scratch. There is no GPL material in them, they are our original works, and we assert our moral and copyrights over them. While we are happy for individuals and companies to make use of these scripts, we believe it is reasonable that we have some say over how they are distributed.
  • If you are distributing the PetaLinux environment with your hardware, or using it in your training courses, then you obviously believe that it is adding value to what you sell. Part of that value is derived from our original works, and we reserve the right to discuss terms with you prior to granting you permission to redistribute them.
  • Once again, anything that is GPL-licensed in PetaLinux is fair game - you can do what you like with it, subject of course to its GPL status.

FS-Boot Bootloader

U-Boot Bootloader

Linux Kernel

User Applications

Hardware Reference Designs

How do I determine/change the MAC address of the reference design platform?

  • The MAC address is set in the "Network Address" sub menu under the "System Settings" menu. This MAC address will be used by both the U-Boot and the Linux kernel.
  • A default Xilinx MAC address is used for the Xilinx reference designs.

Custom Hardware Platforms

Build Environment

Is it possible to write program in assembler?

  • Yes, you can develop your program in assembler using the MicroBlaze instruction set and compile them using microblaze-uclinux-gcc. assuming your assembly program is in asmtest.S, compile and build with the following commandline:
    $ microblaze-uclinux-gcc -o asmtest asmtest.S
    

Note that your application must still provide a main() function as the entry point to the application, and that writign Linux programs in assembly is a non-trivial topic.

Other

How do I change the MDT (flash memory) partitions?

The PetaLinux build environment attempts to make this as simple and error-free as possible. The name, ordering and size of flash partitions in configured in the PetaLinux System Configuration menu.

After you have configured your flash partitions, run through the following checklsit to ensure your nerw flash partitions will function as expected:

  1. always use the physmap-auto MTD mapping driver
  2. always enable the MTD commandline partition parsing options, as that's how we get u-boot to tell the kernel about your partitions
  3. always specify your MDT flash partitions in the top level menuconfig -> user/vendor -> system configuration menu
  4. After changing the flash table, you must to reconfigure u-boot so that it knows about the partitions. This is done when you do download the ub.config.img u-boot script into u-boot.
    • In u-boot, do a "printenv", look for the mtdparts variable. This shows you what u-boot thinks your flash table looks like, and what it will tell the kernel. That must match the reality.