Embedded Processor Division
Advanced Micro Devices – Embedded Processor Division 5
Upgrade CONFIG.BIB and BLDDEMO.BAT
GOAL: The default CEPC DEMO7 CONFIG.BIB and BLDDEMO.BAT files will not support XIP images, so
update them with files provided by AMD.
1. Copy the CONFIG.BIB file supplied by AMD into the \WINCE\PLATFORM\SC400\FILES directory.
2. Copy the BLDDEMO.B AT file supp lied by AMD into the \WINCE\PUBLIC\DEMO7\OAK\MISC directory.
Some ETK build environment changes were required in order to support x86 platform XIP operation, and these
changes affect the CONFIG.BIB and BLDDEMO.BAT files. The follo wing text explains the changes that were
made to the original files to support XIP operation. The changes do not detract from the original ability to build
an image that will run from RAM.
The CONFIG.BIB file tells the CE locato r where in the memory map the executable code (i.e. kernel, etc.) will be
located, where system RAM resides, and provides other information pertinent to the build process. The locator uses
this address information when providing internal code reference fixups. For a given hard ware platform, the locator
must use different addresses to fix up the internal references when running XIP from Flash as opposed to when
running from RAM. The IMGFLASH environment variable was added to CONFIG.BIB to allow build time
selection of RAM versus Flash memory maps. When the e nvironment variable IMGFLASH=1, the image will be
built with the Flas h based memory map. Otherwise the RAM memory map will be used.
Also, the new CONFIG.BIB file causes a "flat" binary image (NK.NB0) to be generated when CE is built with
IMGFLASH=1 (see the CONFIG.B IB "ABX" option in the ETK d ocs for more info). Note that NK.BIN is not a
simple, flat binary image. Instead, it’s a collection of binary image s, each with its own header, concatenated into a
single file. The AMD E4FLASH.EXE utility does not know about the .BIN file format, so a true "flat" image is
required.
The BLDDEMO.BAT file must also be updated to remove the explicit setting of the IMGFLASH environment
variable to NULL. We will want the option to set this environment variable manually from the DOS command line.
Also, the original ETK build environment knows about 2 platforms: "ODO" and "CEPC", and BLDDEMO.BAT
compares an environment variable that holds the platform name to these string constants. If the platform name is not
"CEPC", then the ODO platform is assumed. Thus the comparison must also look for the string "SC400", or the
build will fail. It should be noted that because BLDDEMO.BAT is not located beneath the SC400 platform
directory, it is not an ÉlanSC400 specific file. However, the changes made will not negatively effect the build of
DEMO7 on other platforms.
At this point you should be able to build the RAM based x86 based CE image using the SC400 buil d wi ndow. As a
sanity check it is suggested that you do a from-scratch rebuild (and test run) of the RAM based version of the OS in
order to test the installation of the changes. The rebuild process is similar to the CEPC baseline build procedure
described earlier. Note that a RAM based image built using the SC400 DEMO7 build windo w will be identical to a
RAM based image built with the original using the CEPC DEMO7 build window. The SC400 images only differ
whe n you se t IMG F L AS H = 1 .
Build a Flash Based Image
GOAL: You have verified that you can build a RAM based CE image using an SC400-specific build window. Now
build the XIP image from the still-open build window as follo ws:
1. Configure t he environment variable to enable XIP builds: set IMGFLASH=1[enter].
2. From the \WINCE\RELEASE directory, just type MAKEIMG[enter]. T he XIP image will be made in about 30
seconds, and will be 8MB in size. You can find it in \WINCE\RELEASE, and it will be called NK.NB0 .
Building a Flash based image at this point is si mpl y a matter of running the locator again using the Flash-specific
memory mappings from CONFIG.BIB. That's why the above steps tell you to se t the e nvironment variable
IMGFLASH=1 and then run MAKEIMG. MAKEIMG runs the locator, and then combines the resulting binaries
into the CE NK.NB 0 image.