OEMReadData Reads data from the transport for downloading.
OEMEthGetFrame Reads data from the NIC using function pointer pfnEDbgGetFrame.
OEMEthSendFrame Writes data to the NIC using function pointer pfnEDbfSendFrame.
OEMEthGetSecs Returns number of seconds passed relative to a fixed time.

The Ethernet support functions use callbacks into network controller-specific routines. This means that you must implement additional routines and set up appropriate function pointers in the OEMPlatformInit function if you want to support a different network controller, as demonstrated in the following sample code:

cAdaptType=pBootArgs->ucEdbgAdapterType;

// Set up EDBG driver callbacks based on

// Ethernet controller type.

switch (cAdaptType) {

case EDBG_ADAPTER_NE2000:

 pfnEDbgInit          = NE2000Init;

 pfnEDbgInitDMABuffer = NULL;

 pfnEDbgGetFrame      = NE2000GetFrame;

 pfnEDbgSendFrame     = NE2000SendFrame;

 break;

case EDBG_ADAPTER_DP83815:

 pfnEDbgInit          = DP83815Init;

 pfnEDbgInitDMABuffer = DP83815InitDMABuffer;

 pfnEDbgGetFrame      = DP83815GetFrame;

 ...

}

Flash Memory Support

Having implemented network communication capabilities, you also must enable the boot loader to download run-time image onto the new hardware platform and pass control to it. Alternately, you can save the run-time image to flash memory. Table 5-4 lists the download and flash memory support functions that you must implement for this purpose if the reference BSP's boot loader does not already support these features.

Table 5-4 Functions for supporting download and flash memory

Function Description
OEMPreDownload Sets up the necessary download protocol supported by platform builder.
OEMIsFlashAddr Checks if the image is for flash or RAM.
OEMMapMemAddr Performs temporary remapping of the image to RAM.
OEMStartEraseFlash Prepares to erase flash of enough size to fit the OS image.
OEMContinueEraseFlash Continue erasing flash based on download progress.
OEMFinishEraseFlash Complete the flash erasing once the download is done.
OEMWriteFlash Write OS image to flash.

User Interaction

Boot loaders can support user interaction based on a menu that provides the user with different options to start the platform, which can be helpful during the development process and later on for maintenance and software updates. Figure 5-4 shows a standard boot loader menu. For sample source code, check out the Menu.c file located in the SrcBootloaderEboot directory of a reference BSP or in the %_WINCEROOT%PlatformCommonSrc CommonBootBlmenu folder.

Figure 5-4 An example of a boot loader menu

Additional Features

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату