Blackfin buildroot development

Slides:



Advertisements
Similar presentations
Drivers and the kernel1-1 Drivers and the kernel UNIX system has three layers: m The hardware m The operating system kernel m The user-level programs Kernel.
Advertisements

PIKA Technologies Inc. PADS for the PIKA WARP Appliance March 2009.
9.0 EMBEDDED SOFTWARE DEVELOPMENT TOOLS 9.1 Introduction Application programs are typically developed, compiled, and run on host system Embedded programs.
U-Boot and Linux Kernel Debug using CCSv5
LINUX-WINDOWS INTERACTION. One software allowing interaction between Linux and Windows is WINE. Wine allows Linux users to load Windows programs while.
Hands-on with the Sitara Linux SDK This presentation provides a hands-on overview of the Sitara Linux SDK. It focuses on the software and tools found in.
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1.
Handheld TFTP Server with USB Andrew Pangborn Michael Nusinov RIT Computer Engineering – CE Design 03/20/2008.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
29 April 2005 Part B Final Presentation Peripheral Devices For ML310 Board Project name : Spring Semester 2005 Final Presentation Presenting : Erez Cohen.
OS Spring’03 Introduction Operating Systems Spring 2003.
Buildroot CS-423 Dick Steflik. buildroot uClibc – C library for developing for embedded Linux –much smaller than GNU C tools to make a cross-compilation.
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
COMPUTER SYSTEM LABORATORY Lab4 - Bootloader. Lab 4 Experimental Goal Learn how to build U-Boot bootloader for PXA /10/8/ 142.
Part 1 Using the ARM board And start working with C Tutorial 5 and 6
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Embedded Systems Principle of Debugger. Reference Materials kl.de/avr_projects/arm_projects/#winarmhttp://
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
AT91SAM9261-EK WinCE 6.0 DEMO ATMEL AT91 Application & Support Group
Hands-On Virtual Computing
Computer System Laboratory
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
1 Introduction to ARM A15 Linux DSP Platform Software Apps Team 04/19/2013 1TI Confidential - NDA Restrictions.
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
AT91SAM9261-EK WinCE 5.0 DEMO ATMEL AT91 Application & Support Group Version 1.O February 2007.
Beagle Board Fast Boot Hui Chen Keji Ren Dec 10 th, 2009 EE382N-4 Project.
Porting Operating Systems Phan Duy Hùng (PhD) ES Lecturer – Hanoi FPT University.
(1) A Beginner’s Quick Start to SIMICS. (2) Disclaimer This is a quick start document to help users get set up quickly Does not replace the user guide.
Drexel University Software Engineering Research Group Git for SE101 1.
Version Control Systems academy.zariba.com 1. Lecture Content 1.What is Software Configuration Management? 2.Version Control Systems (VCS) 3.Basic Git.
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
COMPUTER SYSTEM LABORATORY Lab6 - Root Filesystem.
Unit - VI. Linux and Real Time: Real Time Tasks Hard and Soft Real Time Tasks Linux Scheduling Latency Kernel Preemption Challenges in Kernel Preemption.
1 uClinux course Day 2 of 5 Using configuration tools and the tool chain.
Intro to Git presented by Brian K. Vagnini Hosted by.
LOGO Linux Installation. Linux Distribution Including shells, libraries, tools, compiler, servers, applications. Redhat, Fedora, Mandrake, SuSE, Debian,
Implementation of Embedded OS Lab3 Porting μC/OS-II.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 – Bootloader + OS Kernel 2015/10/27/ 25 1.
Implementation of Embedded OS
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
Blackfin Linux development
1 Setup and Compile Linux Kernel Speaker: Yi-Ji Jheng Date:
Embedded Software Design Week II Linux Intro Linux Kernel.
Testing framework for BlackFin on uClinux Grace Pan.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
RTLAB Kang. Moo jin Using Open Source Tools for AT91SAM7X Cross Development.
Linux on ARM7TDMI or Nothing is as easy as it looks Helicon technologies Ltd. How to run uClinux on NXP LPC22xx.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux system development.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The U-boot bootloader Michael.
Operating System Kernel Compilation
Computer System Laboratory
#FOSDEM Februari 4, 2017 brabo
Outline Installing Gem5 SPEC2006 for Gem5 Configuring Gem5.
Implementation of Embedded OS
Computer System Laboratory
Implementation of Embedded OS
Computer System Laboratory
Building Android OS Topics: Building Android and Kernel
Operating System Kernel Compilation
Operation System Program 4
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Computer System Laboratory
Lecture9: Embedded Network Operating System: cisco IOS
Computer System Laboratory
Computer System Laboratory
Operating System Kernel Compilation
Lecture9: Embedded Network Operating System: cisco IOS
Presentation transcript:

