Re: USB Kitl source code

Tech-Archive recommends: Speed Up your PC by fixing your registry



Sha,
Has anyone built AKU3.5 plus MainStoneIII in the debug mode?
I have been trying following various suggestions from yourself and
others
and I keep getting the following message during the build process. See
below:

BUILD: [01:0000002251:INFO ] -nodefaultlib

BUILD: [01:0000002252:INFO ] -entry:StartUp

BUILD: [01:0000002253:INFO ]
-pdb:C:\WM535\platform\MAINSTONEIII\target\ARMV4I\debug\kernkitl.pdb

BUILD: [01:0000002254:INFO ] -pdbaltpath:kernkitl.pdb

BUILD: [01:0000002255:INFO ] -debug -debugtype:cv -incremental:no

BUILD: [01:0000002256:INFO ]
-map:C:\WM535\platform\MAINSTONEIII\target\ARMV4I\debug\kernkitl.map

BUILD: [01:0000002257:INFO ]
-savebaserelocations:C:\WM535\platform\MAINSTONEIII\target\ARMV4I\debug\kernkitl.rel


BUILD: [01:0000002258:INFO ] -MERGE:.rdata=.text -merge:.astart=.text
-subsystem:native /DEBUG /DEBUGTYPE:CV /FIXED:NO -align:4096
-ignore:4001,4070,4078,4086,4089,4096,4099,4108,4229 /STACK:65536,4096

BUILD: [01:0000002259:INFO ] -subsystem:windowsce,5.01

BUILD: [01:0000002260:INFO ] -base:0x00010000

BUILD: [01:0000002261:INFO ]
C:\WM535\platform\MAINSTONEIII\lib\ARMV4I\debug\oal.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\nk.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\pxa27x_xllp.lib
C:\WM535\platform\MAINSTONEIII\lib\ARMV4I\debug\mainstoneii_args.lib
C:\WM535\platform\MAINSTONEIII\lib\ARMV4I\debug\mainstoneii_freq.lib
C:\WM535\platform\MAINSTONEIII\lib\ARMV4I\debug\mainstoneii_io.lib
C:\WM535\platform\MAINSTONEIII\lib\ARMV4I\debug\mainstoneii_dbgserial.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_timer_varidle.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_startup_pxa27x.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_cache_pxa27x.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_intr_pxa27x.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_memory_pxa27x.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_timer_vartick_pxa27x.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_abort_pxa27x.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_power_pxa27x.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_rtc_pxa27x.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_misc_pxa27x.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_ethdrv_lan91c.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\ne2kdbg.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_ioctl.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_io.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_kitl.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_log.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\oal_other.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\vbridge.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\kitl.lib
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\fulllibc.lib

BUILD: [01:0000002262:ERRORE] oal.lib(bul_usbfn.obj) : error LNK2005:
dpCurSettings already defined in nk.lib(debug.obj)

BUILD: [01:0000002263:ERRORE]
C:\WM535\platform\MAINSTONEIII\target\ARMV4I\debug\kernkitl.exe : fatal
error LNK1169: one or more multiply defined symbols found

BUILD: [01:0000002264:INFO ] fixts
C:\WM535\platform\MAINSTONEIII\target\ARMV4I\debug\kernkitl.exe

BUILD: [01:0000002265:INFO ]
C:\WM535\platform\MAINSTONEIII\target\ARMV4I\debug\kernkitl.exe(0) :
fatal error FTS0001 : Unable to locate file

BUILD: [01:0000002266:INFO ] signbin
C:\WM535\platform\MAINSTONEIII\target\ARMV4I\debug\kernkitl.exe

BUILD: [01:0000002267:INFO ] SIGN: File
'C:\WM535\platform\MAINSTONEIII\target\ARMV4I\debug\kernkitl.exe' does
not exist.

BUILD: [01:0000002268:INFO ] Stop.

The original definition for dpCurSetting appears to be generated
through the following build sequence
and is probably based in nkmain.lib

