none
HOW TO WRITE A USB STREAM DRIVER FOR WINCE IN C LANGUAGE RRS feed

  • Question

  • Hello Sir,

                  Iam trying to write a usb stream driver .I dont know how to start.

    and this are my questions

    1)which hardware i have to  use?suggest me ahardware that is easily avialable like usb mouse ,keyboard

    2)How to write a usb driver?

    pls help............... thanks a lot

    Tuesday, June 8, 2010 6:33 PM

Answers

  • here is the link to learn windows CE 5.0 from msdn

    http://msdn.microsoft.com/en-us/library/bb847951.aspx

    See the windows ce 5.0 development center link

    http://msdn.microsoft.com/en-us/windowsembedded/ce/dd424929.aspx

    This link contains all the necessary information about the windows ce 5.0 including book details and videos etc...

    Now come to your next question.

    Workspaces are projects to create a binary for the selected BSP and the selected OS components.

    you see the workspaces in (Wince500\PBWorkspaces\)

    you should have the BSP for your device then only you can create a workspace for your device.

    BSP (Board support packages) contains device specific folders and files like Drivers, bootloaders, device specific kernel part and registry settings related to your drivers and application(platform.reg).

    BSPs are located in wince500\platform\<BSPs>

    Now my questions are,

    Are you going to develop a custom device based on the current device as a reference?

    In this case you have to clone the existing BSP and add your new device related stubs.

    or

    Are you going to develop any custom application on the existing device?

    In this case, you no need to create a BSP. you can use the existing BSP and add the necessary component to the existing workspace or you can create a new workspace.

    Before doing the things you just read the above given links.

    if you think that the above answers are useful to you, Mark the replies as answered. it will encourage us to share our knowledege and participation.

    Good luck


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Tuesday, June 22, 2010 10:38 AM
  • Try to post your new question in new thread.Don't post different questions in same topic.It would be difficult for the others who are referring this.
     
    Try to post your queries with related topics which will help others.
     
    For your question,try the following

    "Language Switching.scr"  "$(_FLATRELEASEDIR)\Language Switching.scr"               NK

    --
    Regards,
    Prabu
    http://prabukumar.wordpress.com/
    www.e-consystems.com
    Wednesday, June 23, 2010 1:30 PM
  • Sorry selva, i was busy with some other work. yes you try Prabu's suggestion, it will solve your error.


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Wednesday, June 23, 2010 2:06 PM

