How to specify virtual address alignment using MmMapIoSpace RRS feed

  • Question

  • Hi,

    I have a question about specifying the alignment of uncached virtual addresses on an Embedded Compact 7 platform.

    I am attempting to modify the MS NOR strataflash driver for use on our EC7 based platform. I am using the MmMapIoSpace function to map the device physical address to an uncached virtual space for use by the driver. The MS strataflash driver states that it needs the flash base address to be block aligned for the maths to work. The block sizes for our Flash device are 128kB and the virtual address returned by MmMapioSpace is not properly aligned to this. The driver has an explicit check for this and of course it fails at this check.

    Is there any way to control the alignment of the address that MmMapioSpace returns? Alternatively is there another approach to addressing this problem.




    Monday, July 1, 2013 5:26 PM

All replies

  • Hi Bruno,

    Can you point me to the MS code which function states this requirement?



    Tuesday, July 2, 2013 6:00 AM

  • Yes,

    The file C:\WINCE700\public\COMMON\oak\drivers\block\msflashfmd\strata\fmd.cpp.

    The function is InitializeFlash.

    Here is the specific check that I mentioned.

    // In order for all the math to work out later, we require that the flash base address be block-aligned and that the flash length be // an integral number of blocks. if (!IS_BLOCK_ALIGNED(pBaseAddress) || !IS_BLOCK_ALIGNED(FlashLength)) { DEBUGMSG(1, (TEXT("ERROR: InitializeFlash: base address and length must be block-aligned (Base=0x%x, Length=0x%x).\r\n"), (ULONG)pBaseAddress, FlashLength)); return(FALSE); }


    Tuesday, July 2, 2013 8:01 AM