Embedded Systems KUT1-1
Embedded Systems
- Target Install & Setup- Develop. Environments
Prof. Myung-Eui Lee (A-405)[email protected]
Embedded Systems KUT1-2
Raspbian Installation: Windows PC
Raspbian» Raspbian installation with Windows PC.» Raspbian is the official supported operating system for Raspberry Pi.» 2 Installation options : 1. NOOBS or 2. OS Image Write» SD card should be formatted using SDFormatter.
https://www.sdcard.org/downloads/formatter_4/
Embedded Systems KUT1-3
Raspbian Installation
1. NOOBS » Beginners Option : New Out Of the Box Software
1-1 General Installation : with a kbd, a mouse, and a monitor» 1. Download NOOBS file : “NOOBS_v3_2_0.zip”
https://www.raspberrypi.org/downloads/noobs/
» 2. Extract the files from the zip.» 3. Drag all the files in the extracted NOOBS folder and drop them onto
the SD card drive.
Embedded Systems KUT1-4
Raspbian Installation
» 4. The necessary files will then be transferred to your SD card.» 5. When this process has finished, safely remove the SD card and insert
it into your Raspberry Pi.» 6. Connect the power.» 7. Select an operating system “Raspbian” : Desktop
Default : Full Desktop » 8. Raspbian “Desktop” version is installed.
Embedded Systems KUT1-5
Raspbian Installation
1-2 Headless Installation : without a kbd, a mouse, and a monitor» 1. Same procedure as previous General Installation no. 1, 2, 3 and 4.» 2. Edit the “recovery.cmdline” file in the root NOOBS directory.» 3. Append “silentinstall” to the arguments list.» 4. The /os folder (Raspbian full desktop version) will be installed
automatically.» 5. Remove the SD card from PC and insert it into your Raspberry Pi.» 6. Connect the power.» 7. Wait for 15-20 minutes, and then green LED will be off.» 8. Raspbian “Full Desktop” version is installed.
Embedded Systems KUT1-6
Raspbian Installation 2. OS Image Write
» Raspbian comes pre-installed with plenty of software for education, programming and general use
* Headless Installation * : in this class» 1. Download OS Image file (Desktop) : “2019-07-10-raspbian-
buster.zip” - 3 image files : Full Desktop, Desktop, Lite Desktophttps://www.raspberrypi.org/downloads/raspbian/
Embedded Systems KUT1-7
Raspbian Installation
» 2. Extract the files from the zip. Then you can find “2019-07-10-raspbian-buster.img” file.
» 3. Download and Install Win32 Disk Image softwarehttps://sourceforge.net/projects/win32diskimager/
» 4. Connect an SD card reader with the SD card inside.» 5. Select the image file and write.
Embedded Systems KUT1-8
Raspbian Installation
» 6. When this process has finished, safely remove the SD card.» 7. Insert the SD card into your Raspberry Pi.» 8. Plug the micro USB power supply, and Raspbian Desktop starts to
install.» 8. Wait for a few minutes, and then green LED will be off.» 9. Raspbian “Desktop” version is installed.
* Note- At this time, we do not know what is going on the Raspberry Pi board.- No keyboard, No mouse, and No display
Embedded Systems KUT1-9
Raspberry Pi connection
Raspberry Pi Connection» Connect the wired LAN
No keyboard, no mouse, and no monitor : Headless Raspberry Pi Setup Characteristics of Embedded Systems
USB Keyboard & Mouse
Ethernet : IP Router
HDMI Monitor : DVI AdapterUSB Power
SD Card
Embedded Systems KUT1-10
Lab. Network Configuration Network IP Address
» Windows PC : 192.168.0.10» Ubuntu Virtual Machine : 192.168.0.20» Raspberry Pi Target : 192.168.0.30
Embedded Systems KUT1-11
Remote Terminal(Character): Ethernet
PuTTY Remote Terminal Install : Host» Identify the target IP address
IP Router DHCP allocated the Target IP Address : 192.168.0.XX
» #apt install putty» Run “putty” » Enter Target IP address :
192.168.0.XX» Click “open” for SSH connection.
Embedded Systems KUT1-12
Remote Terminal(Character): Ethernet
You will meet “Putty Fatal Error” message PuTTY Remote Terminal “Connection Refused”
[Problem] Resolve the previous SSH connection fatal error by using the headless setup method (no kbd, no mouse, no display).» Cause : SSH is disabled in the Raspberry Pi» Find the solution
Embedded Systems KUT1-13
Remote Terminal(Character): Ethernet
[Solution] As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually.
» The risk with an open SSH port is that someone can access it and log in by “pi” account.
» https://www.raspberrypi.org/documentation/remote-access/ssh/
Enable SSH on a headless Raspberry Pi » For headless setup, SSH can be enabled by placing a file named
“ssh”, without any extension, onto the boot partition of the SD card from another computer.
» When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled and the file is deleted. The content of the file does not matter; it could contain text, or nothing at all.
Embedded Systems KUT1-14
Remote Terminal(Character): Ethernet
PuTTY Remote Terminal : Host» Run “putty” & enter Target IP address
(192.168.0.xx)» Click “open” » Login “pi” user & Passwd “raspberry”
Change Pi Password : Target» $ passwd» Enter current password» Enter new password
Embedded Systems KUT1-15
Remote Terminal(Character): Ethernet
Setup root Password : Target» $ sudo passwd root» Enter new password» $ su root» Enter root password
Login “root” user from SSH : Target» Putty SSH can not login as root» Edit sshd configure file» #vi /etc/ssh/sshd_config» Change to “PermitRootLogin yes”
Embedded Systems KUT1-16
Target IP Address Setup
Setup IP Address : Target» # vi /etc/dhcpcd.conf» Type or paste the following lines on the top of the file
interface eth0static ip_address=192.168.0.30static routers=192.168.0.1static domain_name_servers=192.168.0.1 220.68.64.1
» # reboot
Check new IP address» # ifconfig
Embedded Systems KUT1-17
Target IP Address Setup
From now on, you can login the target as root user and IP address 192.168.0.30
» Run “putty” & enter Target IP address (192.168.0.30)» Click “Default Settings” save & “open” » Login “root” user
Embedded Systems KUT1-18
Remote Terminal Option : SSH
A remote terminal option on the host PC is the built-in “ssh” client
The “ssh” server is preinstalled on the Raspberry Pi Target
» # apt install openssh-server : if not, manually install it # ssh [email protected] & enter a password
Embedded Systems KUT1-19
Remote Terminal Option
Hangul works perfectly without any setup on the Raspberry Pi Target board as it is.- toggle: shift-space
» File, Directory, Edit, and Display
» Windows PC can use SSH client also from command prompt
Embedded Systems KUT1-20
Raspbian Localisation setup » Setup Locale, and Keyboard Layout» Run “raspi-config”
» Select “4. Localisation Options” » Select “I1 Change Locale”» Deselect “en_GB.UTF-8 UTF-8” by using Space Key : default GB
» Select both “en_US” and “ko_KR” UTF-8
Raspbian Locale Setup
<Target board>
root@raspberry:~# raspi-config
Embedded Systems KUT1-21
Raspbian Locale Setup
Raspbian Localisation setup -cont» Move the cursor to <ok> by using Tab key and press Enter.» Select Default Locale “en_US.UTF-8” and press “enter”.
If you select “ko_KR.UTF-8”, no “Korean” Keyboard Menu in next “I3 Change Keyboard Layout” : bug!
» You must reboot for Hangul Keyboard Setup No reboot, no “Korean” Keyboard Menu in next “I3 Change Keyboard
Layout”
Embedded Systems KUT1-22
Raspbian Locale Setup Raspbian Localisation setup -cont
» Run “raspi-config” again» Select “I3 Change Keyboard Layout”» Select “Generic 105-key PC(Intl.)” “Other”
» Select “Korean” “Korean – Korean (101/104 key compatible)”
Embedded Systems KUT1-23
Raspbian Locale Setup Raspbian Localisation setup -cont
» Select “The default for the keyboard layout” “No Compose key”
» “Use Control+Alt+Backspace to terminate the X server” “Yes”
Embedded Systems KUT1-24
Raspbian Date & Time Setup Raspbian Time zone Setup
» Select “4. Localisation Options” » Select “I2 Change Timezone”» Select “Asia” “Seoul” “Finish”
» Check date & time : # date
Target Installation is completed !!!» Note : English & no hangul kbd input
Embedded Systems KUT1-25
Host and Target Communication
1. RS-232 Serial : Minicom, SSH, PuTTY, TeraTerm etc. 2. USB or Parallel : JTAG (Joint Test Access Group)
» Debug(Device test) and flash fusing (jflashmm) 3. Ethernet(tcp/ip) : tftp, NFS (SSH, PuTTY, TeraTerm
etc.)
Ethernet
Serial
JTAG
Host System Target System
Embedded Systems KUT1-26
Lab. Network Configuration Network IP Address
» Windows PC : 192.168.0.10» Ubuntu Virtual Machine : 192.168.0.20» Raspberry Pi Target : 192.168.0.30
Embedded Systems KUT1-27
NFS Server NFS Server Install : Host
» #apt install nfs-kernel-server» #vi /etc/exports» Add “/nfs *(rw,sync,no_root_squash)” : * for all IP access
» #mkdir /nfs & cat > test.txt» #chmod –R 777 /nfs» #exportfs –a» #systemctl enable nfs-kernel-server» #systemctl status nfs-kernel-server
NFS Client : Target» #mkdir /share» #chmod –R 777 /share» #apt install nfs-common» #mount –t nfs 192.168.0.20:/nfs /share
* Add “192.168.0.20:/nfs /share nfs x-systemd.automount,noauto 0 0” in “/etc/fstab” file for automount
Embedded Systems KUT1-28
NFS Server
NFS Client : Windows PC» Move to “제어판” “프로그램“ “프로그램 및 기능“
» Click “Windows 기능 켜기/끄기“» Check “NFS용 서비스“» Click “확인”
» Windows “Menu” “Widows 시스템”
» Run “실행“» Enter “\\192.168.0.20\nfs”
Embedded Systems KUT1-29
samba server Samba Server Install : Target
» # apt install samba samba-common-bin» # mkdir –m 777 /samba ( = mkdir /samba + chmod –R 777 /samba )» # vi /etc/samba/smb.conf & add the next paragraph
» # smbpasswd –a root & enter password» # systemctl enable smbd or #service smbd start » # systemctl status smbd or # service smbd status
[samba]Comment = Pi shared folderPath = /sambaBrowseable = yesWriteable = Yesonly guest = nocreate mask = 0777directory mask = 0777Public = yesGuest ok = yes
Embedded Systems KUT1-30
samba server Samba Client : Ubuntu VM Host
» “Files” “Other Locations” “Connect to Server”» Enter “smb://192.168.0.30/samba” & Press “Connect” button
Samba Client : Windows PC » \\192.168.0.30\samba
Embedded Systems KUT1-31
Remote Terminal(Graphic): Ethernet
RDP(Remote Desktop Protocol) Server Install : Target» #apt install xrdp
RDP Client : Host PC» “Remmina” RDP Client included
in Ubuntu Package already» Install it if not (#apt install remmina)» Run “Remmina” RDP Client» Click “+” at the upper left corner» Enter Server IP “192.168.0.30”» Click “Save as Default” & “Connect”
Embedded Systems KUT1-32
Remote Terminal(Graphic): Ethernet
Remote Desktop Screen » Press “Cancel” , & that’s all
Embedded Systems KUT1-33
Remote Terminal(Graphic): Ethernet
RDP Client : Windows PC» Windows “Menu” “Widows 보조프로그램”» Run “원격 데스크탑 연결“» Enter Server IP “192.168.0.30”» Click “Connect”» Enter Username & Password
Embedded Systems KUT1-34
The Host & Target is prepared to study
from now !!!
Embedded Systems KUT1-35
etc.
Chrome Web browser» Run Chrome Web as root user, but no response !!!» #vi /etc/chromium-browser/default» Add CHROMIUM_FLAGS="--no-sandbox --user-data-dir”» Disable sandbox in current user data dir.(= root)* Note: The sandbox is a C++ library that allows the creation of sandboxed processes —processes that execute within a very restrictive environment. The only resources sandboxed processes can freely use are CPU cycles and memory. Sandboxing, in very simple terms is related to security, especially to prevent from malware effects on the OS.
» Open the url www.daum.net» You will meet a garbage character» Install Hangul fonts» # apt install fonts-unfonts-core & #reboot
Embedded Systems KUT1-36
etc.
Raspbian Update & Upgrade » System Update & Upgrade
Make the image file for fast recovery» Run “Win32 Disk Imager”» Specify “Image file” and
“Device”» Click “Read”
Embedded Systems KUT1-37
Options : Raspberry Pi Hangul
Not necessaryYou use the raspberry pi as a PC
Embedded Systems KUT1-38
Raspberry Pi Hangul 3 Ways Hangul Option
» 1. Hangul Keyboard Input Only : Hangul Kbd + English System Nothing to do : just use the ubuntu built-in terminal Putty or xrdp : follow the next “1.Hangul Keyboard Input”
» 2. Hangul Rasbian System : Hangul Kbd + Korean System Putty or xrdp : follow the next “2.Hangul Rasbian System”
» 3. Hangul Rasbian System : Hangul Kbd + Korean System Only xrdp at first install : follow the next “3.Hangul Rasbian System” The most easy way
1. Hangul Keyboard Input : Using App. or raspi-config[1] Using GUI App. : xrdp» Connect the target by using “Remina”» Open “Applications Menu”
“Preferences” “Raspberry Pi Configuration”
» Move to “Localisation” “Set Locale” » Select Language “en(English)”
Embedded Systems KUT1-39
Raspberry Pi Hangul» Move to “Set Keyboard”» Choose Model, Layout, and Variant as
same figure» Require reboot* Note : this procedure is useless because
the same locale is already set in prior locale setup.
[2] Using raspi-config : putty» Connect the target by using “Putty”» # raspi-config» Same procedure of “Rasbian Locale Setup” : English and Hangul Keyboard* Note : this procedure is useless also because the same locale is already set in prior locale setup.» Next procedure is to install “Hangul Input Method”* Note : “Hangul Input Method” is applied to above both cases, & can setup only GUI App., not Putty.
Embedded Systems KUT1-40
Ibus Input Method Setup – common setup in both cases» Install “ibus” Input Method : ibus, fcitx, nabi, …etc» # apt install ibus-hangul » Reboot
» Select “Menu” “Preferences” “Ibus Preferences” or #ibus-setup
» Select “Input Method” “Add”» Select “Korean” “Hangul” & Press “Add”» Click “Korean-Hangul” & Press “Preferences”
Raspberry Pi Hangul
Embedded Systems KUT1-41
Ibus Input Method Setup –cont.» Default “Dubeolsik” & Check ”Commit in word unit”» Default Eng.-Kor. Toggle key : Shift-Space or Hangul(한/영)» Press “Apply”, “OK”, & “Close”» Reboot & input Korean
• Note : - Do not need to select “Menu” “Preferences” “Input Method” - Hangul(한/영) key is not working
Raspberry Pi Hangul
* English System & Hangul kbd input is finished !!!
Embedded Systems KUT1-42
2. Hangul Rasbian System
[1] Using GUI App. : xrdp» Connect the target by using
“Remina”» Open “Applications Menu”
“Preferences” “Raspberry Pi Configuration”
» Move to “Localisation” “Set Locale”
» Select Language “ko(Korean)” & Character Set “UTF-8”
» Reboot
Raspberry Pi Hangul
Embedded Systems KUT1-43
[2] Using raspi-config : putty» Connect the target by using
“Putty”» # raspi-config» Tab “<Ok>” & Enter Key
* Ko. & En. already installed.» Select “Default locale” to
“ko_KR.UTF-8”» Tab “<Finish>” after the locale
change» Reboot
Raspberry Pi Hangul
* Korean System & Hangul kbd input is finished !!!
Embedded Systems KUT1-44
3. Hangul Rasbian System [xrdp only at first install]» Press “Next” at welcome
message» Set Country, Language, &
Timezone» You must “Update Software”,
then default input method “fcitx” will be installed automatically
» Reboot
Raspberry Pi Hangul
Embedded Systems KUT1-45
* Note: » Still now, we setup whole process as “root” user» There is no Hangul in upper right corner when you log in “pi”
user & can not input Hangul
» You must run “Ibus 환경설정” & Add “한국어-Hangul” again as you have learned it before
Raspberry Pi Hangul
Embedded Systems KUT1-46
Other Tools for Embedded Systems
Embedded Systems KUT1-47
bootp [not for this class]
bootp install : Host» rpm –qa | grep bootp» rpm –ivh bootp-2.4.3-7.i386.rpm » bootptab file : /etc/bootptab
tag symbols : man bootptab
» bootp file : /etc/xinetd.d/bootp
» service xinetd restart» bootp command : at target
service bootps{disable = nosocket_type = dgram}
pxa270:ht=ether:ha=0x000b7a88f890:ip=210.68.65.120:sm=255.255.255.0
Embedded Systems KUT1-48
tftp [not for this class]
tftp server install : Host» rpm –qa | grep tftp» rpm –ivh tftp-server-0.17-9.i386.rpm» tftp file : /etc/xinetd.d/tftp
» service xinetd restart» cp /images/zImage /tftpboot» tftp zImage kernel : at target» flash kernel
service bootps{socket_type = dgram
:server_args = -s /tftpbootdisable = no}
Embedded Systems KUT1-49
minicom [not for this class]
minicom setup : host & Target» #apt install minicom» #minicom –s Serial port setup
A - Serial Device : /dev/ttyS0 E - Bps/Par/Bits : 11500 8N1 F - Hardware flow control : No
» Save setup as dfl
Target program upload & run» Cont-A-Z, Send files, zmodem, Space for selection, Enter» ./test-arm
Embedded Systems KUT1-50
JTAG [not for this class] JTAG (Joint Test Action Group)
» Boundary scan = IEEE Standard 1149 = JTAG» IEEE Standard 1149.1
Standard Test Access Port and Boundary-Scan Architecture» JTAG committee was formed by test professionals within
Philips, BT, GEC and others in 1990» JTAG was standardized in 1990 as the IEEE Std. 1149.1-1990» Objectives
Circuit test for the surface mount designs and printed circuit boards using boundary scan
Interconnection test between Integrated Circuits (ICs) installed on boards (modules)
→ could not so easily be probed by testers » Embedding test cells within a device
Examine internal board states without physical contact Program PLDs and Flash memories
Embedded Systems KUT1-51
JTAG Conventional Board Test vs Boundary Scan Idea
Embedded Systems KUT1-52
JTAG Basic Architecture
» Test Access Port (TAP) : JTAG interface (4/5 pin) TDI, TDO, TCK, TMS(Test Mode Select), TRST (optional)
» Instruction Register Receives an instruction through the TDI, decodes it, and selects the
appropriate data register Sets the mode of operation(TMS) for one or more data registers
» Data Registers Several different data registers can be built into boundary-scan
components → Boundary scan reg./ Bypass reg./ Dev ID reg./ User defined reg.,,,,
Two Data Registers are always required to be present on a 1149.1 component:
→ Boundary-Scan Register : Boundary Scan Cell (BSC)→ Bypass Register : short-cut scan path through devices that are not
involved in the test (Bypass instruction) » TAP Controller
Generates internal control signals, 16-state finite state machine 4 groups (16 states) : Reset, BIST, Data reg. update, Inst. Reg. update
Embedded Systems KUT1-53
JTAG
JTAG Components » Test Access Port (TAP)
TDI,TCK,TMS,TRST,TDO» Instruction Register» Data Registers :
Boundary Scan Cell (BSC) Bypass Register
» TAP ControllerInternal Logic
BSC
BSC
BSC
BSC
Bypass Reg.(Data Reg.)
TAP Controller
Instruction Reg.
Mux
TDOTRSTTMSTCKTDI
BSC
Embedded Systems KUT1-54
JTAG BSC 4 different functional modes
1. Normal mode : Mode = 0 2. Update mode : Mode = 1 3. Capture mode : Shift/Load = 0 4. Scan Mode : Shift/Load = 1
DFF
QA
DFF
QAMPX
0
1
MPX
0
1
Data ln
Serial In Shift/LoadClock Update Mode
Data Out
Serial Out
DFF
QA
DFF
QAMPX
0
1
MPX
0
1
Data ln
Serial In Shift/LoadClock Update Mode
Data Out
Serial Out
Embedded Systems KUT1-55
JTAG Host PC Interface : JTAG Cable (printer or usb)
Host (PC) Parallel Port
TDO
TCK
TDI
TMS
nTRST
D0
D1
D3
D4
D5
D6
D7
D2
C1
C2
C3
C0
S3
S6
S7
S5
S4
BASE_ADDRESS : Data Register
Address Decoder
BASE_ADDRESS + 2 : Control Register
BASE_ADDRESS + 1 : Status Register
BASE_ADDRESS278 : LPT1378 : LPT23BC : LPT3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
D0
D2D1
D3
D7
BUSY
C0C1C2C3
S7
Data register
Control register
Status register
TCK D0 LPT pin 2TDI D1 LPT pin 3 TMS D2 LPT pin 4nTRST D3 LPT pin 5TDO BUSY LPT pin 11
Embedded Systems KUT1-56
Debug
Challenges» Target system may be hard to observe» Target may be hard to control» May be hard to generate realistic inputs» Setup sequence may be complex
Tools» Logic Analyzers» Software Debuggers
Monitor Program Breakpoint Program
» In-circuit Emulators (ICE)» ARM’s EmbeddedICE» IDE (Integrated Development Environment)
Embedded Systems KUT1-57
Debug» Logic Analyzers
Used for sampling many different signals simultaneously, and display 0, 1, or changing values for each.
Only offer an historical view of the action of code User cannot change variables or jump to different parts of the program Useful to measure time intervals Fixed amount of buffer memory
→ relates to the depth of the time window for acquiring system execution history in real-time (measure in number of samples it can hold).
→ the deeper the memory, the more data you have to analyze to find the cause of the problem.
» Software Debuggers Monitor
→ A monitor program residing on the target provides basic debugging functions→ The need to have the monitor in ROM on the target system is a significant
problem» Must either be removed from the final product» Or left in ROM at extra cost
Embedded Systems KUT1-58
Debug Break point
→ A breakpoint allows the user to stop execution, examine system state, and change state
→ Replace the breakpoint instruction with a subroutine call to the monitor program» In-circuit Emulators (ICE)
Interface → Host PC : RS232, Parallel Port (Printer), USB, LAN (Ethernet)→ Target : CPU replacement, JTAG, Proprietary
A microprocessor in-circuit emulator is a specially-instrumented microprocessor
Allows you to stop execution, examine CPU state, modify registers ICE is a dedicated hardware for a particular microprocessor (different
processor/different processor module or pod) ICE can be expensive
Embedded Systems KUT1-59
Debug ICE Example
Device Adapter
Host Cable
Emulator Pod
ProcessorModule
Device Socket
Embedded Systems KUT1-60
Debug» ARM’s EmbeddedICE
JTAG-based debugging channel for ARM microprocessors An EmbeddedICE-compatible ARM core with a boundary scan interface and
debug enhancements An external EmbeddedICE Interface Box which links the host development
machine with the debug compatible ARM No target resources or special hardware Low cost solution that does not require dedicated ICE Debug can be performed at full processor speed Full host system access including screen, keyboard and storage for the
target Requires no extra communication channel to debug Host software development and debug tools -> RealView Multi ICE
» IDE (Integrated Development Environment)
Embedded Systems KUT1-61
Flash Fusing
Application S/W : jflashmm
Boot loader source : bootloader(boot)
Boot loader fusing
TargetFlashMemory
jflashmm
Host
Parallel cable
JTAG interface
Line Driver3.3v↔5.0v
123Boot
LoaderDownload
Registers TAP
Chip74HC541
bootboot
JTAG pin
Embedded Systems KUT1-62
Note : Raspbian Setup for SSH SSH Enable
» Run “raspi-config”
» Select “5. Interface Options” » Select “P2 SSH”» Select “Yes” & “Ok”
OR
» Select “Menu” “Preferences” “Raspberry Pi Configuration”» Select “Interfaces”» Select “SSH” and Check “Enable”
<Target board>
root@raspberry:~# raspi‐config
Embedded Systems KUT1-63
Note : Debian Releases https://www.debian.org/releases/index.en.htm