Development Environment Embedded Linux Primer Ch 1&2

Similar documents
Assignment 1: Build Environment

Quick Start Guide for BeagleBone. Table of Contents. by Brian Fraser Last update: Sept 24, 2017

EE516: Embedded Software Project 1. Setting Up Environment for Projects

DTK2410 Specification

IoT with Intel Galileo Gerardo Carmona. makerobots.tk

MicroEmbedded Technologies, Pune. A user manual for Using the BeagleBone Black with Linux Host.

Quick Start Guide for BeagleBone Black. Table of Contents. by Brian Fraser Last update: Summer, 2015

Linux. For BCT RE2G2. User Guide. Document Reference: BCTRE2G2 Linux User Guide. Document Issue: Associated SDK release: 1.

Wiring an LED Guide for BeagleBone (Black/Green) Table of Contents. by Brian Fraser Last update: November 16, Target Linux Kernel: 4.

EX L-8 User Guide

Lab2 - Bootloader. Conventions. Department of Computer Science and Information Engineering National Taiwan University

LotOS Framework. Getting Started Guide for Banana Pi. Copyright (C) 2015 ilbers GmbH Revision 1.1,

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Linux Command Line Primer. By: Scott Marshall

Pengwyn Documentation

Linux Essentials Objectives Topics:

Lab Working with Linux Command Line

This document guides the user through: 1. Setting up and configuring networking for the BeagleBone black or green with the host.

Lab6 GDB debugging. Conventions. Department of Computer Science and Information Engineering National Taiwan University

Exercise 1: Basic Tools

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

December 1, 2015 Jason Kridner

StampA5D3x/PortuxA5/PanelA5. Quickstart Guide

SAMA5D3x-CM Instruction to program images with PEEDI

pcduino V3B XC4350 User Manual

Chap2: Operating-System Structures

CODESYS Control for BeagleBone SL

Computer Systems and Architecture

Labs instructions for Enabling BeagleBone with TI SDK 5.x

Perl and R Scripting for Biologists

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Beaglebone green User Manual

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

Introduction to Linux

Getting Started with PetaLinux SDK

LinkSprite Technologies,.Inc. pcduino V2

Avnet Zynq Mini Module Plus Embedded Design

3 Connection, Shell Serial Connection over Console Port SSH Connection Internet Connection... 5

Getting Started with BeagleBoard xm

CISC 220 fall 2011, set 1: Linux basics

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Introduction to Linux

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

TQ2440 Development Platform Manual

ELE409 SPRING2018 LAB0

Matrix 500 Quick Installation Guide

Itron Riva Dev Mini Kit Getting Started Guide

Overview of the Raspberry Pi Models 3B & 2B

Dell IoT Gateway 5500 Edge MicroServer Setup Guide

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

M-508 Quick Installation Guide. Screw: Φ 3 mm

Jade IdeaBoxx. The quickstart kit to jumpstart development. Fujitsu Semiconductor America Inc.

1. Conventions in this tutorial Introduction Check and change configuration settings as needed Start Digi ESP...

BeagleBone Black USB Expansion RS232 Module Cape Coolgear, Inc. Version 1.1 September 2017 Model Number:

Problem Set 1: Unix Commands 1

Introduction to Linux

PAC-5010 Programmable Automation Controller User Guide

CENG393 Computer Networks Labwork 1

The Unix Shell & Shell Scripts

BE230E1. Software Programming Guide. Rev Bolymin, Inc. All Rights Reserved.

Getting Started Guide. Installation and Setup Instructions. For version Copyright 2009 Code 42 Software, Inc. All rights reserved

LTC Data Converter Board For The Arrow SoCKit Linux Application User s Guide

Parallel Programming Pre-Assignment. Setting up the Software Environment

Appliance Guide. Version 1.0

Computer Systems and Architecture

Introduction to the Itron Riva Dev Kits

Ftp Get Command Line Windows 7 Bootable Usb

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

GIGABYTE. Software Reference Guide for MP30 (APM) Platform R01. Document Version:

Introduction of Linux

Android System Development Training 4-day session

Introduction to Linux

User Guide Linux for AT91CAP9-STK Version 1.1. User Guide LINUX FOR AT91CAP9-STK VERSION: 1.1 1/11

Operating Systems Linux 1-2 Measurements Background material

10/02/2015 PetaLinux Linux Image Network Connection

LPC1788 Mio Board. The functional details of the board are as follows-

