Mango64R3 How to write Wince 6.0 http://www.mangoboard.com/ http://cafe.naver.com/embeddedcrazyboys Crazy Embedded Laboratory www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 1
Document History Revision Date Change note 2
1. Mango64R3 How to write u-boot...4 1.1. Eboot 메뉴에서 Nand Erase 하기... 7 1.2. Eboot 메뉴를통하여, stebldr 이미지올리기...11 1.3. Eboot.bin 이미지퓨징하기...16 1.3.1. Nor Flash Mode 부팅후 Eboot.bin 퓨징하기....16 1.3.2. Nand로부팅하여 Eboot.bin 퓨징하기...19 1.4. Nand Flash에 NK.bin 퓨징하기...20 www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 3
1. Mango64R3 How to write Source Download 보드에는전원, 3pin Serial cable, JTAG 를연결합니다. 부팅모드는 NAND 모드로하세요. NAND Mode : 2, 3, 4 ON, 나머지 Off Mango64R3-OpenOCD-Cygwin 이동 도스 Command 창을실행을합니다. $ openocd.exe f mango64.cfg 실행을합니다. 실행결과 y:\work\mango64r3\mango64r3-openocd-cygwin>openocd.exe -f mango64.cfg Open On-Chip Debugger 1.0 (2009-04-30-01:48) svn:1547 4
BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/bugs $URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $ jtag_speed: 5 Info : JTAG tap: s3c6410.unknown tap/device found: 0x2b900f0f (Manufacturer: 0x7 87, Part: 0xb900, Version: 0x2) Info : JTAG Tap/device matched Info : JTAG tap: s3c6410.cpu tap/device found: 0x07b76f0f (Manufacturer: 0x787, Part: 0x7b76, Version: 0x0) Info : JTAG Tap/device matched Info : found ARM1176 Warn : no telnet port specified, using default port 4444 Warn : no gdb port specified, using default port 3333 Warn : no tcl port specified, using default port 6666 또다른 command 창을실행을합니다. Window XP 32 bit 에서는아래와같이실행합니다. $ telnet localhost 4444 Window 7 64bit 에서는아래와같이실행합니다. $ open localhost 4444 입력후실행합니다. 아래는실행결과 Open On-Chip Debugger > script mango64-eboot.tcl 입력을합니다. Enter 를입력합니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 5
만약되지않으면, mango64-eboot.tcl 파일안에내용을복사해서 붙여넣기로실행하시기바랍니다. 터미널프로그램을 PC 에서실행을합니다. eboot 가터미널프로그램에서아래와같이실행이되면됩니다. Ethernet Boot Loader Configuration: 0) IP address: 192.168.1.13 1) Subnet mask: 255.255.255.0 2) DHCP: Disabled 3) Boot delay: 5 seconds 4) Reset to factory default configuration 5) Startup image: LAUNCH EXISTING 6) Program disk image into SmartMedia card: Enabled 7) Program LAN9220 MAC address (11:22:33:44:55:66) 8) KITL Configuration: DISABLED 9) Format Boot Media for BinFS A) Erase All Blocks B) Mark Bad Block at Reserved Block C) Clean Boot Option: FALSE D) Download image now E) Erase Reserved Block F) Low-level format the Smart Media card L) LAUNCH existing Boot Media image R) Read Configuration U) DOWNLOAD image now(usb) W) Write Configuration Right Now DNW 창에 Eboot가실행이됩니다. 5초가되기전에 Space 바를누릅니다. 그렇지않으면, Eboot가 NK 이미지를로드하게됩니다. Eboot의역할은 NK이미지를로드하여, Wince 를실행시키는역할도하지만, stebldr,eboot,nk이미지를 Nand에퓨징하는역할도합니다. 리눅스와비교한다면, u-boot역할을합니다. 6
그림 1-1 1.1. Eboot 메뉴에서 Nand Erase 하기 A) Erase All Blocks 를선택하면됩니다. Nand에저장된모든데이터가지워지므로주의하세요. 실행은간단합니다. A 를입력하면됩니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 7
그림 1-2 그림 1-11 에보면, 304,1886 Block 이 erase 시에 error 가발생을했습니다. Nand 를 Erase 하는 Flowchart 는 K9F2G08U0M Datasheet 에나와있습니다. 8
Wince 소스는 c:\wince600\platform\cb6410\src\common\nandflash\fmd\fmd.cpp 에 FMD_LB_EraseBlock() 가수행을합니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 9
소스와 Flow Chart 가동일하게일치를합니다. 그림 1-3 즉,Flow Chart 를보고, 코딩을하면했다는것입니다. 10
1.2. Eboot 메뉴를통하여, stebldr 이미지올리기 Stebldr 의역할은 PLL,Watchdog,IRQ,SDRAM 초기화하고,Eboot 이미지를 load 역할을합니다. 그래서, 사이즈도아주작습니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 11
파일위치는 c:\wince600\osdesigns\cb6410-v01\reldir\mango64_cb6410_release\stebldr.bin 에있습니다. 올리는방법은 Eboot 메뉴에서 5)Startup image: LAUNCH EXISTING 6) Program disk image into SmartMedia card: Enabled U) DOWNLOAD image now(usb) 선택합니다. 그림 1-4 U) DOWNLOAD image now(usb) 선택하면, USB 로이미지를다운로드할수있습니다. 12
그림 1-5 Please Send The Image through USB 메시지가출력이되면, USB로다운로드가가능하게됩니다. Stebldr.bin이미지는 0x50030000 주소에 load되고, Nand에 0번 ~2번 Block에 Write이됩니다. 그역할을 eboot가합니다. DNW Tool에서 USB Port->UBOOT 선택 c:\wince600\osdesigns\cb6410-v01\reldir\mango64_cb6410_release\stebldr.bin 선택합니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 13
그림 1-6 선택하고, 그림 1-16 같이메시지가나오면, 완료가된것입니다. 14
그림 1-7 망고 64 보드를리부팅하라는메시지가나옵니다. 리부팅하면, 됩니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 15
1.3. Eboot.bin 이미지퓨징하기 Eboot를퓨징해보도록하겠습니다. 1.3.1. Nor Flash Mode 부팅후 Eboot.bin 퓨징하기. Nor Flash Mode로부팅된상태에서진행을하겠습니다. 먼저 Eboot.nb0를 SDRAM에업로드하여, 실행을하도록하겠습니다. 하는방법은 1.5. Eboot.nb0 실행하기 Chapter를먼저수행해야합니다. Eboot 실행후메뉴에서 5) Startup image: LAUNCH EXISTING 6) Program disk image into SmartMedia card: Enabled U) DOWNLOAD image now(usb) 를선택합니다. 16
그림 1-8 USB Port->UBOOT 선택하여 c:\wince600\osdesigns\cb6410-v01\reldir\mango64_cb6410_release\eboot.bin 을선택합니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 17
그림 1-9 실행결과는아래그림 1-19 처럼출력이되면정상입니다. 18
그림 1-10 또, Reboot 하라는메시지를출력합니다. 1.3.2. Nand 로부팅하여 Eboot.bin 퓨징하기 Nand Mode로부팅하기위해서는, Nand flash에 stebldr과 eboot가퓨징이되어있어야합니다. 1.5. 망고64 Nand Mode로부팅하기 를보고, SW100 스위치를조정합니다. 그리고, 전원을인가합니다. Eboot 메뉴에서 5) Startup image: LAUNCH EXISTING 6) Program disk image into SmartMedia card: Enabled U) DOWNLOAD image now(usb) 를선택합니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 19
그림 1-11 USB Port->UBOOT 선택하여 c:\wince600\osdesigns\cb6410-v01\reldir\mango64_cb6410_release\eboot.bin 을선택합니다. 1.9.1. Nor Flash Mode 부팅후 Eboot.bin 퓨징하기 에 Eboot.bin을퓨징후 DNW 메시지창에나오면완료가된것입니다. 1.4. Nand Flash에 NK.bin 퓨징하기 NK.bin 이미지가 Wince 6.0 OS 이미지입니다. 퓨징하기전에 Nand Flash에는 Stebldr(Stebloader) 과 eboot는퓨징이되어있어야합니다. 망고64 보드에전원을인가를한후, Eboot 실행메뉴에서 F) Low-level format the Smart Media card 20
그림 1-12 Nand flash에 0번 Block에서 5번 Block까지 Reseveving Block으로설정하고, Nand flash에 6번 Block에서 0x7ff(2047) 번 Block까지다시 Erase를합니다. 0번 Block부터 5번 Block은 Stebldr(Steploader) 와 Eboot가퓨징이있으므로, 보호를하겠다는의미입니다. 9) Format Boot Media for BinFS 선택하면, c:\wince600\public\common\oak\drivers\ethdbg\bootpart\bootpart.cpp 에 BP_LowLevelFormat() 함수가수행이됩니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 21
그림 1-13 Wince 이미지라는시작을알리는하나의표시라고생각하면됩니다. 값은아래그림을참조바랍니다. 그림 1-14 MBR 을만들고, Resevered 영역을제외한모든 Block 을또 Erase 를합니다. MBR 를만드는것은 OS image 를올리기위한재구성합니다. U) DOWNLOAD image now(usb) USB Port->UBOOT 선택후 c:\wince600\osdesigns\cb6410-v01\reldir\mango64_cb6410_release\nk.bin 22
을선택합니다. 다운로드가완료가되면, 아래와같은메시지가출력이됩니다. www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 23
Initiating image launch in 5 seconds1 seconds. Launching image from boot media... OEMPlatformInit: IMAGE_TYPE_RAMIMAGE RAM image RAM image System ready! Preparing for download... INFO: *** Device Name 'SMDK641021862' *** INFO: Using static IP address 121811. INFO: Using subnet mask 2525250. waitforconnect INFO: using TOC[1] dwjumpaddress: 0x801074a8 INFO: OEMLaunch: Jumping to Physical Address 0x501074A8h (Virtual Address 0x801074A8h)... Windows CE Kernel for ARM (Thumb Enabled) Built on Jun 16 2009 at 10:08:15 [OAL] ++OEMInit() [OAL] S3C6410_APLL_CLK : 532000000 [OAL] ARMCLK : 532000000 [OAL] HCLK : 133000000 [OAL] PCLK : 66500000 [OAL] InitializeGPIO() [OAL] Turn on WIFI power(cb) [OAL] InitializeCLKSource() [OAL] InitializeCLKGating() [OAL] InitializeBlockPower() DCache: 128 sets, 4 ways, 32 line size, 16384 size ICache: 128 sets, 4 ways, 32 line size, 16384 size +OALArgsInit() Arguments area has some values -OALArgsInit() +OALTimerInit( 1, 33249, 0 ) -OALIntrRequestSysIntr(irq = 38, sysintr = 16) 24
[OAL] --OEMInit() OEMSetRealTime(2006/1/1 12:0:0.000) ++OALIoCtlHalInitRTC(CB) = 1 [OAL] Not Clear System Hive [FMD] FMD_OEMIoControl() : IOCTL_FMD_GET_INTERFACE [FMD] ++FMD_Init() [FMD:INF] FMD_Init() : Read ID = 0x0000ecda [FMD] FMD_Init() : NUM_OF_BLOCKS = 2048 [FMD] FMD_Init() : PAGES_PER_BLOCK = 64 [FMD] FMD_Init() : SECTORS_PER_PAGE = 4 [FMD] --FMD_Init() [FMD] FMD_GetInfo() : NUMBLOCKS = 2048(0x800), SECTORSPERBLOCK = 64(0x40), BYTESPERSECTOR = 2048(0x800) [FMD:ERR] FMD_OEMIoControl() : Unknown IOCTL (0x00071c24) [OAL] Not Clear Storage [PWRCON:INF] ++PWC_Init(0xd02becf0) [PWRCON:INF] g_psysconreg = 0xb2a0f000 [PWRCON:INF] --PWC_Init() -OALIntrRequestSysIntr(irq = 40, sysintr = 18) -OALIntrRequestSysIntr(irq = 19, sysintr = 19) -OALIntrRequestSysIntr(irq = 23, sysintr = 20) -OALIntrRequestSysIntr(irq = 20, sysintr = 21) [DISP:INF] g_pdispconreg = 0xb1400000 [DISP:INF] g_pmsmifreg = 0xb0b08000 [DISP:INF] g_pgpioreg = 0xb2b08000 [POST:INF] g_ppostreg = 0xb1300000 [ROT:INF] g_protatorreg = 0xb1500000 [TVSC:INF] g_ptvscreg = 0xb1200000 www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 25
[TVEnc:INF] g_ptvencreg = 0xb1100000 [TVEnc:INF] g_pgpioreg = 0xb2b08000 [PWRCON:INF] PWC_IOControl(IOCTL_PWRCON_SET_POWER_ON, 7) : BLKPWR_DOMAIN_F On [PWRCON:INF] PWC_IOControl(IOCTL_PWRCON_SET_POWER_ON, 8) : BLKPWR_DOMAIN_P On -OALIntrRequestSysIntr(irq = 88, sysintr = 22) [PWRCON:INF] ++PowerMonitorThread() [PWRCON:INF] PwrCon_get_reset_status() : H/W Reset [0x00000001] [PWRCON:INF] Notified [PBT_POWERINFOCHANGE] [IIS:INF] g_piisreg = 0xb2b02000 [IIS:INF] g_pgpioreg = 0xb2b08000 [DMA:INF] g_pdmac0reg = 0xb0e00000 [DMA:INF] g_pdmac1reg = 0xb0f00000 [DMA:INF] g_psysconreg = 0xb2a0f000 [DMA:INF] All DMA Source is set to Normal DMA [DMA:INF] DMA_request_channel() : Ch[0] in DMAC0 is Available for DMASrc[10] [DMA:INF] DMA_request_channel() : Ch[1] in DMAC0 is Available for DMASrc[11] -OALIntrRequestSysIntr(irq = 65, sysintr = 23) -OALIntrRequestSysIntr(irq = 66, sysintr = 24) [WAV:INF] ++InterruptThreadOutputDMA() [WAV:INF] InitInterruptThread() : IST Priority = 149 [HSMMC0] Initializing the HSMMC Host Controller -OALIntrRequestSysIntr(irq = 43, sysintr = 25) -OALIntrRequestSysIntr(irq = 94, sysintr = 26) [HSMMC0] Turn OFF the F/B delay control. 26
[HSMMC1] Initializing the HSMMC Host Controller -OALIntrRequestSysIntr(irq = 95, sysintr = 27) [HSMMC0] IsCardPresent: OK! [HSMMC0] Card is Inserted! [HSMMC1] Turn OFF the F/B delay control. [HSMMC1] Card is Removed! [HSMMC0] Turn OFF the F/B delay control. [HSMMC0] Setting for 1 bit mode, Clock Rate = 100000 Hz [HSMMC0] Turn OFF the F/B delay control. [UFNPDD] USB Serial Function Class Enabled [USB] dii.dwirq = 96 -OALIntrRequestSysIntr(irq = 96, sysintr = 28) Current Client "Serial_Class" [UFNPDD] USB Serial Function Class Enabled [HSMMC0] Setting for 4 bit mode, Clock Rate = 25000000 Hz [HSMMC0] Turn OFF the F/B delay control. [UFNPDD] OTG Cable Attached [USBH:INF] InitializeOHCI() : USB Host Cap : 0x00000004 [PWRCON:INF] PWC_IOControl(IOCTL_PWRCON_SET_POWER_ON, 13) : BLKPWR_DOMAIN_V On [MFC POWER] Power is up.[pwrcon:inf] PWC_IOControl(IOCTL_PWRCON_SET_POWER_OFF, 13) : BLKPWR_DOMAIN_V Off [MFC POWER] Power is down-oalintrrequestsysintr(irq = 26, sysintr = 29) MFC Interrupt has been initialized. [MFC IOCTL_POWER_CAPABILITIES] [MFC IOCTL_POWER_CAPABILITIES] leaving... [PWRCON:INF] PWC_IOControl(IOCTL_PWRCON_SET_POWER_ON, 13) : BLKPWR_DOMAIN_V On [MFC POWER] Power is up.[pwrcon:inf] PWC_IOControl(IOCTL_PWRCON_SET_POWER_OFF, 13) : BLKPWR_DOMAIN_V Off [MFC POWER] Power is down-oalintrrequestsysintr(irq = 18, sysintr = 30) SMB_Init: Get chip info chipid 2, mlversion 2, alversion 0. PRS_Init: SMD500 pressure sensor detected. chipid 0. [UFNPDD] RESET Again [PWRCON:INF] PWC_IOControl(IOCTL_PWRCON_SET_POWER_ON, 7) : BLKPWR_DOMAIN_F On www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 27
-OALIntrRequestSysIntr(irq = 21, sysintr = 31) 2D Sysintr : 31 [DISP:INF] VCLK Source = LCDCLK (133000000 Hz) [DISP:INF] VCLKSrc = 133000000, VCLK = 24661140, Div = 5 [DISP:INF] VCLK Direction = Divided, Divider = 5, VCLK = 26600000 Hz -OALIntrRequestSysIntr(irq = 100, sysintr = 32) -OALIntrRequestSysIntr(irq = 37, sysintr = 33) [TSP:INF] DdsiTouchPanelEnable() : gintrtouch = 32 [TSP:INF] DdsiTouchPanelEnable() : gintrt-oalintrrequestsysintr(irq = 32, sysintr = 34) ouchchanged = 33 [HSMMC0] Setting for 4 bit mode, Clock Rate = 25000000 Hz [HSMMC0] Turn OFF the F/B delay control. [WiFi]: Firmware Version: 9.70.3.23 OEMSetRealTime(2009/12/31 14:11:36.000) 메시지 1-15 28