每次从USB下载NK都能启动系统,但Launch Existing form NAND的时候启动系统时会死机。其打印的信息如下:
indows CE Kernel for ARM (Thumb Enabled) Built on Nov 24 2008 at 14:58:01
DCache: 128 sets, 4 ways, 32 line size, 16384 size
ICache: 128 sets, 4 ways, 32 line size, 16384 size
Arguments area has some values. Do not Initialize
-OALArgsInit()
+OALTimerInit( 1, 33250, 0 )
-OALIntrRequestSysIntr(irq = 38, sysIntr = 16)
[FMD] FMD_Init() : NUM_OF_BLOCKS = 2048
[FMD] FMD_Init() : PAGES_PER_BLOCK = 64
[FMD] FMD_Init() : SECTORS_PER_PAGE = 4
[FMD] FMD_Init() : Addr Cycle = 5
[FMD] --FMD_Init()
#### Warning:NAND_LB_ReadSectorInfo Spare ECC operation for SectorInfo failed
#### Warning:NAND_LB_ReadSectorInfo Spare ECC operation for SectorInfo failed
#### Warning:NAND_LB_ReadSectorInfo Spare ECC operation for SectorInfo failed
#### Warning:NAND_LB_ReadSectorInfo Spare ECC operation for SectorInfo failed
[FMD:ERR] FMD_OEMIoControl() : IOCTL_DISK_GET_STORAGEID is unsupported
[OAL] Not Clear Storage
[OAL] Not Clear System Hive
[OAL] Not Clear User Hive
[OAL] Not Clear System Hive
WARN: OALIoCtlHalGetHWEntropy: Buffer too small
-OALIntrRequestSysIntr(irq = 88, sysIntr = 18)
-OALIntrRequestSysIntr(irq = 11, sysIntr = 19)
-OALIntrRequestSysIntr(irq = 9, sysIntr = 20)
-OALIntrRequestSysIntr(irq = 40, sysIntr = 21)
-OALIntrRequestSysIntr(irq = 19, sysIntr = 22)
-OALIntrRequestSysIntr(irq = 23, sysIntr = 23)
-OALIntrRequestSysIntr(irq = 20, sysIntr = 24)
-OALIntrRequestSysIntr(irq = 96, sysIntr = 25)Storage
经分析,初步怀凝是USB中断引起的问题,因为IRQ96 就是OTG中断。
做了以下经证:
第一步,在FLATFORM/SMDK6410.BAT文件里面把USB禁止掉,设定如下,然后再编译NK,发现可以从NAND 启动了。
set BSP_NOUSBHCD=1
@REM If you want to exclude USB Function driver in BSP. Set this variable
set BSP_NOUSBFN=1
@REM This select default function driver
@REM set BSP_USBFNCLASS=SERIAL
@REM set BSP_USBFNCLASS=MASS_STORAGE
第二步:确定了是USB的问题后,开始检查,在做EBOOT的时候记得USB时钟好像被更改过,当时只改了EBOOT部分的。于是将所有的USB时钟都改过来,重新编译。
static void InitializeOTGCLK(void)
{
volatile S3C6410_SYSCON_REG *pSysConReg = (S3C6410_SYSCON_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_SYSCON, FALSE);
volatile OTG_PHY_REG *pOtgPhyReg = (OTG_PHY_REG *)OALPAtoVA(S3C6410_BASE_REG_PA_USBOTG_PHY, FALSE);
pSysConReg->HCLK_GATE |= (1<<20);
pSysConReg->OTHERS |= (1<<16);
pOtgPhyReg->OPHYPWR = 0x0; // OTG block, & Analog bock in PHY2.0 power up, normal operation
// gao0129
//pOtgPhyReg->OPHYCLK = 0x20; // Externel clock/oscillator, 48MHz reference clock for PLL
pOtgPhyReg->OPHYCLK = 0x0; // External crystal, 48MHz reference clock for PLL
pOtgPhyReg->ORSTCON = 0x1;
Delay(100);
pOtgPhyReg->ORSTCON = 0x0;
Delay(100); //10000
pSysConReg->HCLK_GATE &= ~(1<<20);
}
问题解决。