introduction to embedded software - skku...

28
Introduction to Embedded Software Practice #1 Kernel Sources, Raspberry Pi Board Setup Dongkun Shin Embedded Software Laboratory Sungkyunkwan University http://nyx.skku.ac.kr/

Upload: others

Post on 21-May-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Introduction to Embedded Software

Practice #1 Kernel Sources, Raspberry Pi Board Setup

Dongkun Shin Embedded Software Laboratory

Sungkyunkwan University http://nyx.skku.ac.kr/

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Introduction

• Schedule

- Tuesday, 15:00 ~ 16:15

- Room #400202 (Semiconductor Building)

• Course homepage

- http://www.icampus.ac.kr/

- Class materials will be posted on http://nyx.skku.ac.kr/

2

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

TAs

• Contact

- Email: [email protected]

• Office Hours

- Mon/Fri, 19:00 ~ 21:45, Room #400309 (Semiconductor Building)

- You can visit the lab any time during office hours, but it is better to make an appointment in advance via email

3

TA Email

Yunji Kang [email protected]

Kwangbae Lee [email protected]

Sooyun Lee [email protected]

Hoseung Kim [email protected]

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Practical Labs Schedule

4

03/12 Kernel sources, Raspberry Pi board setup

03/19 Kernel configuration, Kernel building

04/02 Writing modules

04/16 Linux device model for an I2C driver

04/18 Communicate with the Nunchuk over I2C

05/07 Expose the Nunchuk functionality to user space

05/21 Minimal platform driver and access to I/O memory

05/28 Output-only serial port driver, Sleeping and handling interrupts in a device driver

06/04 Locking, Investigating kernel faults

06/24 Term project due date

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Materials

5

Raspberry Pi 3 Board B & Micro 5pin cable Micro SD card & Reader Arduino Uno

Odroid VU & Power cable & HDMI Nunchuk & Nunchuk adapter

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Materials

• Host PC (Linux Environment)

- Virtual machine

- College of Software’s 4-Node Cluster Server

• Raspberry Pi 3 Board B

- MicroSD card, MicroSD-to-USB adaptor

- Micro 5pin cable

- HDMI cable, Monitor (Odroid View)

6

Kernel Sources

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Kernel Source Code• Install git packages

• Downloading kernel source code

- https://github.com/raspberrypi/linux

✓ Branch rpi-4.14.y

8

$ git clone --depth=1 -b rpi-4.14.y https://github.com/raspberrypi/linux

$ sudo apt install git gitk git-email

$ git clone https://github.com/raspberrypi/linux $ git checkout rpi-4.14.y

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Exploring the Kernel Source Code

• Exploring manually

- find command: used to search for files from the command line

9

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Exploring the Kernel Source Code

10

- grep command: searches plain-text data sets for lines that match a regular expression

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Exploring the Kernel Source Code

• Using kernel source indexing tools

- ctags

✓ Definition of a variable (e.g., a function, variable, or macro)

✓ Recognizes symbols in various files and connects them

- cscope

✓ Provides searching functionalities within a specific directory

11

$ ctags -R

$ cscope -R

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Exercise

1. Find the Linux logo image in the sources

2. Find who the maintainer of the MVNETA network driver is

3. Find the declaration of the platform_device_register() function

12

Raspberry Pi Board Setup

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Raspberry Pi Board Setup• Installing operating system images

- Download the imagehttps://www.raspberrypi.org/downloads/

14

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Raspberry Pi Board Setup• Writing an image to the SD card

- Download Etcher and install

15

Raspbian Stretch Lite image

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Raspberry Pi Board Setup• Setting interfacing options

16

$ sudo raspi-config

piraspberry

User

pi

Password

raspberry

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Raspberry Pi Board Setup

17

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Raspberry Pi Board Setup

18

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Raspberry Pi Board Setup

19

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

WiFi Setup• Search for an accessible peripheral wireless network

(AP, wireless router)

• Edit /etc/wpa_supplicant/wpa_supplicant.conf to configure the wireless network

- Copy the resulting contents of to /etc/wpa_supplicant/wpa_supplicant.conf

20

$ sudo iwlist wlan0 scan

$ wpa_passphrase ssid password

$ sudo su $ wpa_passphrase ssid password

>> /etc/wpa_supplicant/wpa_supplicant.conf

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Once your Raspberry Pi is connected to the Internet

Connecting via SSH

21

LAN connection

WiFi connection

College of Software’s 4-Node Cluster Server

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

Hosts• swin.skku.edu

• swui.skku.edu

• swye.skku.edu

• swji.skku.edu

• How to connect?

- PuTTy

- SSH (Secure Shell)

23

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

PuTTy• Remote access tool (SSH)

• https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

24

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

PuTTy

• Host Name (or IP address)

- [email protected]

• Port

- 1398

25

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

PuTTy

• Initial password: your last name in English capital letters

- ex. 홍길동(Hong Gildong) → “HONG”

26

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

File Transfer• WinSCP

- https://winscp.net/eng/download.php

27

Introduction to Embedded Software SWE3027-41

Practice #1 2019-03-12

File Transfer

28

LinuxWindows