Embedded System Development Environment II 1 Embedded System
Embedded System Development Environment II 임베디드 시스템 개발환경 구성 -1 -
Embedded System Development Environment II § 네트워크 설정 변경 통신이 정상적으로 되지 안는 경우 네트워크 설정 방법 (네트워크 설정은 현재 사용하고 있는 네트워크 구성에 따라 ip설정을 해 주어야 한다) § 호스트 시스템 ip 설정확인 네트워크가 장치가 정상적으로 설정되어있으면 eth 혹은 wlan 장치가 표시됨 # ifconfig root@ubuntu: ~# ifconfig lo Link encap: Local Loopback inet addr: 127. 0. 0. 1 Mask: 255. 0. 0. 0 inet 6 addr: : : 1/128 Scope: Host UP LOOPBACK RUNNING MTU: 16436 Metric: 1 RX packets: 521 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 521 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 0 RX bytes: 34140 (34. 1 KB) TX bytes: 34140 (34. 1 KB) lo : local loopback eth[n] : 유선 이더넷 장치 wlan[n] : 무선랜 장치 -3 - Huins. R&D Center 3
Embedded System Development Environment II § TFTP 설치 (tftpd-hpa) – 개선된 tftp Trivial File Transfer Protocol(UDP), FTP 보다 가볍고 기능이 단순한 애플리케이션 부트로더에서 부트로더 이미지 혹은 커널을 다운로드 할 경우 이용할 수 있다. § tftp download # apt-get install tftpd-hpa § tftp 설정 # vim /etc/default/tftpd-hpa # Defaults for tftpd-hpa RUN_DAEMON=“yes” OPTIONS=“-l -s /tftpboot” § tftp 서비스 디렉터리 생성 # mkdir /tftpboot § tftpd-hpa 서비스 재시작 # service tftpd-hpa stop # service tftpd-hpa start -5 - Huins. R&D Center 5
Embedded System Development Environment II § TFTP 설치 (tftpd) – xinetd 수퍼데몬으로 구동되는 tftpd § tftp download # apt-get install xinetd tftp § tftp 설정 # vim /etc/xinetd. d/tftp service tftp { protocol = udp port = 69 socket_type = dgram wait = yes user = nobody server = /usr/sbin/in. tftpd server_args = /tftpboot disable = no } § tftp 서비스 디렉터리 생성 # mkdir /tftpboot § tftpd-hpa 서비스 재시작 # service xinetd stop | start -6 - Huins. R&D Center 6
Embedded System Development Environment II § TFTP 테스트 tftpd-hpa 및 tftpd 설치 및 설정후 테스트 § tftp 디렉터리로 이동후 파일 생성 # cd /tftpboot # cat > /tftpboot/test. txt Hello World (Ctrl + D를 눌러 입력 내용 저장) § Home 디렉터리로 이동 # cd /root # tftp 192. 168. 1. x tftp> get test. txt tftp> quit # cat < test. txt Hello World -7 - Huins. R&D Center 7
Embedded System Development Environment II § § NFS 설치 원격지에 있는 호스트의 특정 디렉터리를 임베디드 시스템의 특정 디렉터리와 연결 § NFS 다운로드 # apt-get install nfs-kernel-server § nfs 설정파일 수정 # vim /etc/exports. . . (생략) … /nfsroot *(rw, sync, no_root_squash, no_subtree_check) § nfs 디렉터리 생성 # mkdir /nfsroot § nfs 서비스 재 시작 # service nfs-kernel-server start | stop -8 - Huins. R&D Center 8
Embedded System Development Environment II § USB Download Tool 설치 최근 임베디드 장치는 부트로더에서 USB를 통해 데이터를 다운로드 할 수 있음 § 호스트에서 개발을 usb 장치를 사용하기 위한 라이브러리 다운로드 # apt-get install libusb-dev § 개발 플랫폼 usb 다운로더 설치 # 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 § BL 1 Tool 설치 # mkdir /root/temp # cd /root/temp # cp /media/[Achro-4210 Disc]/utilities/linux_tools/makechecksum. tar. gz. / # tar zxvf makechecksum. tar. gz # cd makechecksum # make install -9 - Huins. R&D Center 9
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-2009 q 1 -203 -arm-none-linux-gnueabi-i 686 -pc-linux-gnu. tar. bz /root/temp/ # sync # cd /root/temp # ls arm-2009 q 1 -203 -arm-none-linux-gnueabi-i 686 -pc-linux-gnu. tar. bz # mkdir /opt/toolchains # tar jxvf arm-2009 q 1 -203 -arm-none-linux-gnueabi-i 686 -pc-linux-gnu. tar. bz -C /opt/toolchains/ - 12 - Huins. R&D Center 12
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_aliases fi # Cross Compiler - achro 4210 Android export PATH=/opt/toolchains/arm-2009 q 1/bin: $PATH - 13 - Huins. R&D Center 13
Embedded System Development Environment II § 크로스 컴파일러 패스 적용 # source /root/. bashrc § 크로스 컴파일러 버전 출력 # cd /root # arm-none-linux-gnueabi-gcc --v - 14 - Huins. R&D Center 14
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. c § 컴파일 된 바이너리 확인 # file. /helloworld - 15 - Huins. R&D Center 15
Embedded System Development Environment II § SD 카드 초기화 : 메모리의 모든 내용을 0으로 만듦. # cd /root/images # dd if=/dev/zero of=/dev/sdb bs=64 K dd: `/dev/sdd' 쓰는 중 : No space left on device 30177+0 레코드 들어옴 30176+0 레코드 나감 1977614336 바이트 (2. 0 GB) 복사됨, 683. 012 초, 2. 0 M/B/초 root@largest-desktop: ~/images# § SD 카드 파티션 설정 – 사용할 파일 시스템을 설정 (영역 분리) § § § RAW 영역 : MBR, 부트로더 및 커널이 기록되는 영역 (0~8) 첫번째 파티션 : Achro 4210_System (9 ~ 146) 두번째 파티션 : Achro 4210_Data (147 ~ End of Cylinder) # fdisk /dev/sdb WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): p. . . ① Disk /dev/sdd: 1977 MB, 1977614336 bytes 61 heads, 62 sectors/track, 1021 cylinders Units = cylinders of 3782 * 512 = 1936384 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0 x 49791684 Device Boot Start End Blocks Id System - 17 - Huins. R&D Center 17
Embedded System Development Environment II Command (m for help): n. . . ② Command action e extended p 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 action e extended p 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 - Huins. R&D Center 18
Embedded System Development Environment II § 파일 시스템 초기화 – 실제 파일 시스템 생성 § 시스템 영역 파티션 초기화 # mkfs. ext 3 -L Achro 4210_System /dev/sdb 1 § 데이터 영역 파티션 초기화 # mkfs. ext 3 -L Achro 4210_Data /dev/sdb 2 - 19 - Huins. R&D Center 19
- Slides: 19