ST Linux Install
|
SKKU2006 › SKKU2006/2006-03 › SSD › SSEx › SSL-POP3S_SMTPS-HOWTO › STLinuxInstall 1.1 ½ÃÀÛÇϱâÀü¿¡ ¶STLinuxÀÇ °³¹ßȯ°æÀº RPM(RedHat Package Manager)ÆÄÀÏÇüÅ·Π¹èÆ÷µË´Ï´Ù. ¿ì¼± ¿ì¸®´Â À̰ÍÀ» ¼³Ä¡ÇÒ¼ö ÀÖ´Â ¸®´ª½º(Linux) ¹èÆ÷ÆÇÀÌ ¼³Ä¡µÈ ÀÎÅÍ³Ý ¿¬°áÀÌ °¡´ÉÇÑ Host PC ÇÑ´ë°¡ ÇÊ¿äÇÕ´Ï´Ù.
ÀϹÝÀûÀ¸·Î ¾Æ·¡ÀÇ 32bit ¸®´ª½º(Linux) ¹èÆ÷ÆÇµéÀº ÀÎÅͳÝÀ¸·ÎºÎÅÍ ½±°Ô ´Ù¿î·Îµå ¹Þ¾Æ¼ ¼³Ä¡ÇÒ¼ö ÀÖÀ¸¸ç STLinuxÀÇ RPM(RedHat Package Manager)ÆÄÀϵéÀ» ¹«³ÇÏ°Ô ¼³Ä¡ÇÏ¿© »ç¿ëÇÒ¼ö ÀÖ´Ù°í ÇÒ¼ö ÀÖ½À´Ï´Ù.
º» ¹®¼´Â "RedHat Enterprise Linux Server version 5.3"À» Host PC¿¡ ¼³Ä¡Çϰí STLinux v2.3 À» ¼³Ä¡ÇÏ´Â °úÁ¤À» ´Ù·ç´Â °ÍÀ» ±âÁØÀ¸·Î ÇÕ´Ï´Ù. (Âü°í: RedHat Enterprise Linux ¼³Ä¡) º¸´Ù ÀÚ¼¼ÇÑ Á¤º¸¸¦ ¿øÇϽŴٸé STMicroelectronics »ç¿¡¼ ¿î¿µÇÏ´Â STLinux ȨÆäÀÌÁö ¸¦ ¹æ¹®Çϼ¼¿ä.
1.2 STLinux ¹èÆ÷º»ÀÇ ¼³Ä¡ ¶ÀÏ´Ü ¸®´ª½º(Linux)°¡ ¼³Ä¡µÈ Host PC ¿¡´Â STLinux ¹èÆ÷º»À» ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù. STLinux ¹èÆ÷º»Àº
ftp://ftp.stlinux.com/pub/stlinux/ ¿¡¼ ÃÖ±Ù ¹öÀüÀ» ´Ù¿î·Îµå ¹ÞÀ»¼ö ÀÖ½À´Ï´Ù.
STLinux ¹èÆ÷º»À» ¸®´ª½º(Linux)°¡ ¼³Ä¡µÈ Host PC ¿¡ ¼³Ä¡ÇÕ´Ï´Ù. ¼³Ä¡°úÁ¤¿¡¼´Â Host PC ÀÇ root°èÁ¤À¸·Î ·Î±×ÀÎ(Login)ÇÏ¿© ÁøÇàÇØ¾ß ÇÕ´Ï´Ù. ´ÙÀ½°ú °°Àº ¼ø¼·Î ´Ù¿î·Îµå ¹× ¼³Ä¡¸¦ ÁøÇàÇÕ´Ï´Ù. [root@STLinux ~]# rpm –e –nodeps `rpm –qa | grep stlinux23` [root@STLinux ~]# rm –rf /opt/STM/STLinux-2.3 [root@STLinux ~]# mkdir -p ~/download [root@STLinux ~]# wget ftp://ftp.stlinux.com/pub/stlinux/2.3/iso/STLinux-2.3-sh4-03-11-07.iso -P ~/download/ [root@STLinux ~]# mkdir -p /mnt/cdrom [root@STLinux ~]# mount -o loop,ro -t iso9660 -r ~/download/STLinux-2.3-sh4-03-11-07.iso /mnt/cdrom [root@STLinux ~]# cd /mnt/cdrom [root@STLinux cdrom]# ./install all-sh4-glibc [STLinux_Distribution_STAPI] name=STLinux Distribution 2.3 STAPI baseurl=http://www.stlinux.com/pub/stlinux/2.3/stapi/RPMS gpgkey=http://www.stlinux.com/pub/stlinux/2.3/STLinux/gpg_key gpgcheck=0 [root@STLinux cdrom]# /opt/STM/STLinux-2.3/host/bin/stmyum update .... Transaction Summary ============================================================================= Install XXX Package(s) Update XXX Package(s) Remove XXX Package(s) Total download size: XXX M Is this ok [y/N]: y ...."stmyum update"À» Çϸé ÀÌÀü¿¡ ÀÛ¾÷Çß´ø ¼Ò½ºµé°ú ¹öÀüȣȯ¼º ¹®Á¦·Î ºôµå°¡ ¾ÈµÇ°Å³ª ´ë±Ô¸ð ¼öÁ¤ÀÌ ÇÊ¿äÇÑ »óȲÀÌ ÀÖÀ»¼ö ÀÖ½À´Ï´Ù. ÀÌ °æ¿ì ÇØ´ç ¹®Á¦°¡ µÇ´Â ÆÐŰÁö¸¦ Migration ÇØ¾ß ÇÒ¼öµµ ÀÖ½À´Ï´Ù. È®ÀÎµÈ ¹®Á¦»çÇ×Àº ´ÙÀ½°ú °°½À´Ï´Ù.
[root@STLinux ~]# echo "export PATH=/opt/STM/STLinux-2.3/devkit/sh4/bin:\${PATH}" >> ~/.bash_profile
[root@STLinux ~]# echo "export PATH=/opt/STM/STLinux-2.3/host/bin:\${PATH}" >> ~/.bash_profile
[root@STLinux ~]# source ~/.bash_profile
Áö±Ý±îÁöÀÇ ¼³Ä¡°úÁ¤¿¡¼ º¸´Ù½ÃÇÇ STLinux´Â Æí¸®ÇÑ ÆÐŰÁö(Package) °ü¸®ÅøÀ» Á¦°øÇÕ´Ï´Ù. Á÷Á¢ ftp://ftp.stlinux.com/pub/stlinux/ ¿¡¼ RPM(RedHat Package Manager)ÆÄÀÏÀ» ´Ù¿î·Îµå ¹Þ¾Æ¼ ¼³Ä¡ÇÒ¼öµµ ÀÖÀ¸³ª stmyum À̶ó´Â À¯Æ¿¸®Æ¼¸¦ ÅëÇØ¼ º¸´Ù Æí¸®ÇÏ°Ô ¼³Ä¡ ¹× ¾÷µ¥ÀÌÆ®(Update)¸¦ ÇÒ ¼ö°¡ ÀÖ½À´Ï´Ù.
1.3 U-boot bootloader build ¶ºÎÆ®·Î´õ(Boot loader)ÀÇ ¼Ò½º´Â "/opt/STM/STLinux-2.3/devkit/sources/u-boot/"µð·ºÅ丮 ¹Ø¿¡ ÀÖ½À´Ï´Ù. À̰ÍÀ» ±×´ë·Î ÇØ´ç µð·ºÅ丮¿¡¼ ºôµå ¹× ¼öÁ¤ÀÛ¾÷À» Çϱ⺸´Ù´Â ÀÚ½ÅÀÇ ÀÛ¾÷µð·ºÅ丮·Î º¹»çÇØ¼ ÀÛ¾÷ÇÏ´Â°Ô ÁÁ½À´Ï´Ù.
Serial consoleµµ º¼¼ö ÀÖµµ·Ï ¹Ì¸® ÁغñÇØÁÖ¾î¾ß ÇÕ´Ï´Ù. Board¸¶´Ù Á¢¼ÓÇÏ´Â profileÀ̸§ÀÌ ´Ù¸£¹Ç·Î ÀÌ ºÎºÐÀº °¢ÀÚ ÇØ°áÇÏ¼Å¾ß ÇÒ°Ì´Ï´Ù. (ÀÌ ¹®¼¿¡¼´Â ¡°ST Micro Connect¡±ÀÇ IP¸¦ 192.168.33.2·Î ¼³Á¤ÇÏ¿´´Ù°í °¡Á¤Çϰí ÀÛ¼ºµÇ¾ú½À´Ï´Ù.)
[root@STLinux ~]# mkdir –p ~/project/stprj [root@STLinux ~]# cp –a /opt/STM/STLinux-2.3/devkit/sources/u-boot/u-boot-sh4-1.3.1_stm23_0044 ~/project/stprj/ [root@STLinux ~]# cd ~/projtect/stprj/u-boot-sh4-1.3.1_stm23_0044/ [root@STLinux u-boot-sh4-1.3.1_stm23_0044]# ls ./board/ 5197cab a3000 adder . . . mb411 mb442 mb448 mb519 mb618 mb628 mb671 mb680 mb704 [root@STLinux u-boot-sh4-1.3.1_stm23_0044]# cp -a ./board/5197cab ./board/stprj [root@STLinux u-boot-sh4-1.3.1_stm23_0044]# mv ./board/stprj/init-5197cab.S ./board/stprj/init-stprj.S [root@STLinux u-boot-sh4-1.3.1_stm23_0044]# mv ./board/stprj/5197cab.c ./board/stprj/stprj.c [root@STLinux u-boot-sh4-1.3.1_stm23_0044]# cp ./include/configs/5197cab.h ./include/configs/stprj.h
5197cab_config \
5197cabse_config : unconfig
@ >include/config.h
@echo "#define CONFIG_SH_STX5197 1" >>include/config.h
@echo "#define CONFIG_SH_5197CAB 1" >>include/config.h
$(if $(findstring se,$@), \
@echo "#define CONFIG_SH_SE_MODE 1" >>include/config.h)
$(if $(findstring se,$@), \
@echo "TEXT_BASE = 0x83F00000" >$(obj)board/5197cab/config.tmp)
@./mkconfig -a 5197cab sh sh 5197cab "" stx5197
###########################################
### 5197cab_config¸¦ Âü°íÇÏ¿© »õ·Î Ãß°¡ÇÑ ºÎºÐ
###########################################
stprj_config \
stprjse_config : unconfig
@ >include/config.h
@echo "#define CONFIG_SH_STX5197 1" >>include/config.h
@echo "#define CONFIG_SH_STPRJ 1" >>include/config.h
$(if $(findstring se,$@), \
@echo "#define CONFIG_SH_SE_MODE 1" >>include/config.h)
$(if $(findstring se,$@), \
@echo "TEXT_BASE = 0x83F00000" >$(obj)board/stprj/config.tmp)
@./mkconfig -a stprj sh sh stprj "" stx5197
TEXT_BASE = <SDRAMÀÇ baseÁÖ¼Ò> + (<SDRAMÀÇ size> - 1Mbytes)º» ¹®¼¿¡¼´Â SDRAMÀÇ baseÁÖ¼Ò´Â 84000000H, SDRAMÀÇ size´Â 64Mbytes¸¦ ±âÁØÀ¸·Î ´ÙÀ½°ú °°ÀÌ "./board/stprj/config.mk"¸¦ ¼öÁ¤ÇÏ¿´½À´Ï´Ù. # # stprj board # # Installs at SDRAM BASE + 63M in cache region TEXT_BASE = 0x87F00000 PLATFORM_LDFLAGS += [root@STLinux [root@STLinux [root@STLinux [root@STLinux ~]# cd ~/project/stprj/u-boot-sh4-1.3.1_stm23_0044/ u-boot-sh4-1.3.1_stm23_0044]# make mrproper u-boot-sh4-1.3.1_stm23_0044]# make stprj_config u-boot-sh4-1.3.1_stm23_0044]# makeºôµå°¡ ¿Ï·áµÇ¸é u-boot, u-boot.bin, u-boot.map, u-boot.srec °¡ »ý¼ºµË´Ï´Ù. ¿©±â¼ ¿ì¸®°¡ flash¿¡ writeÇÏ°Ô µÉ ÆÄÀÏÀº u-boot.binÀ̸ç GDB·Î loadÇÏ´Â °ÍÀº ELFÆ÷¸ËÀÎ u-bootÆÄÀÏÀÌ »ç¿ëµË´Ï´Ù. [root@STLinux u-boot-sh4-1.3.1_stm23_0044]# sh4-linux-gdb ./u-boot GNU gdb STMicroelectronics/Linux Base 6.8-41 [build Aug 3 2009] Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=sh4-linux"... (gdb) 5197cabbypass 192.168.33.2 The target is assumed to be little endian 0xa0000000 in ?? () (gdb) load Loading section .text, size 0x1195c lma 0x87f00000 Loading section .rodata, size 0x750 lma 0x87f1195c Loading section .rodata.str1.4, size 0x3e74 lma 0x87f120ac Loading section .data, size 0xb50 lma 0x87f15f20 Loading section .u_boot_cmd, size 0x4b4 lma 0x87f16a70 Start address 0x87f00000, load size 93988 Transfer rate: 236 KB/sec, 18797 bytes/write. (gdb) compare-sections Section .text, range 0x87f00000 -- 0x87f1195c: matched. Section .rodata, range 0x87f1195c -- 0x87f120ac: matched. Section .rodata.str1.4, range 0x87f120ac -- 0x87f15f20: matched. Section .data, range 0x87f15f20 -- 0x87f16a70: matched. Section .u_boot_cmd, range 0x87f16a70 -- 0x87f16f24: matched. (gdb) continue Continuing.GDB¸í·É compare-sections¿¡¼ matched·Î ³ª¿Í¾ß¸¸ Á¤»óÀûÀÎ ½ÇÇàÀÌ µË´Ï´Ù. ¸¶Áö¸·¿¡ "Continuing." ¸Þ½ÃÁö°¡ ³ª¿ÂÈÄ compare-sections°¡ matched°¡ ¾Æ´Ï¸é ´Ù½Ã Ctrl-C۸¦ ´© U-Boot 1.3.1 (Aug 20 2009 - 18:16:28) - stm23_0044 DRAM: 64 MiB NOR: 8 MiB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Hit any key to stop autoboot: 15 stprj> stprj> run updateboot Un-Protect Flash Sectors 0-1 in Bank # 1 .. done Erase Flash Sectors 0-1 in Bank # 1 .. done ## Ready for binary (ymodem) download to 0x84000000 at 115200 bps... CCCC Starting ymodem transfer. Press Ctrl+C to cancel. Transferring u-boot.bin... 100% 91 KB 6 KB/s 00:00:15 0 Errors xyzModem - CRC mode, 737(SOH)/0(STX)/0(CAN) packets, 6 retries ## Total Size = 0x00016f24 = 93988 Bytes Copy to Flash ........ done Protect Flash Sectors 0-1 in Bank # 1 .. done stprj> |
You will gain money by a speculation or lottery. |










![[http]](/imgs/http.png)
)
![[ftp]](/imgs/ftp.png)