Copying ddgpe.*
Copying pm_mdd_lib.*
Copying pm_default_pdd_lib.*
Copying pm_pda_pdd_lib.*
Copying pmstubs_lib.*
Copying pm_pdd_common_lib.*
Copying wdmutil.*
Copying au1pcc_lib.*
Copying gwestubs.*
Copying atapi_common_lib.*
Copying atapi_pcio_lib.*
Copying atapi_pcio_cd_lib.*
Copying atapi_pcip_pdc20262_lib.*
Copying atapi_pcmcia_lib.*
set NKLIBS=
set NKLIBS=%NKLIBS%
C:\WM535\public\common\oak\lib\ARMV4I\debug\nkcompr.lib
set NKLIBS=%NKLIBS%
C:\WM535\public\common\oak\lib\ARMV4I\debug\nkmapfile.lib
set TARGETTYPE=LIBRARY
set TARGETNAME=nk
set RELEASETYPE=OAK
set TARGETLIBS=
set SOURCELIBS=%NKLIBS%
C:\WM535\public\common\oak\lib\ARMV4I\debug\nkmain.lib
nmake /NOLOGO
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\nk.lib
makefile.def: Invoked with predefined settings:
TARGETNAME: nk
TARGETTYPE: LIBRARY
RELEASETYPE: OAK
TARGETLIBS:
SOURCELIBS: C:\WM535\public\common\oak\lib\ARMV4I\debug\nkcompr.lib
C:\WM535\public\common\oak\lib\ARMV4I\debug\nkmapfile.lib
C:\WM535\public\common\oak\lib\ARMV4I\debug\nkmain.lib
DLLENTRY: CoreDllInit
makefile.def: BUILDROOT is C:\WM535\public\common\cesysgen
0 Please add _COMMONPUBROOT and __PROJROOT to your tree's
cesysgen\sources file.
makefile.def: Including C:\WM535\public\wpc\oak\misc\makefile.inc
Directory: C:\WM535\PUBLIC\COMMON\CESYSGEN
TARGETNAME: nk
makefile.def: Including
C:\WM535\public\common\oak\misc\sources.ReleaseType_OAK
public\common\cesysgen\makefile: Warning: No replace resources found
for 0409. Using 0409 instead.
BUILD_MARKER:LINK_STATIC_LIBRARY_START Linking
C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\nk.lib
link -lib
-out:C:\WM535\public\wpc\cesysgen\oak\lib\ARMV4I\debug\nk.lib
-machine:thumb @C:\DOCUME~1\sinclaij\LOCALS~1\Temp\nm483D.tmp
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
1 file(s) copied.
BUILD_MARKER:LINK_STATIC_LIBRARY_END

Any help would be appreciated. Thankx
John Sinclair
Sha Viswanathan [MSFT] wrote:
Mukesh,

Bulverde/MainstoneIII is my favorite example of USB RNDIS KITL. Source code
availble to the public. You can look at MainstoneIII in CE6.0, or if you
have WM5.0 installed, you can download the MainstoneIII Update which also
has the code:
[http://www.microsoft.com/downloads/details.aspx?FamilyID=BDF43D00-55B6-4E51-82A5-F0A8395D4903&displaylang=en].
The installer requires that Windows Mobile 5
already be installed, as this is an add-on (more details on that site).

In these instructions, I'm referencing the above code.

USB RNDIS KITL requires:

1. The Microsoft RNDIS MDD (rne_mdd.lib) without modification.

(\public\common\oak\drivers\ethdbg\rne_mdd)



2. A USB Function PDD with slight modifications to run single-threaded
(\platform\mainstoneiii\src\common\usbfn\bul_usbfn.c)



3. A glue-wrapper that combines the two.
(\platform\mainstoneiii\src\common\usbfn\rndiskitl\rndis_pdd.c). The
libraries in #1-3 link together to form mainstoneii_usbfn_rndiskitl.lib



4. Hooks in the BSP's OAL to link with, and expose the entry points of
mainstoneii_usbfn_rndiskitl.lib for KITL debugging.



5. Hooks in the BSP's bootloader to

a. Allow a user to select USB RNDIS for KITL if other choices are
available (like Ethernet).

b. Program the user's selection (or hardcode) into a reserved region of
memory called the "BSP_ARGS" so when the OS loads, it knows which KITL
transport to use.

c. Enable image downloads by exposing mainstoneiii_usbfn_rndiskitl.lib's
entry points into the bootloader


For #1, just remember to link this in later.

For #2, compare bul_usbfn.c to the OS-level PDD (also called bul_usbfn.c) to
see the differences (remove threads, critical sections, __try/__except) if
you have to write this yourself.

For #3, you should copy rndis_pdd.c into your platform, and you should not
have to make changes (you can review this file and double check usage).

For #4, (adding a KITL transport into the OAL)
4.1) Available physical ports to support KITL are listed in the
g_kitlDevices variable in kitl_cfg.h. Locate this file (probably
\[platform]\src\inc).



