Home

Embedded Linux Getting Started Guide

image

Contents

1. which mkpimage The SoC EDS toolset provides the embedded_command_shell sh script that sets all necessary PATH entries for the included tools Please run it if the mkpimage is not in the PATH The SD image script needs to be run with root privileges using sudo command By default when sudo is invoked it uses a default PATH variable which may not have the SoC EDS PATH entries In this case the tool would fail reporting it could not find the mkpimage tool In order to avoid this problem please instruct sudo to preserve the current PATH by executing the following command S sudo viso and removing resetting environment and adding the PATH to the list of environment variables to be kept Defaults env reset Deraulrts envy keap oco PAME Alternatively the sudo can be instructed from command line to keep the current path S suclo PASS BATEE Usage The provided tool named make_sdimage sh will create a 2GB SD card image with three partitions e p1 being a FAT partition when the kernel and the device tree are located e p2 the Linux root file system as an ext3 partition March 2013 Altera Corporation Page 9 e p3 the partition used by the SocFPGA ROM to load the preloader The same partition is used by the preloader to load the u boot image Here s how the script is used sudo make sdimage sh k uImage socfpga dtb SE EE EE EE Si ES 0 eC image sokn Where k accepts a comma separated l
2. o J28 J29 set toward the power switch o J30 set away from the power switch Rest of jumper settings Number Name Setting J5 9V Open J6 JTAG_HPS_SEL Open J8 JTAG_SEL Shorted J9 UART Signals Open J13 OSC1_CLK_SEL Shorted J15 JTAG_MIC_SEL Open J31 SPI_I2C Open March 2013 Altera Corporation Page 12 2 Make sure the DIP switches are configured as described below and shown in the following pictures March 2013 SW1 all switches set toward the board edge SW2 all switches set away from the corner of the board SW3 all switches set toward the board edge SW4 JTAG ENABLE o Each switch enables a connection to the scan chain when its corresponding switch is set away from the board edge off o Set for programming the FPGA using the on board USB Blaster II ON OFF ON OFF leaving the FPGA and MAX connected to JTAG im 4 Lo Z H m d G S ISS HSN Td DD te gt LGE LAAAAAA E 29 SAH 2385 4 A MOP e m We gt ssw AAS 2 E it REN Kr V d H a AAEE EE E j LADERS i TEE mn ve cS ett ais wasn Altera Corporation Page 13 3 Use a mini USB to USB cable to connect UART on the board to the host PC May need to install Cypress UART to USB driver 4 Power on the board 19V power supply 5 Open a serial terminal program i e minicom and set the baudrate to 57600 8 N 1 6 With the microSD card slotted
3. 7 Transfer helloworld ELF to the running eLinux by issuing following command on the target oe tii G lt host LS mie helloworlel o0 Run helloworld on the target A0 e chmod x helloworld March 2013 Altera Corporation Page 16 helloworld Debug Hello World Linux application Run GDBSERVER on the helloworld ELF in the target cd lt directory of helloworld ELF gt Just binm qdeserver Host lt port of your choice gt helloworla ae d i Y Run GDB client in the host cd lt directory of helloworld ELF gt arm linux gnueabihf gdb helloworld oC o Ce In GDB command line connect to the target via TCP IP oe target remote lt target IP gt lt the port you chose gt 4 Now you can use execute standard GDB operations such as breakpoint and single stepping Typical commands are e s for step into a function e n for next instruction e b for breakpoint March 2013 Altera Corporation
4. JA DTE RA Document Revision History Embedded Linux Getting Started Guide Date Version Description March 8 2013 1 0 Released 2013 Altera Corporation Page 2 Contents Document Revision History 1 OVER VI OW gege ee ee 3 ang gert EE 3 Release Contents and Location seis svesccinnsindisncneasennobannenedunnacmneninmapeunaaus ania EE 3 Nee IL 4 ELIE VISE UG EE 5 THOSE SOCUP MEET 5 EE DEE Ee 5 UBUNTU senseniem n e e a E a e aE e i e a aaas 5 SeEtUP VOCUO EE 6 Build Kernel MOOS EE 6 Programming EE EE 8 le UE EC 8 ET 8 Booting Linux on the SOC FPGA CV Devkit 11 Hello World Linux application using solo Linaro toolchain ccceceesseeeeesseeeeceseeeeeeeeseaeeeeeees 15 Build Hello World Linux application 15 Debug Hello World Linux application EE 16 March 2013 Altera Corporation Page 3 Overview Introduction This document walks through the basic software flow to have a Hello World Linux application running on the Cortex A9 processors in the Cyclone V SoC FPGA development kit This guide focuses purely on getting a basic Linux application running and has no interaction with programmable logic FPGA portion of SoC FPGA Hence to simplify things we use e No FPGA design e Pre built bootloader Linux software images for the Cyclone V SoC FPGA development kit For topics such as hardware flow for custom logic and preloader customization please see other doc
5. in observe Linux booting on the UART console March 2013 Altera Corporation Page 14 d COM4 PuTTY Lo 2 ee 7 Login as root with no password and you are good to go March 2013 Altera Corporation Page 15 Hello World Linux application using solo Linaro toolchain Build Hello World Linux application 1 In your host linux machine write a simple Hello World application called helloworld c include lt stdio h gt int main int argc WOsLGl argu A printf Hello te ebe ee return 0 2 Set up linux host environment for linaro cross compiler Ex export PATH lt your extracted bsp package location gt linaro gcc Dinero acn Linn BEE tata EE EE PA An example of the command if you installed at the default opt altera linux export PATH e pt altera linux linare gee linare arm linux gm eabihnt 4 7 2012 11 20121123 linuxz bins PATK 3 Build helloworld c with the Linaro cross compiler KS arm linux gnueabihf gcec 0 helloworld helloworld c 4 Connect the target board to the same network as your host machine 5 Set up Ethernet interface on the target if the DHCP server in your network did not automatically configured an IP address ifconfig ethO lt static IP address in the same subnet as your host machine and not used gt 6 Set up TFTP server on the host and copy helloworld ELF file to the server folder e g tftpboot
6. is a PC computer with minimum 2GB RAM and 20GB hard drive with one of the following OS es installed e CentOS 6 3 e Ubuntu 12 04 LTS We have tested the Yocto package with above distributions Be warned that Ubuntu has been tested with Yocto but is not an officially supported distribution for Altera ACDS Other distributions may work as well but not guaranteed to be work free Generally the latest version is preferred CentOS These are the required packages that need to be installed on a fresh DVD based installation of CentOS 6 3 If a different installation method was used e g from a CD then more packages might be necessary S sudo yum update S sudo yum groupinstall Development Tools sudo yum install texi2html texinfo glibc devel chrpath If the host machine runs the 64bit version of the OS then the following additional packages need to be installed S gudo yum tmstall glibc 1636 libgec 1686 lilosiccles 1686 ellailloe devel i686 ncurses libs i686 zlib i686 Ubuntu These are the required packages that need to be installed on a fresh DVD based installation of Ubuntu 12 04 LTS dE dE sudo apt get update S sudo apt get upgrade S sudo apt get install sed wget cvs subversion git core coreutils unzip texi2html texinfo libsdl1 2 dev docbook utils gawk python pysqlite2 diffstat help2man make gcc build essential g desktop file utils chrpath libgll mesa dev libglul mesa dev mercurial autoco
7. ist of files Here we show the kernel and the device tree blob p the preloader raw binary as generated by Yocto or the U Boot Makefile b the bootloader image as generated by Yocto or the U Boot Makefile r the directory where the file system is located o the image name In case you need help please run SE The following presents a complete script usage cd yocto build tmp deploy images SUC Opt alter linux bun make s imagdeshy k Umage soc tpdancyo loneo ct by N SEENEN EE EE EEN EE EE Eeer Ee gGnuleabiy SE SE SNE 0 SC image otn The log messages will be similar with the following EE EE EE make ecimage cas intos Creating particion e makom EE make Fsdiimagem SAk ANRO Creating Preloader boot leader imager a Maken pre loser img vol NOSO Ee home dumitru yocto build tmp deploy images u boot spl Scetpoam cyclones otn MeV alone EE March 2013 Altera Corporation Page 10 make EE make wsa sage shg intos Copying preloader image and bootloader to PALCLCLON a 4 make ecimeage shs imio Copying OS Lles Etras make Sdimage snig intos Creating Coor file System ss makee EE EE ENO S March 2013 Altera Corporation Page 11 Booting Linux on the SoC FPGA CV Devkit 1 Make sure that following shunts shorting jumpers are installed as described below Pictures are shown for clarity here as well Clock select CLKSELx o J26 J27 set toward the power switch Boot select BOOTSELx
8. nf automake groff libtool xterm sudo apt get install uboot mkimage March 2013 Altera Corporation Page 6 If a different installation method was used e g from a CD then more packages might be necessary If the host machine runs the 64bit version of the OS then the following additional packages need to be installed sudo apt get install ia32 libs Setup Yocto 1 Download the linux socfpga 13 02 src bsx source package 2 Install the package It should be installed in a publicly accessible location as this step can be shared by all users on the system or on the filesystem if your company is using a network share The default install location is opt altera linux However if you wish to use this location you will likely need root access in order to access this directory spat to downloaded file gt Ee opt altera linux 3 Install a local set of yocto recipes This could be done in a shared location but if someone wants or needs to modify them they should have their own version The default install location for this is within your home directory Sore alvera linu bin install altera soctoga sue eh yocto 13 02 4 Create a build directory By keeping this separate from your yocto source you can erase your entire build without fear of deleting your yocto sources Also you can have several build directories each with its own configuration all based on the same yocto source The script serves 2 purpose
9. s First it creates the new build directory using Altera s default configuration Secondly it sets some shell variables that are required for building If you start a new shell you will need to run these commands to set these shell variables again l yoerto 13 02 source altera sinit yocro 15 02 owilel Build kernel rootfs u boot In order to build u boot from within the build directory S bitbake u boot In order to build linux from within the build directory S bitbake linux altera In order to build the root filesystem March 2013 Altera Corporation Page 7 S bitbake altera image The first time may take up to several hours depending on your host machine Once finished all images should be generated in build tmp deploy images March 2013 Altera Corporation Page 8 Programming Flash To boot the linux images on SoC FPGA development kit you need to write the images you just built with Yocto into one of the three Flash devices SDMMC NAND and QSPI For this guide we will use SDMMC due to its easy detachability For SDMMC boot all boot images will be located inside SD MMC card A script is provided with the release that will create an SD card image ready to be deployed Requirements The script relies on a tool named mkpimage which creates the correct preloader image that the SoCFPGA Boot ROM accepts This tool is provided with the SoCEDS release and must be on your search path PATH To find out run
10. umentations such as Golden System Reference Design User Guide Release Contents and Location Altera provides Linux BSP support for the Cyclone V SoC FPGA Development Kit and provides the following e Linux kernel 3 7 e Preloader e u boot version 2012 10 e Yocto version Danny e The packages for the root file system e The tool chain Linaro GCC v4 7 Yocto is used to build the sources of the kernel the u boot and the root file system There are many source code packages available under the Yocto project Should you enable a package that is not provided with our BSP it will be downloaded SVN GIT etc If you are behind a proxy you need to make sure the network configuration of your Linux host is ready The Linux BSP release is composed of three packages documentation sources and binaries Package Name Contents linux socfpga 13 02 src bsx Source code self extracting linux socfpga 13 02 bin tar gz Binaries Embedded Linux Getting Started Guide this doc Linux BSP User Manual 13 02 pdf Linux BSP Release Notes 13 02 pdf Yocto Danny User Manual 13 02 pdf Documentation March 2013 Altera Corporation Page 4 You can find the release at http software altera com linux_socfpga Prerequisites SoC EDS 13 0 or above installed from http software altera com soceds March 2013 Altera Corporation Page 5 Build Yocto Host Setup The recommended development platform

Download Pdf Manuals

image

Related Search

Related Contents

PC-ACE Pro32 User`s Manual  Whirlpool GS5SHAXNT User's Manual  取扱説明書  Have you been yearning for an alarm clock that is petite  Abaqus Scripting User`s Manual  Acer Aspire TimelineUltra 581T-33216G12Makk  Instrucciones para cumplimentar la ficha de características  LaserFlash Plus Manual  

Copyright © All rights reserved.
Failed to retrieve file