Z-Stack Linux Gateway Quick Start Guide Version 1.0

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

Jade IdeaBoxx. Product Manual

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

Introduction to Supercomputing

CS-541 Wireless Sensor Networks

ARDUINO YÚN MINI Code: A000108

Embedded Linux. A Tour inside ARM's Kernel

First Steps. esom/sk4 esom/3517 Embedded Linux Starter Kit

Matrix. Get Started Guide V2.0

AT-501 Cortex-A5 System On Module Product Brief

Rs-Pi 7 USB- Hub & I2C 1-Wire User Manual

CS356: Discussion #1 Development Environment. Marco Paolieri

Lab 1: Introduction to Linux Networking

μc/probe on the element14 BeagleBone Black

Itron Riva Dev Software Development Getting Started Guide

XLink Kai Raspberry Pi Beginners Tutorial

参考資料. LinkSprite.com. pcduino V2

Arm-based palm-sized industrial computers with 2 serial ports and 2 LAN ports. Features and Benefits. Certifications

EyeCheck Smart Cameras

Lab 1. OMAP5912 Starter Kit (OSK5912)

Transcription:

Development Environment Embedded Linux Primer Ch 1&2 Topics 1) Systems: Host and Target 2) Host setup 3) Host-Target communication CMPT 433 Slides #3 Dr. B. Fraser 18-05-05 2 18-05-05 1 Host & Target Host and Target Host Development PC Native Compiler: Run compiler on host to build for host: $ gcc hello.c -o hello Cross Compiler: Target Embedded device.. $ means Linux prompt on host... $ arm-linux-gnueabihf-gcc hello.c -o hello Many "cross" tools: Run on host, work with target: Ex: arm-linux-gnueabihf-gdb 18-05-05 3 18-05-05 4

Host & Target Tool naming: arm-none-linux-gnueabihf-gcc target architecture vendor (company) Optional ABI:.. Standard specifying how the program will: layout data types in memory.. (passing arguments, returning values). perform system calls GNU EABI (embedded ABI) hf = Hardware Floatingpoint gcc = Tool Host vs Target Resources Resource Host OS Ubuntu 16.04 Debian Linux Target (BeagleBone Green) CPU ~3Ghz Quadcore X86 1Ghz ARM Cortex-A8 RAM 16,000 Meg 512 MB Storage 2,000 GB harddrive 4GB emmc Screen 23" LCD, multi-monitor None; could use a cape. Input Keyboard, mouse 1 button, USB Cape for lots! Audio In/out via cape Ethernet 1,000 BaseT 100 BaseT Other DVD, Card reader usd Card, GPIO emmc: Embedded (on a chip) flash storage (MultiMedia... Card) TTL 3.0V: Terminal Screen & Keyboard TTL serial & SSH Cost ~$1,000 ~$50-$100 Transistor... to transistor logic 18-05-05 5 18-05-05 6 Working with Hardware Many embedded systems run on custom hardware. Interact with the world using: GPIO:.. Set a pin to be on (3.3V) / off (0V), or read it. I 2 C:.. Communicate with chips like an accelerometer. A2D:.. Read analog voltages (Ex: battery voltage). PWM:.. Generate a sort-of analog voltage. Host Setup For us, the Zen cape allows us to use all of these! 18-05-05 8 18-05-05 7

Host Setup Basic Linux Commands Run Linux. A definition of "Crazy": Developing for embedded Linux on non-linux host. Run Linux as main OS, or in virtual machine (VM). VMWare Player: lets you run Linux inside Windows in a VM. Selectively configure resources the VM gets. Able to run multiple VM's on one machine. Confusion: Host PC: Computer you code on. Host OS: In VM context means real OS on computer. 18-05-05 9 Command Description ls pwd Directory listing. Arguments: -a for all, -l for long (all info) Examples ls ls -l Show current directory name pwd mkdir Make a directory mkdir mynewplace cd Change directory cd mydir cd \mydir cd.. cd \ chmod Change file permissions chmod a+r hello.a chown Change file owner chown bfraser hello.a sudo Execute as administrator sudo chown bfraser hello.a apt-get Install a program sudo apt-get install somepackage gedit Edit a file (new window) gedit hello.cpp & ifconfig Configure networking ifconfig eth0 192.168.0.1 mount Mount a file-system mount -t nfs \ 192.168.0.103:/opt/img /mnt/img nano Edit a file in the terminal nano hello.cpp 18-05-05 10 Basic Linux Commands Command Description Examples cat Dump to screen cat hello.cpp less tar Show on screen with "more.." prompt. ('q' to quit) less hello.cpp Archive management (unzip) tar xvfj hello.tar.jz2 find List all files in sub-folders find grep Search for a string grep "Hello world" *.cpp (Shift \) Pipe: redirect output to second program's input find grep hello.cpp > Redirect output to a file ls > listing.txt rm Remove a file (delete) rm listing.txt echo Print some text echo hello dmesg Show kernel boot messages dmesg Recommended Linux Shell Tutorial: Software Carpentry: http://swcarpentry.github.io/shell-novice/ 18-05-05 11 Communication How can we access the target? We need a Linux terminal, but how? Micro-B plug, xxx, Mini-B plug, Standard-A receptacle, Standard-A plug, Standard-B plug 18-05-05 12