Blackfin buildroot development 12/17/08 Blackfin buildroot development Aaron Wu ADI Open Source Solution

Agenda Getting started Blackfin Linux toolchain Blackfin Das-Uboot Host machine environment How to get help Linux on bf609 quick start Blackfin Linux toolchain Download and install Tollchain for 3 formats Blackfin Das-Uboot Download, config, and compile Boot modes Blackfin Linux kernel & App Overview for Linux kernel/App running on Blackfin NO-MMU App development on Blackfin Linux comparing to ARM or Intel Arch Play with buildroot Overview Build an example target Buildroot skeleton Add a package in buildroot Make patch for a package work with git to submit patch Work with buildroot & package upstream Track tasks with sourceforge

Linux on Blackfin – Geting started 12/17/08 Linux on Blackfin – Geting started

Set up host machine Q: I have the Ubuntu installed on my host PC, what’s the next? A: Set up the host environment Install required packages on host PC: http://docs.blackfin.uclinux.org/doku.php?id=installing_linux Install Blackfin Linux toolchain: http://docs.blackfin.uclinux.org/doku.php?id=toolchain:installing tar jxvf blackfin-toolchain-2013R1-RC1.i386.tar.bz2 tar jxvf blackfin-toolchain-elf-gcc-4.3-2013R1-RC1.i386.tar.bz2 tar jxvf blackfin-toolchain-uclibc-default-2013R1-RC1.i386.tar.bz2 Q: Where do I get the source code and binary? A: Download the release for u-boot, toolchain, and Blackfin Linux source code and binary from http://blackfin.uclinux.org/ Note: Be sure to use the matched version of u-boot, toolchain and Linux, mix different versions up lead to unknown problems, and use the latest release version.

How to get help – support model Q: I have a problem, I need support A: Asking questions on support forum: (English and Chinese) http://ez.analog.com/community/dsp/software-and-development-tools/gnu-toolchain- blackfin For toolchain http://ez.analog.com/community/dsp/software-and-development-tools/linux-blackfin For Linux distribution http://ez.analog.com/community/dsp/software-and-development-tools/uboot-blackfin For U-boot Before submitting your question: Read the FAQ: http://docs.blackfin.uclinux.org/doku.php?id=faq Search the forum for historical issues When submitting your question, provide information: 1)detailed information for hardware environment and software version 2)log for the failure, along with your kernel and distribution configuration files   3)steps description to reproduce your failure Helpful document wiki: docs.blackfin.uclinux.org mailist: linux-devel@analog.com

quick start Set up the hardware environment Set up the host machine Switch to the appropriate boot mode Connect the serial cable, eth cable, power supply. Set up the host machine Set up the terminal for Linux, minicom, 57600-8-N-1, HW flow control off Set up the tftp server for Linux 1) sudo apt-get install tftp-hpa tftpd-hpa 2) sudo vi /etc/default/tftpd-hpa, set the TFTP_DIRECTOR to you own directory 3) sudo service tftpd-hpa restart Run Default image U-boot environment setting Run Linux uImage Update the bootloader Transfer the image to board by Ethernet bfin> tftp 0x1000000 u-boot.ldr Flash to the serial Flash bfin> sf probe 2 ? bfin> sf erase 0x0 0x100000 bfin> sf write 0x1000000 0x0 $SIZE Initially Load the bootloader bfin-uclinux-ldr -l u-boot.ldr

Linux on Blackfin – Toolchain 12/17/08 Linux on Blackfin – Toolchain