All replies

  • Hello sir

              thank u sir, iw ill post in that link.

    Tuesday, June 8, 2010 6:38 PM
  • If you are going to write a Host Controller Driver then you should read this: http://msdn.microsoft.com/en-us/library/ee484237(v=WinEmbedded.60).aspx

    If you are going to write a Host Client Driver then you should read this: http://msdn.microsoft.com/en-us/library/ee481462(v=WinEmbedded.60).aspx

    If you are going to write a Function Driver (Controller or Client) then you should read this: http://msdn.microsoft.com/en-us/library/ee483825(v=WinEmbedded.60).aspx

    The above links are assuming that you are dealing with Windows CE 6.0, similar documentation (but at different locations) do exist for older versions of Windows CE.

    Your post is a little vague as to what you have to accomplish, so it'll be difficult for others to give more direct advice.

    The hardware that you need to use will depend on your requirements.  For instance, if you need to develop a Host Controller Driver, I would grab all the types of USB Devices that you need to support, and test those with your platform.  Of course, you will also have to enable the Host Client Drivers in Platform Builder (or write your own if they don't exist) as appropriate.

    If you need to develop a Host Client Driver or Function Driver it should already be clear what hardware you need, as you are writing the driver for a particular device or functionality.

    Hope this helps,

    Brad.

    Tuesday, June 8, 2010 8:10 PM
  • Dear Bradley,

    Thanks for ur reply actually iam having a mini 2440a arm kit and i have written a stream driver for driving the led

    This are the functions i have used for the led stream  driver

    LED_Close
        LED_Deinit
        LED_Init
        LED_IOControl
        LED_Open
        LED_PowerDown
        LED_PowerUp
        LED_Read
        LED_Seek
        LED_Write

    this is the experience i got in drivers

     

    and i called the driver by system function deviceiocontrol and by platform builder  i build the image, using evc++ i called my driver and it works fine.

    like that i want to write a usb driver with those 10 functions above mentioned for a stream driver.

    currently iam not having any idea of the hardware.I need u to suggest me a usb hardware for a starter like me.

    and pls give me the procedure and links to write such a usb  stream driver.pls sir help me.

     

    Thank you

     

    Wednesday, June 9, 2010 4:20 AM
  • I am not understanding what it is you are trying to do, so I cannot give you any more advice than for you to read the links that I already posted.  The links have information on dealing with a USB Host Controller Driver, USB Host Client Driver, USB Function Controller Driver and USB Function Client Driver (so all the permutations of Usb Drivers.)

    Perhaps stepping back and explaining what you are trying to accomplish will help put you down the correct path as to where to start reading.  Otherwise, I suggest reading the beginning of all links to understand what each one is for, then use that to determine which one you need to read in detail.

    If your goal is to have say a Computer (Usb Host) connect to your device (Usb Device) via a USB Cable and Control the LEDs on your device then you need to look at writing a Function Driver Client on the Windows CE Device, and you need to read the link that I already provided for this.  Again, depending on what your goal is, there may or may not already be a driver written for what you need.

    Hope this Helps,

    Brad

    Wednesday, June 9, 2010 4:50 PM
  • Dear Bradley,

     

    My project is very simple.

    This is the thing iam going to do.

    Iam having a wince  device, i just want to connect a usb cable with my device and i want to send a char such as "a","b" to my windows xp system

    In my widows xp system i want to see  the char "a","b" just like UART .how can i do it using c language.

     

    Pls help me to do it sir

     

    Thanks,

    selva

     

    Wednesday, June 9, 2010 6:22 PM
  • You probably want to implement your device as a Usb Function Serial Client Driver (http://msdn.microsoft.com/en-us/library/ee481935(v=WinEmbedded.60).aspx) and have it appear to your Computer as a Serial Driver.

    So you will want to read up on the Usb Function Serial Client Driver and Usb Function Client Driver to understand both how the Usb Function Client Drivers work and the Serial Version as well.

    There is also Sample code here: %_WINCEROOT%\Public\Common\OAK\Drivers\USBFN\Class\Serial

    I've never dealt with the Usb Function Serial Client Driver so I likely cannot be much more help on the actual specifics of that driver.

    Good Luck,

    Brad.

    Wednesday, June 9, 2010 6:52 PM
  •  Hi bradley,

     

    i dont want to implement a serial driver,in both ends i want to get data through usb.

    or give me a link of a tutorial for writing a usb driver.

    Friday, June 11, 2010 6:10 PM
  • windows CE is already having a serial client driver and your purpose is to simply sending a custom data through USB cable from your device and you want to receive the data in PC. if this is correct,

    Enable the existing USB serial driver(SYSGEN_USBFN_SERIAL) in windows CE and it will expose the USB as a virtual serial port in the device. you can open the serial port( COM ) using CreateFile() and perform read and write operation using ReadFile() and WriteFile().

    In the PC side, the device will be detected as a virtual serial port (COM) and again open the serial port and perform read and write operations in a same way.

    This is very simple and no need to write a driver. you can perform data transfer between the PC and the device using a simple  serial port application.

     If this is not correct,

    USB is not like a custom stream driver. you have to write a USB custom functional client driver in the device and also a custom client driver in the host to understand your data or you can use LibUSB-win32 or winusb to directly open the corresponding endpoint to send/receive the data in PC.

    if you really in the need of writing a custom client driver in windows CE, you have to see the sample client drivers in the following directory.

     _WINCEROOT%\Public\Common\OAK\Drivers\USBFN\Class\

    UFNPRN is the best sample to initiate the class driver develoment. Before proceeding that you should get some knowledge about USB protocol stack. search for "USB complete" in google, you will get some ebooks for USB.

    Here is the link for windows CE USB class driver

    http://msdn.microsoft.com/en-us/library/ee483825(v=WinEmbedded.60).aspx

    Good Luck


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Friday, June 11, 2010 7:19 PM
  • hello Mr.vinoth,

     

    now i want  to boot windows ce from compact flash.i have tried the procedure in net but a  littile success windows logo is visible after that a blank screen is coming.

     

    what are the possible reasons help me

    Saturday, June 19, 2010 7:33 PM
  • if you download the image through platform builder, is it working properly?

    can you try with the debug build and post the debug messages here?

    Have you created your image in Kiosk Mode?


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Monday, June 21, 2010 3:54 AM
  • Dear anna,

    Iam also from chennai working in velacherry.i saw ur blog Impressing.

    anna this are the things i have done

    actual for our tablet pc  I have a nk bin, builddir everything  and it is working fine

    Pls help me to copy the nk bin to the compact flash.

    and i also tried these steps

    http://geekswithblogs.net/BruceEitman/archive/2009/07/12/platform-builder-setting-up-a-usb-key-to-run-biosloader.aspx

    Monday, June 21, 2010 4:02 AM
  • i have given some links relevant to your issue. Have a look.

    http://www.relatedterms.com/thread/1254378/Howto%20install%20BIOSboot%20on%20Compact%20Flash%20

    This is for hard disk. you can use the compact flash as IDE.

    http://www.e-consystems.com/BootingWindowsCE.asp

    search Biosloader in your platform builder help, you will get some relevant links.

     


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Monday, June 21, 2010 7:05 AM
  • Dear anna,

              i have solved the problem, now i have an another problem.

     

    with nk.bin iam having a lot of folders in the image such as windows,intxxx,dxxx,whether this files are generated by platformbuilder or we have to make it.

    if it is generated by workspace where can i copy these files.

     

     

    selva

     

    Monday, June 21, 2010 10:15 AM
  • Dear Anna,

    i want to learn more about wince,can i learn from u also i can pay u money.

    can u send ur contact number,if u wish.

     

     

    Thanks,

    J.Selvabharathi.

    Monday, June 21, 2010 10:31 AM
  • Hi selva,

    I didn't conduct windows CE training but i am sharing my knowledege through the windows CE newsgroups,forums and blogs. you can learn windows ce very easily. There are lots of books available. first two are free books. 

    http://cache.freescale.com/files/32bit/doc/user_guide/CE_Fundamentals_eBook.pdf

    Also see the MCTS preparation Kit for Windows CE 6.0. (you should have windows live login(hotmail))

    http://msdn.microsoft.com/en-us/windowsembedded/ce/cc294468.aspx#kit

    Some books are available for cost.

    http://www.wrox.com/WileyCDA/WroxTitle/productCd-047037733X.html?print=true

    http://www.amazon.com/Programming-Windows%C3%82%C2%AE-Developer-Reference-PRO-Developer/dp/0735624178/ref=sr_11_1?ie=UTF8&qid=1198106632&sr=11-1

    Also See the bellow blog link. you can connect to other experts blog from this link to learn more on windows CE.

    http://vinoth-vinothblog.blogspot.com/

    Good Luck.


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Monday, June 21, 2010 12:28 PM
  • These files and folders are creating in runtime during the object store initialization. i am unable to understand your question clearly. However check the bellow given blog that explain in detail - How does wince 6.0 starts

    http://blogs.msdn.com/b/ce_base/archive/2007/11/26/how-does-windows-embedded-ce-6.0-start_3f00_.aspx

    Also see this link, you can start your windows CE 6.0 learning here. you will get all the necessary information from the MSDN

    http://msdn.microsoft.com/en-us/windowsembedded/ce/default.aspx

     


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Monday, June 21, 2010 12:56 PM
  • Dear Anna ,

     

    Romba thanks anna.

    These are the things i want to do now

     

    1)i want to learn wince 5.0 because in m company they are using 5.0 only

    2)i also want to write drivers in wince 5.0

    Please suggest be some books for this.

    i successfully booted the image from the cf. thanks anna.

    Monday, June 21, 2010 4:47 PM
  • Dear Anna.

     

    how can i create a BSP.

    Actually iam having the workspace,and by using my workspace i can create a Nk.bin and it is also working fine.

    Now my question is how to create a bsp with the existing workspace because i had made changes

    in the platform.bib.

     

    pls anna help...............................

     

     

     

    Monday, June 21, 2010 5:27 PM
  • here is the link to learn windows CE 5.0 from msdn

    http://msdn.microsoft.com/en-us/library/bb847951.aspx

    See the windows ce 5.0 development center link

    http://msdn.microsoft.com/en-us/windowsembedded/ce/dd424929.aspx

    This link contains all the necessary information about the windows ce 5.0 including book details and videos etc...

    Now come to your next question.

    Workspaces are projects to create a binary for the selected BSP and the selected OS components.

    you see the workspaces in (Wince500\PBWorkspaces\)

    you should have the BSP for your device then only you can create a workspace for your device.

    BSP (Board support packages) contains device specific folders and files like Drivers, bootloaders, device specific kernel part and registry settings related to your drivers and application(platform.reg).

    BSPs are located in wince500\platform\<BSPs>

    Now my questions are,

    Are you going to develop a custom device based on the current device as a reference?

    In this case you have to clone the existing BSP and add your new device related stubs.

    or

    Are you going to develop any custom application on the existing device?

    In this case, you no need to create a BSP. you can use the existing BSP and add the necessary component to the existing workspace or you can create a new workspace.

    Before doing the things you just read the above given links.

    if you think that the above answers are useful to you, Mark the replies as answered. it will encourage us to share our knowledege and participation.

    Good luck


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Tuesday, June 22, 2010 10:38 AM
  • Who is Anna?  Almost all of your messages start "Dear Anna".  Vinoth and Brad have replied to you; no one named Anna is involved.  It's rather rude to misaddress your posts this way, it seems to me.

    Paul T.

    Tuesday, June 22, 2010 11:08 PM
  • Dear Vinoth Anna,

     

    Thanks for helping me thank you .i got a another problem pls help

    now i want to copy a folder and its contents to my image,and also it contains DLL,ALH,INI,files,subfolders .

    How can i  copy the whole folder to my BSP,and also i want that folder in my image location /harddisk/intouchcompact.

    Dear Paul,

    Anna refers to brother in our language.

    selva.

    Wednesday, June 23, 2010 4:57 AM
  • Hi selva,

    Please use international langauge (English). Lot of MVPs and windows CE experts are viewing the posts globally and any one can participate and answer to the post. post it in a formal way so that you can get answer quickly and you will get a lot of suggestions from the exports.

    Now come to your questions.

    if you want to simply copy the files and folders, you can use the following options.

    • Using Activesync you can copy the files and folders to harddisk.for activesync USB client port is needed or you can use serial port driver. See the information about activesync in this linkhttp://msdn.microsoft.com/en-us/library/ms879772.aspx
    • Enable KITL and Using Remote File viewers you can copy the files and folders to harddisk. see the link about KITL http://msdn.microsoft.com/en-us/library/aa462507.aspxif
    • you can create a cab files that containing the files and folders and using cab installer you can install the files in the required location.

    Just go through the previous post links to know about windows CE.

     


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Wednesday, June 23, 2010 7:04 AM
  • Dear Mr.Vinoth,

     

    PLS HELP URGENT

     

    I want to include a file with space in the platform.bib file. like this

    Language Switching.scr  $(_FLATRELEASEDIR)\Language Switching.scr               NK

    but platform builder is giving error

    How can i build the image with a entry made above in platform.bib

    Note:i want to include platform.bib entry with space.

     

    Wednesday, June 23, 2010 12:47 PM
  • Try to post your new question in new thread.Don't post different questions in same topic.It would be difficult for the others who are referring this.
     
    Try to post your queries with related topics which will help others.
     
    For your question,try the following

    "Language Switching.scr"  "$(_FLATRELEASEDIR)\Language Switching.scr"               NK

    --
    Regards,
    Prabu
    http://prabukumar.wordpress.com/
    www.e-consystems.com
    Wednesday, June 23, 2010 1:30 PM
  • Sorry selva, i was busy with some other work. yes you try Prabu's suggestion, it will solve your error.


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Wednesday, June 23, 2010 2:06 PM
  • Dear Prabu,

    Thank you very much.it works, thanks.Here after i wont post my unrelated question here as you suggested .

     

     

     

    Thanks to Mr.vinoth and MR.Prabu.

    Wednesday, June 23, 2010 4:55 PM
  • Dear Vinoth,

    Thank you very much.it works, thanks.Here after i wont post my unrelated questions here.

     

     

    Thank you

    Wednesday, June 23, 2010 4:58 PM
  • Dear Mr.Prabhu and Mr.vinoth

    Please thke a look of my another question

     

    http://social.msdn.microsoft.com/Forums/en-US/winembplatdev/thread/197e8018-1ffb-44c8-be2c-6c30eed79642

     

    Thanks.

    J.Selvabharathi..

    Wednesday, June 23, 2010 5:12 PM