New Horizons









Welcome to my blog

My name is Sven Andersson and I
work as a consultant in embedded
system design, implemented in ASIC
and FPGA.
In my spare time I write this blog
and I hope it will inspire others to
learn more about this fantastic field.
I live in Stockholm Sweden and have
my own company

Contact

You are welcome to contact me
and ask questions or make comments
about my blog.



Content

New Horizons
What's new
Starting a blog
Writing a blog
Using an RSS reader

Zynq Design From Scratch
Started February 2014
1 Introduction
Changes and updates
2 Zynq-7000 All Programmable SoC
3 ZedBoard and other boards
4 Computer platform and VirtualBox
5 Installing Ubuntu
6 Fixing Ubuntu
7 Installing Vivado
8 Starting Vivado
9 Using Vivado
10 Lab 1. Create a Zynq project
11 Lab 1. Build a hardware platform
12 Lab 1. Create a software application
13 Lab 1. Connect to ZedBoard
14 Lab 1. Run a software application
15 Lab 1. Benchmarking ARM Cortex-A9
16 Lab 2. Adding a GPIO peripheral
17 Lab 2. Create a custom HDL module
18 Lab 2. Connect package pins and implement
19 Lab 2. Create a software application and configure the PL
20 Lab 2. Debugging a software application
21 Running Linux from SD card
22 Installing PetaLinux
23 Booting PetaLinux
24 Connect to ZedBoad via ethernet
25 Rebuilding the PetaLinux kernel image
26 Running a DHCP server on the host
27 Running a TFTP server on the host
28 PetaLinux boot via U-boot
29 PetaLinux application development
30 Fixing the host computer
31 Running NFS servers
32 VirtualBox seamless mode
33 Mounting guest file system using sshfs
34 PetaLinux. Setting up a web server
35 PetaLinux. Using cgi scripts
36 PetaLinux. Web enabled application
37 Convert from VirtualBox to VMware
38 Running Linaro Ubuntu on ZedBoard
39 Running Android on ZedBoard
40 Lab2. Booting from SD card and SPI flash
41 Lab2. PetaLinux board bringup
42 Lab2. Writing userspace IO device driver
43 Lab2. Hardware debugging
44 MicroZed quick start
45 Installing Vivado 2014.1
46 Lab3. Adding push buttons to our Zynq system
47 Lab3. Adding an interrupt service routine
48 Installing Ubuntu 14.04
49 Installing Vivado and Petalinux 2014.2
50 Using Vivado 2014.2
51 Upgrading to Ubuntu 14.04
52 Using Petalinux 2014.2
53 Booting from SD card and SPI flash
54 Booting Petalinux 2014.2 from SD card
55 Booting Petalinux 2014.2 from SPI flash
56 Installing Vivado 2014.3

Chipotle Verification System
Introduction

EE Times Retrospective Series
It all started more than 40 years ago
My first job as an electrical engineer
The Memory (R)evolution
The Microprocessor (R)evolution

Four soft-core processors
Started January 2012
Introduction
Table of contents
Leon3
MicroBlaze
OpenRISC 1200
Nios II

Using the Spartan-6 LX9 MicroBoard
Started August 2011
Introduction
Table of contents
Problems, fixes and solutions

FPGA Design From Scratch
Started December 2006
Introduction
Table of contents
Index
Acronyms and abbreviations

Actel FPGA design
Designing with an Actel FPGA. Part 1
Designing with an Actel FPGA. Part 2
Designing with an Actel FPGA. Part 3
Designing with an Actel FPGA. Part 4
Designing with an Actel FPGA. Part 5

CAD
A hardware designer's best friend
Zoo Design Platform

Linux
Installing Cobra Command Tool
A processor benchmark

Mac
Porting a Unix program to Mac OS X
Fixing a HyperTerminal in Mac OS X
A dream come true

Bicycling
Stockholm by bike

Running
The New York City Marathon

Skiing/Skating
Kittelfjall Lappland

Tour skating in Sweden and around the world
Top
Introduction
SSSK
Wild skating
Tour day
Safety equipment
A look at the equipment you need
Skate maintenance
Links
Books, photos, films and videos
Weather forecasts

Travel
38000 feet above see level
A trip to Spain
Florida the sunshine state

Photo Albums
Seaside Florida
Ronda Spain
Sevilla Spain
Cordoba Spain
Alhambra Spain
KittelfjÀll Lapland
Landsort Art Walk
Skating on thin ice

Books
100 Power Tips for FPGA Designers

Favorites
Adventures in ASIC
ChipHit
Computer History Museum
DeepChip
Design & Reuse
Dilbert
d9 Tech Blog
EDA Cafe
EDA DesignLine
Eli's tech Blog
Embedded.com
EmbeddedRelated.com
FPGA Arcade
FPGA Blog
FPGA Central
FPGA CPU News
FPGA developer
FPGA Journal
FPGA World
Lesley Shannon Courses
Mac 2 Ubuntu
Programmable Logic DesignLine
OpenCores
Simplehelp
SOCcentral
World of ASIC



If you want to be updated on this weblog Enter your email here:



rss feed



 
Monday, November 07, 2011
FPGA design from scratch. Part 75
 

Board bring up with PetaLinux SDK

Up to now we have been using a pre-built PetaLinux image that was downloaded to the LX9 board. Now it is time to build our own image from scratch. We will follow the instructions in the document Board Bring Up with PetaLinux SDK.

Building the hardware platform