Installing toolchain Where to get https://sourceforge.net/projects/adi-toolchain/files 3 files needed, choose the right one according to your host pc hardware and software architectures blackfin-toolchain-2013R1-RC1.i386.tar.bz2 blackfin-toolchain-elf-gcc-4.3-2013R1-RC1.i386.tar.bz2 blackfin-toolchain-uclibc-default-2013R1-RC1.i386.tar.bz2 An example procedure tar jxvf blackfin-toolchain-2013R1-RC1.i386.tar.bz2. tar jxvf blackfin-toolchain-elf-gcc-4.3-2013R1-RC1.i386.tar.bz2 tar jxvf blackfin-toolchain-uclibc-default-2013R1-RC1.i386.tar.bz2 cp -fr opt/uClinux /opt Add to the PATH export PATH=$PATH:/opt/uClinux/bfin-uclinux/bin:/opt/uClinux/bfin-linux- uclibc/bin:/opt/uClinux/bfin-elf/bin Or edit the file ~/.bashrc to include the above line 8 8

Toolchain for 3 binary formats FLAT bfin-uclinux-gcc Binary Flat files known as BFLT, relatively simple and lightweight executable format based on the original a.out format. BFLT files are the default file format in embedded Linux, automatically link the application with the Linux run time libraries, usually for static library linking. FDPIC ELF bfin-linux-uclibc-gcc originally developed by Unix System Laboratories and has become the standard in file formats. The ELF standard has greater power and more flexibility than the BFLT format. However, they are more heavyweight, requiring more disk space and having a small run-time penalty, usually for dynamic library linking. Bear metal bfin-elf-gcc used for Non-OS applications, nothing to do with Linux, one example is code running on coreB of BF561/BF609. FLAT and FDPIC can be selected from choosing different configuration file 9 9

Linux on Blackfin – U-boot 12/17/08 Linux on Blackfin – U-boot

U-boot – src download/compile 12/17/08 U-boot – src download/compile Git clone and check out the source git clone git://git.code.sf.net/p/adi-u-boot/code adi-u-boot-code git checkout 2013R1 Configure and compile vim include/configs/bf609-ezkit.h make bf609-ezkit Flash the u-boot By gnICE bfin-jtag cable gnICE detect businit YOUR_BOARD detectflash flashmem 0x20000000 u-boot.ldr By uart-utils: http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:loading#ldr-utils bfin-uclinux-ldr -l u-boot.ldr connect to minicom, the uart version of u-boot is running use the runing u-boot to tftp load and flash bootloader 11 11

Bootmode selection 12 Support various booting methods How to select 12/17/08 Bootmode selection Support various booting methods Parallel NOR Flash SPI NOR Flash SD/MMC card (BF60x) UART How to select H/W design, Input Pins BMODE[2:0] to select the booting mode ROM code will check the BMODE Pins and choose the source accordingly In board configuration file, define the CONFIG_BFIN_BOOT_MODE properly 12 12

12/17/08 Linux on Blackfin

Linux running on Blackfin – Big Picture 12/17/08 Linux running on Blackfin – Big Picture Userspace Application (Customer) Opensource Library C Library (uClibc) Linux Kernel (supervisor) Device Driver Device Driver Framework B / Hardware http://blackfin.uclinux.org/

Application porting and development API difference Use vfork instead of fork, and _exit instead of exit A fork produces a parent and child. Each have individual task control structures and each can be scheduled independently by the kernel. When we have an MMU the parent and child eventually occupy different physical memory spaces. The MMU maps different physical memory addresses to identical virtual memory addresses and copies the data from parent to child Using thread APIs Memory allocation Because there is no virtual memory map, an uClinux application should try not to allocate and free dynamic memory continually, to avoid fragmenting memory. Application are recommended to malloc all memory at start up or manage allocation by itself, nedmalloc is one option for memory pool. Fixed stack size default stack size for FLAT binaries is 4k (0x1000) bytes default stack size for FDPIC ELF binaries is 128k (0x20000) bytes Stacksize can be modified with flthdr like “flthdr -s 8192 application”

12/17/08 Play with Buildroot

