Техническая поддержка пользователей > Windows CE, EBoot
Как начать отлаживать дебуг-образ?
(1/1)
urban81:
Здравствуйте. Подскажите пожалуйста. Вот есть у меня комп Тион-Про2(64м норфлеша и 64м рам), bsp ep9xx, есть всё...И есть дебуг-образ он весит 44м, с распределением памяти 45-18...Не развёртывает...А в релизе всё на 5+...Хочу начать отлаживать этот образ-дебуг ...Подскажите пожалуйста как это реализовать. Заранее всем спаибо.
--- Код: ---;**********************************************************************
;
; Filename: config.bib
;
; Description: Memory Layout for the Windows CE image.
;
; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
; PARTICULAR PURPOSE.
;
; Use of this source code is subject to the terms of the Cirrus end-user
; license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
; If you did not accept the terms of the EULA, you are not authorized to
; use this source`code. For a copy of the EULA, please see the
; EULA.RTF on your install media.
;
; Copyright(c) Cirrus Logic Corporation 2005, All Rights Reserved
;
;**********************************************************************
IF IMGFLASH !
IF BSP_EP93XX_COPY_FLASH_TO_RAM !
;**********************************************************************
;
; Boot from RAM
;
;**********************************************************************
MEMORY
RESERVED 80000000 00008000 RESERVED
DRV_GLB 80008000 00001000 RESERVED
CS8950 80010000 00030000 RESERVED
EDBG 80040000 00080000 RESERVED
FRAMEBUF 800C0000 00200000 RESERVED
NK 802C0000 02B40000 RAMIMAGE
RAM 82E00000 01200000 RAM
CONFIG
COMPRESSION=ON
PROFILE=OFF
ROMSTART=802C0000
ROMSIZE=02B40000
ROMWIDTH=32
; NKStart + ROMOFFSET = Physical Memory Location.
; 0x802C0000 + 0x80000000 = 0x002C0000
ROMOFFSET=0x80000000
ROMFLAGS=0
KERNELFIXUPS=ON
AUTOSIZE=ON
ENDIF
ENDIF
IF IMGFLASH !
IF BSP_EP93XX_COPY_FLASH_TO_RAM
;**********************************************************************
;
; Copy Flash to RAM and boot from RAM.
;
;**********************************************************************
MEMORY
RESERVED 80000000 00008000 RESERVED
DRV_GLB 80008000 00001000 RESERVED
CS8950 80010000 00030000 RESERVED
EDBG 80040000 00080000 RESERVED
FRAMEBUF 800C0000 00200000 RESERVED
NK 802C0000 02B40000 RAMIMAGE
RAM 82E00000 01200000 RAM
CONFIG
COMPRESSION=ON
PROFILE=OFF
ROMSTART=802C0000
ROMSIZE=02B40000
ROMWIDTH=32
;
; NKStart + ROMOFFSET = Physical Memory Location.
; 0x802C0000 + 0xDFD40000 = 0x60000000
ROMOFFSET=DFD40000
ROMFLAGS=0
KERNELFIXUPS=ON
AUTOSIZE=ON
ENDIF
ENDIF
IF IMGFLASH
;**********************************************************************
;
; Boot from FLASH
;
;**********************************************************************
MEMORY
RESERVED 80000000 00008000 RESERVED
DRV_GLB 80008000 00001000 RESERVED
CS8950 80010000 00030000 RESERVED
EDBG 80040000 00080000 RESERVED
FRAMEBUF 800C0000 00200000 RESERVED
NK 802C0000 02B40000 RAMIMAGE
RAM 82E00000 01200000 RAM
CONFIG
COMPRESSION=ON
PROFILE=OFF
ROMSTART=88000000
ROMSIZE=02B40000
ROMWIDTH=32
; Used for making a copy to RAM 0x80000000
;
; 0x88000000 + 0xD8000000 = 0x60000000
ROMOFFSET=0xD8000000
ROMFLAGS=1
KERNELFIXUPS=ON
AUTOSIZE=ON
ENDIF
--- Конец кода ---
--- Код: ---@REM
@REM Copyright (c) Microsoft Corporation. All rights reserved.
@REM
@REM
@REM Use of this sample source code is subject to the terms of the Microsoft
@REM license agreement under which you licensed this sample source code. If
@REM you did not accept the terms of the license agreement, you are not
@REM authorized to use this sample source code. For the terms of the license,
@REM please see the license agreement between you and Microsoft or, if applicable,
@REM see the LICENSE.RTF on your install media or the root of your tools installation.
@REM THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
@REM
@ECHO OFF
@REM Этот файл устанавливает BSP - специфичные переменные среды, которые являются активными во время построения
@REM Он определяет заданное по умолчанию состояние. Переменная среды ниже,
@REM например, воздействует на platform.reg.
@REM Эта переменная исключает типовой ключ реестра в platform.reg от
@REM включаемый в начальный системный реестр устройства.
@REM Select board
set BSP_EP93XX_PLATFORM_TYPE=EDB9315
@REM Define the type of Flash. The supported values are "FLASH_TYPE_AMD","FLASH_TYPE_C3",
@REM "FLASH_TYPE_P3", and "FLASH_TYPE_J3". The default value is "FLASH_TYPE_J3"
set BSP_EP93XX_FLASH_TYPE=FLASH_TYPE_P3
@REM Enable image to XIP out of flash
set IMGFLASH=
@REM eboot programs NK.bin into flash. The CE image copies itself from flash to RAM and runs out of RAM.
@REM It cannot coexist with IMGFLASH.
set BSP_EP93XX_COPY_FLASH_TO_RAM=1
@REM используем всю свободную от RAMIMAGE память
set BSP_EP93XX_EXTENSION_DRAM=
@REM Enable flash file system.
set BSP_EP93XX_FLASH=1
@REM Enable audio, the default is I2S audio.
set BSP_EP93XX_AUDIO=1
@REM Выбрать один из двух
set BSP_EP93XX_AC97_AUDIO=
set BSP_EP93XX_I2S_AUDIO=1
@REM
set BSP_EP93XX_WITH_DISPLAY=1
set BSP_EP93XX_DISPLAY_ROTATION=
set BSP_EP93XX_DISPLAY_FLAT=1
@REM Select hardware accelerated display driver
set BSP_EP93XX_DISPLAY_ACCEL=
@REM
set BSP_EDB93XX_DISPLAY_SHARP=
@REM Enable Ethernet
set BSP_EP93XX_ETHERNET=1
@REM Enable serial port
set BSP_EP93XX_SERIAL=1
@REM Enable USB host support.
set BSP_EP93XX_USB=1
@REM
set BSP_EP93XX_TOUCH=1
@REM
set BSP_EP93XX_BATTERY_RTC=1
@REM
set BSP_EP93XX_CRUNCH=1
@REM
set BSP_EDB93XX_HWKEY=1
@REM Драйвер SPI-CAN 2.0 (MPC2515)
set BSP_EDB93XX_CAN=1
@REM Драйвер Software Input Panel
set BSP_EDB93XX_SIP=
@REM отключает безопасность на устройстве
set BSP_EP93XX_OFFCMACCEPT=1
--- Конец кода ---
Danila:
Добрый день.
Ищите ошибку в отладочных сообщения. Номер отладочного порта задается в файле src/inc/options.h (#define DEBUG_UART_PORT)
urban81:
Здравствуйте.Спасибо за помощь.Так пробовал...Нет там сообщений...Может более глубокий совет есть...
urban81:
Здравствуйте.Спасибо за помощь. Думаю дело в этом файле т.к. вижу только начальную картинку и всё. Посмотрите пожалуйста...Вот файл startup.s:
--- Код: ---;**********************************************************************
;
; Filename: startup.s
;
; Description: Initialization before the MMU gets turned. This is
; the first code that gets executed.
;
; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
; PARTICULAR PURPOSE.
;
; Use of this source code is subject to the terms of the Cirrus end-user
; license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
; If you did not accept the terms of the EULA, you are not authorized to
; use this source code. For a copy of the EULA, please see the
; EULA.RTF on your install media.
;
; Copyright(c) Cirrus Logic Corporation 2002, All Rights Reserved
;
;**********************************************************************
OPT 2 ; disable listing
INCLUDE kxarm.h
INCLUDE memorymap.inc
OPT 1 ; reenable listing
OPT 128 ; disable listing of macro expansions
;
; ASync bus mode, little endian, MMU disabled
;
CP15R1Init EQU 0xC0001078
CLKSET1DEFAULT EQU 0x000398e7
EBOOT_RUN_FLAG EQU 0x00001234
REG_LED_ADDRESS EQU 0x80840020
;
; Static memory settings.
;
SMCBCR_IDCY_MASK EQU 0x0000000F
SMCBCR_IDCY_SHIFT EQU 0
SMCBCR_WST1_MASK EQU 0x000003E0
SMCBCR_WST1_SHIFT EQU 5
SMCBCR_RBLE EQU 0x00000400
SMCBCR_WST2_MASK EQU 0x0000F800
SMCBCR_WST2_SHIFT EQU 11
SMCBCR_WPERR EQU 0x02000000
SMCBCR_WP EQU 0x04000000
SMCBCR_PME EQU 0x08000000
SMCBCR_MASK EQU 0x30000000
SMCBCR_MW_8BIT EQU 0x00000000
SMCBCR_MW_16BIT EQU 0x10000000
SMCBCR_MW_32BIT EQU 0x20000000
SMCBCR_EBIBRKDIS EQU 0x40000000
ROMHDR_dllfirst EQU 0x8
ROMHDR_dlllast EQU 0xC
ROMHDR_physfirst EQU 0x10
ROMHDR_physlast EQU 0x14
REG_SCRATCH_REG0 EQU 0x80930040
IF EP93XX_SDRAM_WIDTH = 16
ROM_OFFSET EQU 0xDFF40000
ELSE
ROM_OFFSET EQU 0XDFD40000
ENDIF
IMPORT KernelStart
IMPORT OEMAddressTable
IMPORT SysconSetup
IMPORT SdramCfg
IMPORT pTOC
IMPORT ep93xx_setup_display
IMPORT ep93xx_turnon_display
IMPORT bmp_logo_bitmap
;**********************************************************************
; StartUp routine to initialize the processor.
;**********************************************************************
STARTUPTEXT
StartString
DCB "CRUS", 0
LEAF_ENTRY StartUp
;
; Kill watch dog timer. Before any thing else.
;
; ldr r0, =0x80940000
; ldr r1, =0xAA55
; str r1, [r0]
;
; ensure SVC32 mode with IRQ and FIQ disabled
;
mov r0, #0xd3
msr cpsr_c, r0
;
; Turn off the MMU
;
ldr r0, =CP15R1Init
mcr p15, 0, r0, c1, c0, 0
nop
nop
;
;Если мы загружались через eboot, SDRAM уже конфигурирован.
; Проверьте регистр CLKSET1, чтобы видеть, был ли он изменен.
;
ldr r0, =REG_SCRATCH_REG0
ldr r1, [r0]
ldr r0, =EBOOT_RUN_FLAG
cmp r0, r1
beq DontConfigureSDRAM
;
;
; Configure SDRAM
;
bl SdramCfg
DontConfigureSDRAM
;
; Если мы хотим образ, который копирует от flash в RAM, используйте следующий.
;
;
; Configure the flash chips
IF EP93XX_FLASH_TYPE = "FLASH_TYPE_J3"
ldr r0, =( (4:SHL:SMCBCR_WST2_SHIFT) :or: \
(15:SHL:SMCBCR_WST1_SHIFT) )
;ENDIF
ELSEIF EP93XX_FLASH_TYPE = "FLASH_TYPE_P3"
ldr r0, =( (3:SHL:SMCBCR_WST2_SHIFT) :or: \
(9:SHL:SMCBCR_WST1_SHIFT) )
ELSE
ldr r0, =((31:SHL:SMCBCR_WST2_SHIFT) :or: \
(31:SHL:SMCBCR_WST1_SHIFT) )
ENDIF
IF EP93XX_FLASH_WIDTH =16
ldr r1, =SMCBCR_MW_16BIT
ELSE
ldr r1, =SMCBCR_MW_32BIT
ENDIF
ldr r2, =((1 :and:SMCBCR_IDCY_MASK) :or: \
SMCBCR_WP :or: \
SMCBCR_PME :or: \
SMCBCR_RBLE)
orr r0, r0, r1
orr r0, r0, r2
ldr r1, =REG_FLASH_CONFIG
str r0, [r1]
nop
;init lcd controller and draw logo
ldr r0, =EP93XX_SDRAM_PHY_ADDR
add r0, r0, #0x00040000 ;sp is set to the buffer of EDBG.
mov sp, r0
bl SysconSetup
bl ep93xx_setup_display
ldr R2, =0xC0000 ;=0x5900000
IF DISPLAY_SHARP
ldr R1, =0x025800 ;320x240
ELSE
ldr R1, =0x096000 ;640x480
ENDIF
add R1, R2, R1
ldr r3, =bmp_logo_bitmap
ldr r0, =ROM_OFFSET
add R3, R3, r0 ;
B _check_logo_len
_fill_fb
ldr R0, [R3] ; =0x07E007E0;
str R0, [R2]
add R2, R2, #4
add R3, R3, #4
_check_logo_len
cmp R2, R1
bcc _fill_fb
bl ep93xx_turnon_display
IF COPY_FLASH_TO_RAM
bl CopyCodeToRam
ENDIF ;COPY_FLASH_TO_RAM
ExecuteFromRam
; clear out magic words for memory and heap/уберите волшебные слова для памяти и динамической памяти
; (r0) = physical address of OEMAddressTable
;
;
; Calculate the physical address of the table.
;
; r0 - Virtual address of OEMAddressTable
; r1 - Physical Address of Startup
; r2 - Virtual Address of Startup
;
; r0 = r0 - r2 + r1 = Physical address of OEMAddressTable
;
ldr r0,=OEMAddressTable
adr r1,StartUp
ldr r2,=StartUp
add r0, r0, r1
sub r0, r0, r2
bl KernelStart
;
; KernelStart никогда не должен возвращаться:
;
b .
;;***********************************************************************************
;;CopyCodeToRam function starts
;;***********************************************************************************
IF COPY_FLASH_TO_RAM
LEAF_ENTRY CopyCodeToRam
;
; Get the address of the table of contents and adjust for the flash address.
;Получите адрес оглавления и корректируйте для перепрограммируемого адреса.
ldr r0, =pTOC
ldr r3, =ROM_OFFSET
add r0, r0, r3
ldr r4, [r0]
add r4, r4, r3
;
; Get the dll first and dll last address.
; r1 = Destiniation = dllfirst
; r11 = length = dlllast - dllfirst
;
ldr r1, [r4, #ROMHDR_dllfirst]
ldr r11, [r4, #ROMHDR_dlllast]
;
; Make sure that r1 and r11 are on a 0x20 boundary.
;Удостоверьтесь, что r1 и r11 находятся на 0x20 границе.
ldr r2, =0x07FFFFE0
ldr r0, =EP93XX_SDRAM_PHY_ADDR
and r1, r1, r2
orr r1, r1, r0
and r11, r11, r2
add r11, r11, #0x20
orr r11, r11, r0
;*************************************************************************
; Copy routine.
;
; r0 = Source
; r1 = Destination
;r10 = The last address of first piece of SDRAM.Последний адрес первой части SDRAM.
; r11 = End Address Address of Destination
; r12 = LED counter
; r13 = LED address.
;
;*************************************************************************
;Get the end address of first piece of SDRAM from OEMAddressTable.
;Получите конечный адрес первой части SDRAM от OEMAddressTable
ldr r9,=OEMAddressTable
ldr r8, =ROM_OFFSET
add r9, r9,r8
ldr r2, [r9, #8] ; r2 is the size of first piece of SDRAM in M bytes.
cmp r2,#64
BHS GreatThan64M
ldr r10, [r9, #0x4];the physical address of first piece of SDRAM
ldr r2, [r9, #0x8] ;the size of first piece of SDRAM
mov r2, r2, LSL #20 ;change the size from xxM to xxxxx BYTES
add r10, r10, r2 ;then, r10 is the last physical address of first piece of SDRAM.
b SecondSDRAMEnd
GreatThan64M
ldr r2,=EP93XX_SDRAM_PHY_ADDR
add r10,r2,#0x4000000
SecondSDRAMEnd
;Initialize LED state;;
ldr r13, =REG_LED_ADDRESS
ldr r2, [r13]
and r2, r2, #0xFFFFFFFC
orr r2, r2, #1
str r2, [r13]
ldr r12, =0x3FFFF
ldr r0, =EP93XX_FLASH_PHY_ADDR
NKCopyLoop
ldmia r0!, {r2-r9}
stmia r1!, {r2-r9}
NK8MegTest
cmp r1, r10
bne NKLedTest
ldr r9,=OEMAddressTable
ldr r8, =ROM_OFFSET
add r9, r9,r8
ldr r1, [r9, #0x10]; set destination address to the second piece of SDRAM.
sub r11, r11, r10
add r11, r11, r1
NKLedTest
ands r2, r0, r12
beq ToggleLED
NKCopyTest
cmp r1, r11
bne NKCopyLoop
ldr r0, =EP93XX_SDRAM_PHY_ADDR
ldr r2, =ExecuteFromRam
and r2, r2, #0x00FFFFFF
orr r2, r2, r0
mov pc, r2
ToggleLED
ldr r2, [r13]
eor r2, r2, #3
str r2, [r13]
b NKCopyTest
mov pc, lr
ENDIF ;COPY_FLASH_TO_RAM
; End of initialization code & data
TEXTAREA
END
--- Конец кода ---
urban81:
С этим файлом startup.s:
--- Код: ---;**********************************************************************
;
; Filename: startup.s
;
; Description: Initialization before the MMU gets turned. This is
; the first code that gets executed.
;
; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
; PARTICULAR PURPOSE.
;
; Use of this source code is subject to the terms of the Cirrus end-user
; license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
; If you did not accept the terms of the EULA, you are not authorized to
; use this source code. For a copy of the EULA, please see the
; EULA.RTF on your install media.
;
; Copyright(c) Cirrus Logic Corporation 2002, All Rights Reserved
;
;**********************************************************************
OPT 2 ; disable listing
INCLUDE kxarm.h
INCLUDE memorymap.inc
OPT 1 ; reenable listing
OPT 128 ; disable listing of macro expansions
;
; ASync bus mode, little endian, MMU disabled
;
CP15R1Init EQU 0xC0001078
CLKSET1DEFAULT EQU 0x000398e7
EBOOT_RUN_FLAG EQU 0x00001234
REG_LED_ADDRESS EQU 0x80840020
;
; Static memory settings.
;
SMCBCR_IDCY_MASK EQU 0x0000000F
SMCBCR_IDCY_SHIFT EQU 0
SMCBCR_WST1_MASK EQU 0x000003E0
SMCBCR_WST1_SHIFT EQU 5
SMCBCR_RBLE EQU 0x00000400
SMCBCR_WST2_MASK EQU 0x0000F800
SMCBCR_WST2_SHIFT EQU 11
SMCBCR_WPERR EQU 0x02000000
SMCBCR_WP EQU 0x04000000
SMCBCR_PME EQU 0x08000000
SMCBCR_MASK EQU 0x30000000
SMCBCR_MW_8BIT EQU 0x00000000
SMCBCR_MW_16BIT EQU 0x10000000
SMCBCR_MW_32BIT EQU 0x20000000
SMCBCR_EBIBRKDIS EQU 0x40000000
ROMHDR_dllfirst EQU 0x8
ROMHDR_dlllast EQU 0xC
ROMHDR_physfirst EQU 0x10
ROMHDR_physlast EQU 0x14
REG_SCRATCH_REG0 EQU 0x80930040
IF EP93XX_SDRAM_WIDTH = 16
ROM_OFFSET EQU 0xDFF40000
ELSE
ROM_OFFSET EQU 0XDFD40000
ENDIF
IMPORT KernelStart
IMPORT OEMAddressTable
IMPORT SysconSetup
IMPORT SdramCfg
IMPORT pTOC
;**********************************************************************
; StartUp routine to initialize the processor.
;**********************************************************************
STARTUPTEXT
StartString
DCB "CRUS", 0
LEAF_ENTRY StartUp
;
; Kill watch dog timer. Before any thing else.
;
; ldr r0, =0x80940000
; ldr r1, =0xAA55
; str r1, [r0]
;
; ensure SVC32 mode with IRQ and FIQ disabled
;
mov r0, #0xd3
msr cpsr_c, r0
;
; Turn off the MMU
;
ldr r0, =CP15R1Init
mcr p15, 0, r0, c1, c0, 0
nop
nop
;
; If we loaded through eboot, SDRAM is already configured.
; Check the CLKSET1 register to see if it has been modified.
;
ldr r0, =REG_SCRATCH_REG0
ldr r1, [r0]
ldr r0, =EBOOT_RUN_FLAG
cmp r0, r1
beq DontConfigureSDRAM
;
;
; Configure SDRAM
;
bl SdramCfg
DontConfigureSDRAM
;
; If we want an image that copies from flash to ram use the following.
;
;
; Configure the flash chips
IF EP93XX_FLASH_TYPE = "FLASH_TYPE_J3"
ldr r0, =( (4:SHL:SMCBCR_WST2_SHIFT) :or: \
(15:SHL:SMCBCR_WST1_SHIFT) )
;ENDIF
ELSEIF EP93XX_FLASH_TYPE = "FLASH_TYPE_P3"
ldr r0, =( (3:SHL:SMCBCR_WST2_SHIFT) :or: \
(9:SHL:SMCBCR_WST1_SHIFT) )
ELSE
ldr r0, =((31:SHL:SMCBCR_WST2_SHIFT) :or: \
(31:SHL:SMCBCR_WST1_SHIFT) )
ENDIF
IF EP93XX_FLASH_WIDTH =16
ldr r1, =SMCBCR_MW_16BIT
ELSE
ldr r1, =SMCBCR_MW_32BIT
ENDIF
ldr r2, =((1 :and:SMCBCR_IDCY_MASK) :or: \
SMCBCR_WP :or: \
SMCBCR_PME :or: \
SMCBCR_RBLE)
orr r0, r0, r1
orr r0, r0, r2
ldr r1, =REG_FLASH_CONFIG
str r0, [r1]
nop
IF COPY_FLASH_TO_RAM
bl CopyCodeToRam
ENDIF
;
; create a temporary stack below kernel memory from config.bib
;
ExecuteFromRam
ldr r0, =EP93XX_SDRAM_PHY_ADDR
add r0, r0, #0x00040000 ;sp is set to the buffer of EDBG.
mov sp, r0
bl SysconSetup
;
; clear out magic words for memory and heap
; (r0) = physical address of OEMAddressTable
;
;
; Calculate the physical address of the table.
;
; r0 - Virtual address of OEMAddressTable
; r1 - Physical Address of Startup
; r2 - Virtual Address of Startup
;
; r0 = r0 - r2 + r1 = Physical address of OEMAddressTable
;
ldr r0,=OEMAddressTable
adr r1,StartUp
ldr r2,=StartUp
add r0, r0, r1
sub r0, r0, r2
bl KernelStart
;
; KernelStart should never return:
;
b .
;;***********************************************************************************
;;CopyCodeToRam function starts
;;***********************************************************************************
IF COPY_FLASH_TO_RAM
LEAF_ENTRY CopyCodeToRam
;
; Get the address of the table of contents and adjust for the flash address.
;
ldr r0, =pTOC
ldr r3, =ROM_OFFSET
add r0, r0, r3
ldr r4, [r0]
add r4, r4, r3
;
; Get the dll first and dll last address.
; r1 = Destiniation = dllfirst
; r11 = length = dlllast - dllfirst
;
ldr r1, [r4, #ROMHDR_dllfirst]
ldr r11, [r4, #ROMHDR_dlllast]
;
; Make sure that r1 and r11 are on a 0x20 boundary.
;
ldr r2, =0x07FFFFE0
ldr r0, =EP93XX_SDRAM_PHY_ADDR
and r1, r1, r2
orr r1, r1, r0
and r11, r11, r2
add r11, r11, #0x20
orr r11, r11, r0
;*************************************************************************
; Copy routine.
;
; r0 = Source
; r1 = Destination
;r10 = The last address of first piece of SDRAM.
; r11 = End Address Address of Destination
; r12 = LED counter
; r13 = LED address.
;
;*************************************************************************
;Get the end address of first piece of SDRAM from OEMAddressTable.
ldr r9,=OEMAddressTable
ldr r8, =ROM_OFFSET
add r9, r9,r8
ldr r2, [r9, #8] ; r2 is the size of first piece of SDRAM in M bytes.
cmp r2,#64
BHS GreatThan64M
ldr r10, [r9, #0x4];the physical address of first piece of SDRAM
ldr r2, [r9, #0x8] ;the size of first piece of SDRAM
mov r2, r2, LSL #20 ;change the size from xxM to xxxxx BYTES
add r10, r10, r2 ;then, r10 is the last physical address of first piece of SDRAM.
b SecondSDRAMEnd
GreatThan64M
ldr r2,=EP93XX_SDRAM_PHY_ADDR
add r10,r2,#0x4000000
SecondSDRAMEnd
;Initialize LED state;;
ldr r13, =REG_LED_ADDRESS
ldr r2, [r13]
and r2, r2, #0xFFFFFFFC
orr r2, r2, #1
str r2, [r13]
ldr r12, =0x3FFFF
ldr r0, =EP93XX_FLASH_PHY_ADDR
NKCopyLoop
ldmia r0!, {r2-r9}
stmia r1!, {r2-r9}
NK8MegTest
cmp r1, r10
bne NKLedTest
ldr r9,=OEMAddressTable
ldr r8, =ROM_OFFSET
add r9, r9,r8
ldr r1, [r9, #0x10]; set destination address to the second piece of SDRAM.
sub r11, r11, r10
add r11, r11, r1
NKLedTest
ands r2, r0, r12
beq ToggleLED
NKCopyTest
cmp r1, r11
bne NKCopyLoop
ldr r0, =EP93XX_SDRAM_PHY_ADDR
ldr r2, =ExecuteFromRam
and r2, r2, #0x00FFFFFF
orr r2, r2, r0
mov pc, r2
ToggleLED
ldr r2, [r13]
eor r2, r2, #3
str r2, [r13]
b NKCopyTest
mov pc, lr
ENDIF
; End of initialization code & data
TEXTAREA
END
--- Конец кода ---
Дает в окне вывод:
--- Код: ---PB Debugger The Kernel Debugger is waiting to connect with target.
4294767296 PID:0 TID:2 Processor = 184Mhz, Bus = 92Mhz
4294767296 PID:0 TID:2 Setting up softlog at 0x83ffc000 for 0x800 entries
4294767296 PID:0 TID:2 Booting Windows CE version 6.00 for (ARM)
4294767296 PID:0 TID:2 &pTOC = 81fe5c1c, pTOC = 81f8b9ac, pTOC->ulRamFree = 81fea000, MemForPT = 00001000
4294767296 PID:0 TID:2
Old or invalid version stamp in kernel structures - starting clean!
4294767296 PID:0 TID:2 Configuring: Primary pages: 8203, Secondary pages: 8188, Filesystem pages = 1639
4294767296 PID:0 TID:2
Booting kernel with clean memory configuration:
4294767296 PID:0 TID:2 Memory Sections:
4294767296 PID:0 TID:2 [0] : start: 81fec000, extension: 00005000, length: 0200b000
4294767296 PID:0 TID:2 [1] : start: 82000000, extension: 00004000, length: 01ffc000
4294767296 PID:0 TID:2 UpdatePhysicalRefCnt: Invalid Address 82000000 (PFN 04000000)
4294767296 PID:0 TID:2 NK Kernel: DEBUGCHK failed in file d:\yzkiqfe\private\winceos\COREOS\nk\kernel\nknormal\..\physmem.c at line 109
--- Конец кода ---
Навигация
Перейти к полной версии