Computer System Laboratory

Slides:



Advertisements
Similar presentations
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.
Advertisements

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.
Overview Basic functions Features Installation: Windows host and Linux host.
Intel Do-It-Yourself Challenge Hello World with the Arduino IDE Nicolas Vailliet Intel.
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
SINGLE BOARD COMPUTERS -KEVIN JOSE. WHY DO WE USE THEM? Good performance at low price GPIO capability to interact with the outside world Small form factor,
Silicon Labs ToolStick Development Platform
U-Boot Debug using CCSv5 In this session we will cover fundamentals necessary to use CCSv5 and a JTAG to debug a TI SDK-based U-Boot on an EVM platform.
How Hardware and Software Work Together
Computer System Laboratory
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
Please Note: Information contained in this document is considered LENOVO CONFIDENTIAL For Lenovo Internal Use Only Do Not Copy or Distribute!! For Lenovo.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Sensor 2014/9/23/ 13 1.
Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.
COMPUTER SYSTEM LABORATORY Lab6 - Root Filesystem.
7200 Samsung Confidential & Proprietary Information Copyright 2006, All Rights Reserved. 1/16 OfficeServ 7200 Enterprise IP Solutions Data Server S/W Upgrade.
Intro to Raspberry Pi A Southwest Florida Hackerspace Workshop Presented by: Russell Benzing & Eric Schiffli.
Lab 8 Department of Computer Science and Information Engineering National Taiwan University Lab8 - Root Filesystem 2015/11/10/ 22 1.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
Hands-on Session 1 Boot Linux Connect to Linux via USB-to-UART and Putty Compile and run a simple program.
Implementation of Embedded OS
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
Raspberry Pi Project Control Your Home Lights with a Raspberry Pi.
Embedded Software Design Week II Linux Intro Linux Kernel.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The GRUB bootloader Michael.
An Embedded Wireless Mini-Server with Database Support Presented by: Amit Kumar.
The GRUB bootloader Michael Opdenacker Thomas Petazzoni Free Electrons
After Construction Name: Per #:.
By Ganesan Alagu Ganesh Feb 26, 2008
Operating System Kernel Compilation
Workshop on Raspberry Pi 3
Computer System Laboratory
bitcurator-access-webtools Quick Start Guide
Computer System Laboratory
Chapter Objectives In this chapter, you will learn:
RASPBERRY PI WORKSHOP.
Implementation of Embedded OS
IoT 101 with Raspberry Pi and Azure
Computer System Laboratory
Seamless Guest OS's and more!
By Ganesan Alagu Ganesh Feb 21, 2008
Course on Embedded Systems Introduction
Computer System Laboratory
Implementation of Embedded OS
Implementation of Embedded OS
Data Server S/W Upgrade Samsung Electronics Co., Ltd.
Computer System Laboratory
Implementation of Embedded OS
Lecture 6 Uli Raich UCC semester 2017/2018
Computer System Laboratory
Implementation of Embedded OS
Engineering Innovation Center
Raspberry Pi.
مقدمة في الاردنيو د فضل الاكوع.
Operating System Kernel Compilation
Intro to Micro Controllers
Software Setup & Validation
Implementation of Embedded OS
bitcurator-access-webtools Quick Start Guide
Computer System Laboratory
Workshop GPIO I2C SPI Panic1 woensdag 10 april 2019.
Computer System Laboratory
Beginning Raspberry Pi
Computer System Laboratory
Arduino Leonardo Setup
Operating System Kernel Compilation
Setting up a Webcam on a Raspberry Pi
WINDOW 7 INSTALLATION Prepared By:- Mr. Pawan Kumar
Presentation transcript:

Computer System Laboratory Lab2 - Bootloader / 20

Experimental Goal Cross-compile U-Boot. Connect to Raspberry Pi via an USB-TTL cable. Boot Raspberry Pi via U-Boot. / 20

Environment Host Machine Target Machine Build Machine OS: Windows Raspberry Pi (2 or 3) Build Machine A computer with a SD card slot OS: Ubuntu 15.10 (or above) 64-bit / 20

Software Required Host Machine Build Machine PL2303 Driver PuTTY Build Machine U-Boot Source Code Prebuilt Raspberry Pi Firmware Raspberry Pi bootloader configuration (config.txt) GCC Cross-Compiler targeting ARM GParted You may find all software on the CSL Course Software. / 20

