Implementing the OEMIsFlashAddr Function (Windows Embedded CE 6.0)


The OEMIsFlashAddr function determines whether the .bin file being downloaded is destined for flash memory or for RAM. This function takes a memory address, and its return value indicates whether the address is in flash memory.

If a boot loader image is destined for flash memory, the BLCOMMON library will call flash memory routines during and after the download process to save and write the boot loader image to flash memory.

  • Edit the file Flash.c by adding the code necessary to fully implement the OEMIsFlashAddr function.

    The following code example shows the implementation of the OEMIsFlashAddr function for the hardware platform used in this boot loader example.

    #define FLASH_START      0
    #define FLASH_LENGTH     0x02000000
    BOOL OEMIsFlashAddr(DWORD dwAddr)
            // Does the specified address fall in the flash address range?
            if ((dwAddr >= FLASH_START) && (dwAddr < (FLASH_START + FLASH_LENGTH)))

Community Additions