4.2) Add an entry to g_kitlDevices for USB_RNDIS KITL (change PXA27X where
appropriate):

{

L"USB_RNDIS", Internal, BULVERDE_BASE_REG_PA_UDC, 0, OAL_KITL_TYPE_ETH,
&g_kitlEthUsbRndis

},



...where g_kitlEthUsbRndis is (add this to kitl_cfg.h):

OAL_KITL_ETH_DRIVER g_kitlEthUsbRndis = OAL_ETHDRV_RNDIS_PXA27X;



...and OAL_ETHDRV_RNDIS_PXA27X are your library entry points (add this
too) #define OAL_ETHDRV_RNDIS_PXA27X { \

(OAL_KITLETH_INIT)HostMiniInit, \

NULL, \

NULL, \

(OAL_KITLETH_SEND_FRAME)RndisEDbgSendFrame, \

RndisEDbgGetFrame, \

RndisEnableInts, \

RndisDisableInts, \

PXA27X_RndisPowerOff, \

PXA27X_RndisPowerOn, \

(OAL_KITLETH_CURRENT_PACKET_FILTER)RndisCurrentPacketFilter, \

(OAL_KITLETH_MULTICAST_LIST)RndisMulticastList \

}



4.3) So these functions are available to the OS, link
mainstoneii_usbfn_rndiskitl.lib into your OAL sources file (probaby
\[platform]\src\kernel\oal\sources)


For #5,
Depends on your bootloader. Do you have a menu? If you have an option for
selecting which type of KITL to run, add this to your options list. Then
just give the bootloader your mainstoneii_usbfn_rndiskitl.lib interface.
This happens in
\platform\mainstoneiii\src\bootloader\eboot\ether.c:





// For image download, we need to init the USB port ourselves

// Then expose other function pointers for the rest of the bootloader
to use

// init USB registers

if (HostMiniInit((PCHAR) NULL, 1, pKITLArgs->mac))