The hardware platform has already been built (see part 72). We only have to export it to the Xilinx Software Development kit SDK. 

  1. Start XPS and select Export Hardware Design to SDK.
  2. Tick include bitstream and BMM file
  3. Specify the directory to export to (the files will be placed in the PetaLinux installation) 
  4. Click the Export Only button.



We will export the hardware files to a workspace located inside the PetaLinux installation. 




Configuring software settings

After designing the hardware system, it is now necessary to configure a Linux BSP for our project. This is required to automate the Linux board bringup. The Xilinx SDK workflow is used to configure the Linux BSP. The steps required for the workflow is described in the following sections. So let's start SDK.

--> xsdk &

Select the new workspace in the Workspace Launcher. We will use one workspace per hardware project, since each hardware project will have it own BSP configuration.




Xilinx SDK has started.




Add PetaLinux repository

  • Click Xilinx Tools menu and select Repositories. 
  • Click the New button in the upper left corner.
  • Browse to the edk_user_repository and click OK



First stage boot loader

FS-Boot is a simple bootloader developed by PetaLogix, intended to serve as the primary bootstrap mechanism when the MicroBlaze CPU first boots. It is recommended for most applications that require a ready-to-run boot solution.
In a typical system runtime scenario, FS-Boot's primary purpose is to bootstrap the main system bootloader (such as U-Boot) from flash memory.
In the board bringup phase, FS-Boot may also be used to download an initial bootloader image (e.g. U-Boot), for first-time boot.

Adding FS-boot

To add fs-boot to our system click the File menu and select <New> and select <Xilinx C Project>. Select FS-BOOT from <Select Project template> and click next.

First we have to add our exported hardware platform to SDK.




We will find the target hardware specification file here: ...../user-platforms/LX9_MB/workspace/hw/LX9_LXN_system.xml




When we click Finish the SDK setup looks like this..




Now we are ready to add the FS boot project.




And the the board support package




Click Finish. This will create PetaLinux BSP fs-boot-bsp_0 and fs-boot_0 application.





Universal Bootloader

Introduction

U-Boot  (Universal Bootloader) is an open source bootloader targeted for embedded system platform across multiple architectures including ARM, PPC, M68K, MIPS and MicroBlaze. The U-Boot project is maintained by DENX Software Engineering and is hosted at Sourceforge. U-Boot bootloader supports a wide range of tools and facilities targetted for embedded systems.

Configure PetaLinux BSP for U-boot

Right click on the fs_boot_bsp_0 project in the Project Explorer.




Select Board Support Package Settings. Make sure PetaLinux is selected.




Configure fs-boot settings

The fs-bootloader (fs-boot_0) is used to fetch U-Boot image from the U-Boot partition in the flash memory to main memory and will run the U-Boot from main memory when system boots up. To do this the start address of U-Boot in flash memory must be given.

  • Right click on the fs-boot_0 project in the Project Explorer
  • Select C/C++ Build settings
  • Select the Tool Settings tab
  • Set configuration profile at the top of the page to [All configurations]
  • Click Symbols under MicroBlaze gcc compiler
  • In the Defined symbols box click the Add button (with the plus sign)
  • In the Enter Value window, enter CONFIG_FS_BOOT_OFFSET=<value>. This value must match the offset from the start of the flash memory to the boot partition as set in the PetaLinux system configuration menu, under <System Settings->Flash Partition Table>. If we haven't changed anything the value will be 0x200000.



How to find the Flash Partition Table

See Configure Software Platform further on in this document.

No vector table needed

As fs-boot is a simple bootloader it does not require setting up vector tables. This can be done in the following steps:

  • Click Miscellaneous under MicroBlaze gcc linker
  • Enter <-Zxl-mode-novectors> in the Linker field.
  • Click Apply




Set fs-boot to Release profile

  • Right click on the <fs-boot_0> project in the Project Explorer
  • Select Build Configurations
  • Choose Set Active and select <Release>

Build the fs-boot project

When we build the fs-boot project XSDK also runs PetaLinux BSP generation tools. These tools automatically generate the software platform configuration files required in the sebsequent board bringup stages.

  • Right click on the fs-boot_0 project in the Project Explorer
  • Select Build project
  • Wait for the build to finish

Finalising the FPGA bitstream

At this stage, the hardware platform is ready and properly configured and the fs-boot executable binary is ready, but not initialise to BRAM yet. This following section documents how to initialise the fs-boot to BRAM and create the bitstream. 

  • Start XPS if not already running.
  • In the Project tab of the project information area, expand the <Elf Files> option.
  • Double click on the microblaze_0 item.
  • A Select Elf file window will pop up and allows us to select which Elf file to be used to initialize the BRAM.
  • Find the fs-boot executable created by XSDK.
  • Click OK to close the Elf file window.
  • Select Device Configuration menu and select <Download Bitstream> to create the download.bit file which has the fs-boot initialised to BRAM and program the FPGA.



Download bitstream



Workspace directory structure

This is what our workspace looks like.



We are now ready to create the PetaLinux SDK software platform for building a Linux system customized to our new hardware platform. See the next chapter.


Top  Previous Next


Posted at 17:04 by

MiguelF
December 11, 2013   10:02 AM PST
 
Hello.

I'm trying to compile a bsp following these great tutorials.

The problem is that I need to include 9 uart16550 instances. The compilation gives the following error:

ERROR:EDK - petalinux () - Unsupported number of uart16550 IPs : 9

Do you know if there is a workaround for this problem?

Thank in advance.
 

Leave a Comment:

Name


Homepage (optional)


Comments




Previous Entry Home Next Entry