Hardware Checklist Raspberry Pi Power supply Micro SD card and card reader USB-TTL cable / 20

Overview In Lab1, we installed the official OS on RPi, and prepared an additional set of I/O components for RPi to interact with it. In this lab, we treat RPi as an embedded device. First, we cross-compile U-Boot, a bootloader for embedded systems, in the build machine and copy it to the SD card of RPi. Second, we plug a serial cable between RPi and the host machine, and open a terminal in the host machine to interact with RPi. Third, we boot RPi via the bootloader (no OS kernel yet). / 20

Cross Compilation Many embedded systems do not have user interfaces nor compilers to build programs. As the result, people build programs for embedded systems in another machine, and then copy the built programs to the storage devices used by embedded systems. A compiler that compiles programs for other platforms is call a “cross-compiler”, and a machine that runs cross-compilers is called a “build machine”. Even if the ISA of the build machine is the same as the ISA of the machine on which the built programs run, the cross-compiler is still more suitable than the native compiler in the build machine. The reason is left for the Lab question. You may reference the article in the reference page. / 20

Setup the ARM Cross-Compiler In the build machine, install the GCC cross-compiler toolchain. % sudo apt-get update % sudo apt-get install build-essential lzop u-boot-tools bc curl libncurses5-dev % sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 # ignore lib32bz2-1.0 in Ubuntu 16.04 % sudo apt-get install gcc-arm-linux-gnueabihf Set environment variables. % export ARCH=arm % export CROSS_COMPILE=arm-linux-gnueabihf- / 20

Check the Cross-Compiler The target is arm-linux-gnueabihf. Version above 4.9.x is required. (Ubuntu 15.10 has a 5.2.1 GCC.) Execute the following command to check. % arm-linux-gnueabihf-gcc -v / 20

Build U-Boot Download and extract the U-Boot source code. Configure and start compiling. % cd u-boot-2016.09 % make clean % make rpi_2_defconfig % make # You may append –j<n> to accelerate. For example, you execute “make –j4” if you have 4 CPUs. After the process finishes, you get the U-Boot image named u-boot.bin. / 20

Format the SD card (1) Install and launch GParted. % sudo apt-get install gparted % sudo gparted Unmount and than delete the original partitions. / 20

Format the SD card (2) Create two partitions. 1st partition: filesystem = fat32, size = 64MiB, label = boot 2nd partition: filesystem = ext4, size = all remained space, label = root / 20

Format the SD card (3) Apply all operations. / 20

Setup the Boot Partition (1) Download and extract the Raspberry Pi firmware. Copy the U-Boot image to the boot directory and rename it. % cp u-boot-2016.09/u-boot.bin firmware-1.20160315/boot/uboot.img Download config.txt to the boot directory. Replace the line “#kernel=” with “kernel=uboot.img”. The value of the “kernel” variable should match the filename of the U-Boot image (i.e. uboot.img without quotes). / 20

Setup the Boot Partition (2) Copy all files in the boot directory to the 1st partition of the SD card. Now your SD card is bootable. Eject the SD card and plug it to RPi. / 20

Plug the USB-TTL Cable There are several modules of USB-TTL. The one we use is PL2303. In the host machine, download and install the PL2303 driver. Plug the USB-TTL cable between RPi and the host machine. USB-TTL GND (black)  GPIO GND (pin6) USB-TTL RX (white)  GPIO TXD0 (pin8) USB-TTL TX (green)  GPIO RXD0 (pin10) / 20

Connect to Raspberry Pi If you have installed the PL2303 driver, you will find a new COM port in the device manager after you plug the USB-TTL cable. Launch PuTTY. Enter the following options and click open. There is nothing output yet since the RPi is not on. Connection type = Serial Serial port = the COM port Speed = 115200 / 20

Boot Successfully Plug the RPi power supply to turn on RPi. You will see the message in PuTTY. Hit any key to stop autoboot in 2 seconds, and you will drop into the U-Boot command line. / 20

Lab Requirement Show that you can execute some U-Boot commands. / 20

Reference Why do I need a Cross Compiler? Das U-Boot -- the Universal Boot Loader config.txt - Raspberry Pi Documentation USB to TTL / 20