locked
Why am I getting errors when including ceddk.h to my application RRS feed

  • Question

  • Hi,

     

    In my application, (for a x86 device), I want to read and write to some memory mapped IO ports. I know the physical address of these ports.

     

    To translate the physical address to virtual address for my process, I am trying to use the CEDDK functions MmMapIOSpace() and then the WRITE_PORT_USHORT.

     

    But when I include the ceddk.h file I get the error 

    Error 1 fatal error C1083: Cannot open include file: 'ceddk.h': No such file or directory C:\WINCE600\OSDesigns\SBC84710\SBC84710\mmi\.\mmi.c 12

    If I manually copy the ceddk.h fle from the \ddk\inc directory ( I know this isn't correct way of doing it) I get an error for the pkfunc.h file.
    What should I do to be able to access the ceddk functions from my application.

    Thanks

    Wednesday, June 29, 2011 12:49 PM

Answers

  • the problem is that your application settings does not lists in the 'INCLUDE' directory list the directories where ceddk.h and pkfunc.h are located which are C:\WINCE600\PUBLIC\COMMON\DDK\INC and C:\WINCE600\PUBLIC\COMMON\OAK\INC respectively, In x86 you will not have  any problem in accessing I/O space from a user mode application: if you do not plan to port the application to different architectures you can even avoid the call to MmMapIOSpace since you are sure that you are accessing I/O and not memory;

    #define IO_ADDRESS 0x2f8 //sample
    
    #define IO_DATA 0x55AA //sample
    
    WRITE_PORT_USHORT((PUSHORT)IO_ADDRESS, IO_DATA);
    
    

     

     


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    • Proposed as answer by Bruce Eitman Wednesday, June 29, 2011 2:22 PM
    • Marked as answer by deepak_WinCE Thursday, June 30, 2011 5:04 AM
    Wednesday, June 29, 2011 2:02 PM

All replies

  • I am going to take some guesses here.  I am not a CE expert by any means, and mostly I am drawing parallels between the desktop OS and CE, so my guesses may be wrong.

    I am guessing that a user mode application has no access to device ports, just like on the desktop OS.  Instead if you need access to those you would need to write a kernel driver (hence the reason the headers you need are in the DDK instead of the SDK).  You would then expose whatever functionality you want via a mechanism such as and IOCTL. 

    I suspect even if you were able to get the DDK header to compile cleanly you could not access the functionality you want from user mode (again, a guess).  You might want to try asking on the forum for developing the OS, rather than writing apps.

    Maybe someone here has more intimate knowledge and can prove me wrong though.

    Wednesday, June 29, 2011 1:52 PM
  • the problem is that your application settings does not lists in the 'INCLUDE' directory list the directories where ceddk.h and pkfunc.h are located which are C:\WINCE600\PUBLIC\COMMON\DDK\INC and C:\WINCE600\PUBLIC\COMMON\OAK\INC respectively, In x86 you will not have  any problem in accessing I/O space from a user mode application: if you do not plan to port the application to different architectures you can even avoid the call to MmMapIOSpace since you are sure that you are accessing I/O and not memory;

    #define IO_ADDRESS 0x2f8 //sample
    
    #define IO_DATA 0x55AA //sample
    
    WRITE_PORT_USHORT((PUSHORT)IO_ADDRESS, IO_DATA);
    
    

     

     


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    • Proposed as answer by Bruce Eitman Wednesday, June 29, 2011 2:22 PM
    • Marked as answer by deepak_WinCE Thursday, June 30, 2011 5:04 AM
    Wednesday, June 29, 2011 2:02 PM
  • Thanks Luca,

     

    I am able to include the CEDDK header now.

     

    I did not understand though why I would not need to translate the physical address to the processes's  virtual address space? Is it that for an x86 device, Physical port addresses are already mapped to the processes virtual address space.. and that the physical and virtual address are the same for physical IO... ?

     

    Regards

    Thursday, June 30, 2011 4:24 AM