2440 6.0BSP 移植过程之KITL篇
//-----------------------------------------------------------------------------------------------------------
// 作者:wogoyixikexie@gliet
//论坛账号:gooogleman (经常在CSDN出没)
// 版权:桂林电子科技大学一系科协wogoyixikexie@gliet
// 平台:wince5.0 2440 5.0 BSP
// 发布日期:2009年6月18日 9:49:38
// 最后修改:
// 注意事项:未经作者同意,不得在转载的时候擅自修改、删除文章的任何部分
//-----------------------------------------------------------------------------------------------------------
作者:wogoyixikexie@gliet(注意转载请标明原创作者)
显示驱动虽然显示一段时间就黑屏了,但是至少证明2440 跑起来了。现在弄wince的调试利器——KITL
以前我直接用三星做好的2440 5.0 BSP 的KITL,对于他我真是不了解。现在来移植,感觉压力很大,不管怎么说还是先开始吧。
看了一下wince6.0自带的几个PXA的BSP,发现和5.0的KITL的确有很大区别。后来觉得PXA和三星差距较大,不能作为参考的。后来问朋友要了个6410 BSP(据说现在还不支持KITL,我不信,三星不会这点都做不好的。),看了一下,发现是支持的,并且和2440 5.0 BSP的写法较为接近。好就参考它了。
6410 KITL下有kitl.c kitlser.c kitlusbser.c kitlusbser.h 不过sources只用了kitl.c ,目前原因不明,奇怪H:\WINCE600\PLATFORM\MAINSTONEIII\SRC\KITL 下也只用了kitl.c ,其他的跑到哪里去了?
再看MSDN
Create the sources file.
To do this, use the following commands:
TARGETNAME=KITL
TARGETTYPE=DYNLINK
DLLENTRY=KitlDllMain
DEFFILE=
删除
$(_TARGETPLATROOT)\lib\$(_CPUDEPPATH)\oal.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\nk.lib \
Then, add the following TARGETLIBS: KitlCore.lib, OEMStub.lib, and NkStub.lib.
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\kitlcore.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\nkstub.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\oemstub.lib \
These libraries are in addition to any other libraries required by your KITL implementation.
Rename OALKitlStart to OEMKitlStartup.
Initialize two KITL power function pointers in OEMKitlInit.
To do this, use the following code example:
pKitl->pfnPowerOn = OALKitlPowerOn;
pKitl->pfnPowerOff = OALKitlPowerOff;
This step is required only if your OAL is implementing these functions.
编译
警告1 BUILD: [00:0000000060:WARNN ] H:\WINCE600\PLATFORM\QxCE6BSP\src\KITL\: Missing source file: H:\WINCE600\OSDesigns\Try2440CE6\Try2440CE6\Wince600\QxCE6BSP_ARMV4I\cesysgen\oak\lib\ARMV4I\debug\kitl.lib.
BUILD: [Thrd:Sequence:Type ] Message
BUILD: [01:0000000100:ERRORE] NMAKE : U1073: don't know how to make 'H:\WINCE600\OSDesigns\Try2440CE6\Try2440CE6\Wince600\QxCE6BSP_ARMV4I\cesysgen\oak\lib\ARMV4I\debug\kitl.lib'
BUILD: [01:0000000102:ERRORE] NMAKE.EXE TargetExeFiles -i -c BUILDMSG=Stop. BUILDROOT=H:\WINCE600\PLATFORM\QxCE6BSP CLEANBUILD=1 LINKONLY=1 NOPASS0=1MAKEDLL=1 failed - rc = 2
TARGETLIBS= \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\kitlcore.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\nkstub.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\oemstub.lib \
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\oal_abort_s3c2440a.lib \
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\oal_cache_s3c2440a.lib \
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\oal_memory_s3c2440a.lib \
$(_TARGETPLATROOT)\lib\$(_CPUDEPPATH)\oal_io_s3c2440a.lib \
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\oal_intr_s3c2440a.lib \
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\oal_timer_s3c2440a.lib \
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\oal_power_s3c2440a.lib \
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\oal_rtc_s3c2440a.lib \
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\oal_ioctl_s3c2440a.lib \
$(_PLATCOMMONLIB)\$(_CPUINDPATH)\oal_io.lib \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\oal_other.lib \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\oal_log.lib \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\oal_kitl.lib \
$(_PLATCOMMONLIB)\$(_CPUINDPATH)\oal_ethdrv_cs8900a.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ddk_io.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\vbridge.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\kitl.lib \汗是这个没有删除掉。自己给自己打包,不错才怪
$(_TARGETPLATROOT)\src\common\kitlusbser\kitlusbser_lib.lib \
$(_TARGETPLATROOT)\lib\$(_CPUDEPPATH)\smflash_lib.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\fulllibc.lib
修改sources
并把一些INC 下的H文件配置直接复制过来。,就编译通过了。
SOURCES=args.c\
kitl.c \
kitlusbser.c\
kitlser.c
TARGETLIBS=\
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\kitlcore.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\nkstub.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\oemstub.lib \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\kitl_log.lib \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\oal_kitl.lib \
$(_PLATCOMMONLIB)\$(_CPUINDPATH)\oal_ethdrv_cs8900a.lib \
$(_TARGETPLATROOT)\src\common\kitlusbser\kitlusbser_lib.lib \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\oal_memory_arm.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ddk_io.lib \
$(_COMMONOAKROOT)\lib\$(_CPUDEPPATH)\vbridge.lib \
$(_TARGETPLATROOT)\lib\$(_CPUDEPPATH)\smflash_lib.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\fulllibc.lib
晕,编译是通过了,但是不行
CoreCon) Download service map set to NONE; ignoring download request!
PB Debugger The Kernel Debugger is waiting to connect with target.
就不动了
DNW就输出
Windows CE Kernel for ARM (Thumb Enabled) Built on Nov 24 2008 at 14:58:23
ProcessorType=0920 Revision=0
OEMAddressTable = 8022a8d0
DCache: 8 sets, 64 ways, 32 line size, 16384 size
ICache: 8 sets, 64 ways, 32 line size, 16384 size
OEMKitlStartup : USB SERIAL
DeviceId................. 2440USBSerKitl
pArgs->flags............. 0x1
pArgs->devLoc.IfcType.... -1
pArgs->devLoc.LogicalLoc. 0x52000140
pArgs->devLoc.PhysicalLoc 0x0
pArgs->devLoc.Pin........ 25
pArgs->ip4address........ 0
pDevice->Name............ s
pDevice->ifcType......... -1
pDevice->id.............. 0x52000140
pDevice->resource........ 0
pDevice->type............ 1
pDevice->pDriver......... 0x80E884B0
Wait for connecting
引用 18 楼 paul_chao 的回复:
LZ 是用 2440 吧, USB 1.1 的.
LZ 是不是透过 DNW 的 USB download 的,
1. 若是, 则有没有把 D+ 的 pull-high 1.5KOhm 的 resistor disable 後一阵子再 enable 以通知 PC 重新辨认 USB device. 这样就不会停在 Wait for connecting
2. 若不是, 则把 USB 再重新插拔一次再试试看.
Paul, Chao @ Techware
汗。真的如您所说,重新插拔就行了。
现在还没有尝试断点,不过五分钟之后LCD黑屏了。——没有使用KITL也会这样,难道是电源管理影响了?
现在尝试一下断点先。哈哈。
进入桌面后会不停的打印
4294802319 PID:400002 TID:2480002 ++S3C2440DISP::BltPrepare
4294802319 PID:400002 TID:2480002 --S3C2440DISP::BltPrepare
225309 PID:400002 TID:2a20002 ++DrvEscape
225309 PID:400002 TID:2a20002 --DrvEscape