Implementing the OEMIsFlashAddr Function
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 an 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 image to flash memory.
To implement the OEMIsFlashAddr function
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))) { return(TRUE); } return(FALSE); }
See Also
Last updated on Wednesday, April 13, 2005
© 2005 Microsoft Corporation. All rights reserved.