{

pfnEDbgInit = RndisInit;

pfnEDbgEnableInts = RndisEnableInts;

pfnEDbgDisableInts = RndisDisableInts;

pfnEDbgGetFrame = RndisEDbgGetFrame;

pfnEDbgSendFrame = RndisEDbgSendFrame;

pfnEDbgReadEEPROM = NULL;

pfnEDbgWriteEEPROM = NULL;





Sorry if this is more confusing than helpful; just pay attention to the
source code I've referenced at let that be your guide and answer all your
questions.



-Sha Viswanathan [MS]
This posting is provided "AS IS" with no warranties, and confers no rights.




"Mukesh" <mukesh.usp@xxxxxxxxx> wrote in message
news:1165466811.070427.268220@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Vishwanath,

I am working on samsung SOC.
I want to write usb kitl for it.
Right now we hav only .lib file but not souce code.
Although i hv source code file but its not working(means source code
given to us is different from .lib means usbserial kitl only works with
that lib not others.).
I really dont know why.
Now I want to write source code for it.
Can u help me out.
Ur help will be highly appreciated.
Thanks in advance

Regards
Mukesh Modi


Sha Viswanathan [MSFT] wrote:
Perhaps we need to broadcast our features better....Since the MainstoneIII
refresh we've had USB RNDIS KITL
(\platform\mainstoneiii\src\common\usbfn\rndiskitl\) for BOTH download and
debug (You'll find this lib linked into KITL and EBOOT). This feature
carried forward into the CE6 MainstoneIII BSP...so believe its there!

Just set BSP_RNDIS_USB_KITL and clean build the \*kitl* directories in the
BSP. You then select USB RNDIS KITL by breaking into the EBOOT menu over
hyperterm (you'll see the setting). When the OS image loads, it'll see
that
USB RNIDS KITL was selected in EBoot, initialize your USB hardware and
connect. (For first time use, you may have to point to the driver *.inf in
\public\COMMON\oak\drivers\ethdbg\rndismini\Host)

Many customers are using USB RNDIS KITL on Mainstone for downloading and
debugging...it should be working just fine in CE6.0, and in 5.0 with the
MainstoneIII refresh. Please let me know if you have more questions.

-Sha Viswanathan [MS]
This posting is provided "AS IS" with no warranties, and confers no
rights.



"Michel Verhagen (eMVP)" <mverhagen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:%23BhYF7YGHHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
In Windows CE 5.0 only download over USB was supported in mainstone,
*not*
KITL (despite the confusing name rndiskitl). It'll be very good news if
CE
6.0 indeed supports KITL over USB, but I have to see it to believe it.

Michel Verhagen, eMVP
EmbeddedFusion
www.EmbeddedFusion.com
mverhagen at embeddedfusion dot com

RH wrote:
Hello Anthony,

Thanks for your reply. So from what I can understand, you still have
to
implement the MDD layer using CE 6.0? I found something in the
MAINSTONEIII platform, a variable named BSP_RNDIS_USB_KITL. The
platform.reg file has a couple of lines,

IF BSP_RNDIS_USB_KITL !
; If the RNDIS KITL is used and KITL is enabled, we must exclude the
; USB function driver to avoid conflict
"Dll"="ms2_usbfn.dll"
ENDIF BSP_RNDIS_USB_KITL !

These few lines indicate that KITL across USB should already be
available
on the MAINSTONEIII Platform. The question is How can I enable it? RH


"Anthony Pellerin" wrote:

You can base on the MDD in
\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\ETHDBG\RNE_MDD. You have to modify
your bootloader to download the image and your kernel to support the
kernel.
Basically it works the same as for the Ethernet : you have to
implement
some functions (init, getframe, sendframe...) and give pointers to the
system.

HTH

--
--
--
----------------------------------------------------------------
Anthony Pellerin (eMVP)
ADENEO (ADESET)
Windows Embedded Consultant
<apellerin AT adeneo DOT adetelgroup DOT com>
http://www.adeneo.adetelgroup.com
Tél : +33 (0)4.72.18.57.77
Fax : +33 (0)4.72.18.57.78
----------------------------------------------------------------
"RH" <RH@xxxxxxxxxxxxxxxxxxxxxxxxx> a écrit dans le message de news:
8D958DE4-A683-4A13-9E67-E2E3A7324BEC@xxxxxxxxxxxxxxxx
Hi All,

I have been struggling to get some information on how to use KITL
across USB
using Windows Embedded CE 6.0! I attended an OEM Technical Seminar at
MS and
was told by one of the presenters that this can be achieved, however
he
also
said that he couldn't tell me how it can be done as he had not used
it.
Does
anyone have any useful information on this?

I have read a number of posts on the forums and can't seem to get a
clear
answer. There are many references to PB CE 5.0, however you had to
implement
the MDD layer. From my understanding the MAINSTONEIII BSP has this
item
supported, however once again I cannot find something that explains
how
KITL
across USB can be achieved. I am using the PXA27x. Can anyone help?

Thanks,

RH



--

.



Relevant Pages

  • Re: USB Kitl source code
    ... Has anyone built AKU3.5 plus MainStoneIII in the debug mode? ... Copying pm_mdd_lib.* ... Bulverde/MainstoneIII is my favorite example of USB RNDIS KITL. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB Kitl source code
    ... Has anyone built AKU3.5 plus MainStoneIII in the debug mode? ... Copying pm_mdd_lib.* ... Bulverde/MainstoneIII is my favorite example of USB RNDIS KITL. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB Kitl source code
    ... Has anyone built AKU3.5 plus MainStoneIII in the debug mode? ... Copying pm_mdd_lib.* ... Bulverde/MainstoneIII is my favorite example of USB RNDIS KITL. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB Kitl source code
    ... Bulverde/MainstoneIII is my favorite example of USB RNDIS KITL. ... You can look at MainstoneIII in CE6.0, ... source code I've referenced at let that be your guide and answer all your ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB Kitl
    ... implement the MDD layer using CE 6.0? ... I found something in the MAINSTONEIII ... If the RNDIS KITL is used and KITL is enabled, ... These few lines indicate that KITL across USB should already be available on ...
    (microsoft.public.windowsce.platbuilder)