Upload
creola
View
129
Download
4
Embed Size (px)
DESCRIPTION
Embedded System Development Environment II. 임베디드 시스템 개발환경 구성. Embedded System Development Environment II. 호스트 개발환경 구성 네트워크 설정 우분투를 이용한 개발환경 설정시에는 인터넷 연결이 되어야 패키지를 설치할 수 있다 . 통신 테스트 한국 통신 DNS Server : 168.126.63.1. Embedded System Development Environment II. 네트워크 설정 변 경 - PowerPoint PPT Presentation
Citation preview
- 1 -
임베디드 시스템 개발환경 구성Embedded System Development Environment II
- 2 -Huins. R&D Center
Embedded System Development Environment II
호스트 개발환경 구성 네트워크 설정 우분투를 이용한 개발환경 설정시에는 인터넷 연결이 되어야 패키지를 설치할 수 있다 .
통신 테스트
한국 통신 DNS Server : 168.126.63.1
# ping 168.126.63.1
2
- 3 -Huins. R&D Center
Embedded System Development Environment II
네트워크 설정 변경 통신이 정상적으로 되지 안는 경우 네트워크 설정 방법 ( 네트워크 설정은 현재 사용하고 있는 네트워크 구성에 따라 ip 설정을 해 주어야 한다 )
호스트 시스템 ip 설정확인 네트워크가 장치가 정상적으로 설정되어있으면 eth 혹은 wlan 장치가 표시됨
lo : local loopback eth[n] : 유선 이더넷 장치 wlan[n] : 무선랜 장치
# ifconfig
3
root@ubuntu:~# ifconfiglo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:521 errors:0 dropped:0 overruns:0 frame:0TX packets:521 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0 RX bytes:34140 (34.1 KB) TX bytes:34140 (34.1 KB)
- 4 -Huins. R&D Center
Embedded System Development Environment II
우분투에서 ip 네트워크 설정하기 우분투는 Xwindow 의 네트워크 커넥션 메뉴를 통해 네트워크 관련 설정을 할 수 있다 .
4
- 5 -Huins. R&D Center
Embedded System Development Environment II
TFTP 설치 (tftpd-hpa) – 개선된 tftp Trivial File Transfer Protocol(UDP), FTP 보다 가볍고 기능이 단순한 애플리케이션 부트로더에서 부트로더 이미지 혹은 커널을 다운로드 할 경우 이용할 수 있다 .
tftp download
tftp 설정
tftp 서비스 디렉터리 생성
tftpd-hpa 서비스 재시작
# apt-get install tftp tftpd-hpa
# Defaults for tftpd-hpaRUN_DAEMON=“yes”OPTIONS=“-l -s /tftpboot”
# vim /etc/default/tftpd-hpa
# mkdir /tftpboot
# service tftpd-hpa stop# service tftpd-hpa start
5
- 6 -Huins. R&D Center
Embedded System Development Environment II
TFTP 설치 (tftpd) – xinetd 수퍼데몬으로 구동되는 tftpd tftp download
tftp 설정
tftp 서비스 디렉터리 생성
tftpd-hpa 서비스 재시작
# apt-get install xinetd tftpd tftp
service tftp{protocol = udpport = 69socket_type = dgramwait = yesuser = nobodyserver = /usr/sbin/in.tftpdserver_args = /tftpbootdisable = no}
# vim /etc/xinetd.d/tftp
# mkdir /tftpboot
# service xinetd stop | start
6
- 7 -Huins. R&D Center
Embedded System Development Environment II
TFTP 테스트 tftpd-hpa 및 tftpd 설치 및 설정후 테스트
tftp 디렉터리로 이동후 파일 생성
Home 디렉터리로 이동
# cd /tftpboot# cat > /tftpboot/test.txt Hello World(Ctrl + D 를 눌러 입력 내용 저장 )
# cd /root
# tftp 192.168.1.x tftp> get test.txt tftp> quit
# cat < test.txt Hello World
7
- 8 -Huins. R&D Center
Embedded System Development Environment II
NFS 설치 원격지에 있는 호스트의 특정 디렉터리를 임베디드 시스템의 특정 디렉터리와 연결
NFS 다운로드
nfs 설정파일 수정
nfs 디렉터리 생성
nfs 서비스 재 시작
# apt-get install nfs-kernel-server
# vim /etc/exports
... ( 생략 ) …/nfsroot *(rw,sync,no_root_squash,no_subtree_check)
# mkdir /nfsroot
# service nfs-kernel-server start | stop
8
- 9 -Huins. R&D Center
Embedded System Development Environment II
USB Download Tool 설치 최근 임베디드 장치는 부트로더에서 USB 를 통해 데이터를 다운로드 할 수 있음
호스트에서 개발을 usb 장치를 사용하기 위한 라이브러리 다운로드
개발 플랫폼 usb 다운로더 설치
BL1 Tool 설치
# apt-get install libusb-dev
# mkdir /root/temp# cp /media/[Achro-4210 Disc]/utilities/linux_tools/smdk-usbdl.tar.gz /root/temp# cd /root/temp# tar zxvf smdk-usbdl.tar.gz# cd /root/temp/dltools# ls dltool.c Makefile readme.txt smdk-usbdl# cp –a smdk_usbdl /usr/bin
# mkdir /root# mkdir /root/temp# cd /root/temp# cp /media/[Achro-4210 Disc]/utilities/linux_tools/makechecksum/makechecksum.tar.gz ./# tar zxvf makechecksum.tar.gz# cd makechecksum# make# make install
9
- 10 -Huins. R&D Center
Embedded System Development Environment II
시리얼 통신 터미널 다운로드 (minicom) 리눅스에서 사용되는 시리얼 통신 관련 터미널 애플리케이션 minicom 을 이용하여 보드에서 출력되는 메시지를 보거나 , 리눅스 명령을 입력
minicom 설정
# minicom -s
# apt-get install minicom
10
- 11 -Huins. R&D Center
Embedded System Development Environment II
minicom 동작확인호스트 PC 와 임베디드 보드를 시리얼 케이블로연결한 다음 전원을 인가하면 , 임베디드 보드에서메시지가 출력되는 것을 확인할 수 있음 .
11
Enter 를 눌러 상위 메뉴로 이동
기본 설정값으로 저장
기본 설정값으로 저장후 다시 실행할 때는minicom 만 입력하면 현재 설정을 적용한터미널이 실행됨
- 12 -Huins. R&D Center
Embedded System Development Environment II
툴체인 설치 ( 크로스 컴파일러 ) 쉘 변경 : Configuring dash 에서 No 를 선택
툴체인 설치
# dpkg-reconfigure -plow dash
# mkdir /root/temp (root 사용자 홈디렉터리인 /root 에 temp 디렉터리가 없다면 생성한다 .)# cp -a /media/(Achro Disc)/toolchain/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz /root/temp/# sync# cd /root/temp# ls arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz# mkdir /opt/toolchains# tar jxvf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz -C /opt/toolchains/
12
- 13 -Huins. R&D Center
Embedded System Development Environment II
크로스 컴파일러 패스 설정# vim /root/.bashrc
# Alias definitions.# You may want to put all your additions into a separate file like# ~/.bash_aliases, instead of adding them here directly.# See /usr/share/doc/bash-doc/examples in the bash-doc package.if [ -f ~/.bash_aliases ]; then. ~/.bash_aliasesfi# Cross Compiler - achro4210 Androidexport PATH=/opt/toolchains/arm-2009q1/bin:$PATH
13
- 14 -Huins. R&D Center
Embedded System Development Environment II
크로스 컴파일러 패스 적용
크로스 컴파일러 버전 출력
# source /root/.bashrc
# cd /root# arm-none-linux-gnueabi-gcc --v
14
- 15 -Huins. R&D Center
Embedded System Development Environment II
컴파일 테스트를 위한 테스트코드 작성
소스코드 내용 입력
소스코드 컴파일
컴파일 된 바이너리 확인
# vim helloworld.c
#include <stdio.h>int main(int argc, char** argv){ printf("Hello World!\n"); return 0;}
# arm-none-linux-gnueabi-gcc -o helloworld helloworld.c
# file ./helloworld
15
- 16 -Huins. R&D Center
Embedded System Development Environment II
microSD 초기화 SD 카드 초기화 Achro-4210 은 구동시 필요한 모든 데이터는 microSD 카드를 이용 microSD 를 새로 구입하거나 , 처음부터 새로 전체 내용을 기록하려면 초기화가 필요
microSD 카드 연결 확인 microSD 카드를 카드리더에 연결한 다음 호스트 리눅스에 장착하고 dmesg 명령을 이용하여 어떤 디바이스 이름으로 장치가 연결되었는지 확인한다 .
# dmesg
16
- 17 -Huins. R&D Center
Embedded System Development Environment II
SD 카드 초기화 : 메모리의 모든 내용을 0 으로 만듦 .
SD 카드 파티션 설정 – 사용할 파일 시스템을 설정 ( 영역 분리 ) RAW 영역 : MBR, 부트로더 및 커널이 기록되는 영역 (0~8) 첫번째 파티션 : Achro4210_System (9 ~ 146) 두번째 파티션 : Achro4210_Data (147 ~ End of Cylinder)
# cd /root/images# dd if=/dev/zero of=/dev/sdb bs=64Kdd: `/dev/sdd' 쓰는 중 : No space left on device30177+0 레코드 들어옴30176+0 레코드 나감1977614336 바이트 (2.0 GB) 복사됨 , 683.012 초 , 2.0 M/B/ 초root@largest-desktop:~/images#
# fdisk /dev/sdbWARNING: DOS-compatible mode is deprecated. It's strongly recommended toswitch off the mode (command 'c') and change display units tosectors (command 'u').Command (m for help): p ...①Disk /dev/sdd: 1977 MB, 1977614336 bytes61 heads, 62 sectors/track, 1021 cylindersUnits = cylinders of 3782 * 512 = 1936384 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x49791684Device Boot Start End Blocks Id System
17
- 18 -Huins. R&D Center
Embedded System Development Environment II
Command (m for help): n ...②Command actione extendedp primary partition (1-4) ...③p Partition number (1-4): 1 ...④First cylinder (1-1021, default 1): 9 ...⑤Last cylinder, +cylinders or +size{K,M,G} (10-1021, default 1021): 146 ...⑥Command (m for help): n ...⑦Command actione extendedp primary partition (1-4)P ...⑧Partition number (1-4): 2 ... ⑨First cylinder (1-1021, default 1): 147 ...⑩Last cylinder, +cylinders or +size{K,M,G} (147-1017, default 1017): 1017 ... ⑪Command (m for help): w ... ⑫
The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.
18
- 19 -Huins. R&D Center
Embedded System Development Environment II
파일 시스템 초기화 – 실제 파일 시스템 생성 시스템 영역 파티션 초기화
데이터 영역 파티션 초기화
# mkfs.ext3 -L Achro4210_System /dev/sdb1
# mkfs.ext3 -L Achro4210_Data /dev/sdb2
19