Buildroot introduction 12/17/08 Buildroot introduction Made up of many configure scripts, make files and directories, allows you to easily add configuration options, documentation, dependencies, and integrate into Makefiles Tree overview board/ — board specific kernel configuration files boot/ — boot loader config scripts and make files; not used for blackfin config/ — the buildroot default configuration for different boards dl/ — the source tarballs that are downloaded during building process docs/ — how to configure and customize buildroot fs/ — config scripts and make files to build different kinds of root file system image. linux/ — config scripts, make files to build Linux kernel linux/linux-kernel/ — the Linux kernel source linux/patch/ — Patches to apply to the proper version of Linux kernel source output/ — All building output files are put under this folder output/build/ — Contain binaries of all software packages output/images/ — Contain file system images and kernel booting up images. output/staging/ — locally installed (“staged”) target libraries; they may be linked with target applications later output/target/ — the compiled root file system image packages/ — config scripts and make files to download and build libraries and applications testsuites/ — scripts for testing various boards/packages/kernels/etc... scripts/ — misc buildroot compile helper scripts target/ — vendor-specific configuration files and build instructions toolchain/ — GNU toolchain and GDB config scripts and make files 17 17

Build a target 18 Build a target 12/17/08 Build a target Build a target http://docs.blackfin.uclinux.org/doku.php?id=buildroot:build-system:build_a_target git clone git://git.code.sf.net/p/adi-buildroot/code adi-buildroot-code cd adi-buildroot-code git checkout 2013R1 git submodule update –init cd linux/linux-kernel/ cd ../../ cd testsuites/ make bf609-ezkit_defconfig make cp output/images/uImage /tftpboot/ 18 18

Buildroot skeleton 19 Configure buildroot and linux-kernel 12/17/08 Buildroot skeleton Configure buildroot and linux-kernel make menuconfig make linux-menuconfig Buildroot skeleton configs/bf609-ezkit_defconfig .config Config.in packages dl output/build/ output/build/*/.stamp_* Linux/linux-kernel 19 19

Add a package in buildroot 12/17/08 Add a package in buildroot diff --git a/package/Config.in b/package/Config.in --- a/package/Config.in +++ b/package/Config.in @@ -714,6 +714,7 @@ source "package/snowball-init/Config.in" source "package/bfin-dma/Config.in" +source "package/sport_test/Config.in" source "package/bfin-canned-demos/Config.in" diff --git a/package/sport_test/Config.in b/package/sport_test/Config.in --- /dev/null +++ b/package/sport_test/Config.in @@ -0,0 +1,4 @@ +config BR2_PACKAGE_SPORT_TEST + bool "bfin common sport test" + help + Bfin common sport test suite diff --git a/package/sport_test/sport_test.mk b/package/sport_test/sport_test.mk +++ b/package/sport_test/sport_test.mk …. more detail check the patch file 20 20

Make patch for buildroot package 12/17/08 Make patch for buildroot package Get the original version of codege organization type cp adi-buildroot-code/dl/alsa-utils-1.0.26.tar.bz2 . tar jxvf alsa-utils-1.0.26.tar.bz2 Make a copy of the original code and make changes on it cp alsa-utils-1.0.26 alsa-utils-1.0.26_new vim alsa-utils-1.0.26/alsactl/init_utils_run.c Diff to make a code patch diff –Nurp alsa-utils-1.0.26 alsa-utils-1.0.26_new > alsa-utils.patch Move the diff generated patch to buildroot package directoryzation type cp alsa-utils.patch buildroot/package/multimedia/alsa-utils 21 21

Work with git 22 Frequently used git commandsackage organization type 12/17/08 Work with git Frequently used git commandsackage organization type git clone git checkout git branch git pull git commit git reset --hard Format and submit a patch git add alsa-utils.patch git commit –a –s add the comment git format patch -1 edit the patch to add comments git send-email git push git send-email set up exmple: www.freedesktop.org/wiki/Software/PulseAudio/HowToUseGitSendEmail 22 22

23 Work with buildroot & package upstream Buildrootion type 12/17/08 Work with buildroot & package upstream Buildrootion type website: http://buildroot.uclibc.org/ subscribe to mailist: http://lists.busybox.net/mailman/listinfo/buildroot Other packages website: by google mailist: by google Submit patches to upstream better to work on the git repository when possible, and send patches with git send-email submit patch to both buildroot and specific package mailist/maintainer. 23 23

24 Use sourceforge to track the tickets 12/17/08 Use sourceforge to track the tickets https://sourceforge.net/p/adi-buildroot/buildroot-up/tasks 24 24