Communications Overview Serial Port: Access target's Linux terminal via the serial port (Need serial port when can't use SSH: booting or errors) Serial protocol for +/-12V 0-3V (or 0-5V) serial protocol. Zen cape has TTL over USB (micro USB port) Host uses Screen program show serial data. Ethernet Network: RS232 Serial Protocol RS232 voltages -12V = 0; +12 = 1 Each bit has fixed time dependant on bitrate Starts with start bit(s) (+12v); ends with stop bit(s) (-12v) Diagram shows a K character (0x4B) Ethernet Ethernet TTL over USB 18-05-05 13 RS = Recommended Standard 18-05-05 Image: https://commons.wikimedia.org/w/index.php?curid=6101703 14 RS232 Real World View Oscilloscope trace of K (0x4B), 1 start bit, 8 bits, 2 stop bit. HW has to be sync d to know where to sample each bit. Timing errors lead to garbage characters. 18-05-05 15 By Haji akhundov - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=18444265 RS-232 & TTL Settings RS-232 is a "Serial Port" Connector is often a DB9 / DB25 with bi-directional data: can Tx and Rx at the same time. Zen cape has FTDI chip to convert TTL serial data from the microprocessor to USB; host has drivers to access it like a normal serial port. (Called TTL-232) BeagleBone Serial Port Settings Speed (bps), #bits/byte, parity check, # stop bits:.. < 14kBytes / second! Optional handshaking to control data transmission. We'll always use no handshaking 18-05-05 16

Screen Program Run Screen on host to view target's serial port. Screen Usage on host Install: $ sudo apt-get install screen Run: $ sudo screen /dev/ttyusb0 115200 Screen Operations Show help: Control a + (no control)? Quit: Control a + (no control) \ Linux Ports /dev/ttyusb0 how Linux supports TTL over USB... No sudo access in lab host OS. (Can run screen there without sudo) To show kernel messages when USB device connected:.. Don't type $ Demo: Screen, dmesg. 18-05-05 17 Network BeagleBone can network in two ways: Ethernet Mostly use Ethernet over USB; later need full Ethernet. Order USB to Ethernet adapter now? 2 USB Micro: On Zen: Serial On BBG: Power & Ethernet over USB Normal RJ45 Ethernet connection. BBG uses DHCP to get an IP address: DHCP =.. DHCP client program: dhclient Is running by default. Ethernet over USB Micro USB cable allows BeagleBone to mount on host PC as a network connection. Host has IP: 192.168.7.1 Target has IP: 192.168.7.2 18-05-05 18 Networking Basics Find out IP settings: $ ifconfig # ifconfig $: means host PC command # means target command ssh to open a terminal to the target $ ssh root@192.168.7.2 ping to test TCP/IP connection to board: $ ping 192.168.7.2 # ping 192.168.7.1 Files over the Network Mounting directory over NFS NFS:.. Use NFS to make application testing MUCH faster: Transferring ~50 meg takes ~1min vs ~1hr. On the target, mount the host's directory and.. Pro Tip: Always look for ways to make development faster. Demo: ifconfig, ping, SSH 18-05-05 19 Demo NFS mount 18-05-05 20

Review Summary 1. What is cross compiling? 2.What does sudo do? 3.What will we use TTL over USB for? Develop on host, deploy on target. Cross compile on host for target. Target has limited resources, but custom hardware: GPIO, I2C, A2D, PWM. Host running Linux in VM or native Communicate to target using TTL-232 and Ethernet: DHCP, Ping, TFTP, NFS. 4.Explain why NFS is useful. 18-05-05 21 18-05-05 22