Tuesday 10 November 2009

Windows Embedded CE: nk.nb0 file

Hi folks,

today I want to focus on the nk.nb0 file. The result of a successful build of your OSDesign will be your run-time image (normally nk.bin) in your _FLATRELEASEDIR. In some cases you also have an nk.nb0 file in your _FLATRELEASEDIR after a successful build.

But what exactly is the nk.nb0 file? How can I control its creation? And why do I need the nk.nb0 file, anyhow?

The nk.nb0 file is a raw image file in Absolute Binary Data (ABF) file format which is a byte-for-byte mirror image of your runtime-image.

All you need to do in order to get the nk.nb0 file as outcome of a successful build (make image phase) is to specify ROMSTART, ROMWIDTH, or ROMSIZE in the CONFIG section of your Config.bib.

NOTE: ROMSTART and ROMSIZE should correspond to your RAMIMAGE start address and RAMIMAGE size settings in the MEMORY section of your Config.bib respectively.

The resulting nk.nb0 will basically be the “unpacked” nk.bin file with tailing zeros and it will be exactly of size ROMESIZE. In some cases you will get a warning during the make-image phase of your build process stating something like: warning, image exceeded… In this case you will not only find an nk.nb0 but also an nk.nb1 file in your _FLATRELEASEDIR. In this case you need to increase both your RAMIMAGE size and your ROMSIZE in your Config.bib. But don’t forget to change any succeeding regions in the MEMORY section of your Config.bib file accordingly to avoid overwriting these regions!

So how can we use the nk.nb0 file? We can use it for JTAG-flashing of our image. Or if our boot-concept supports it we can use the nk.nb0 file to be flashed in NOR flash by our EBoot without the need of Filesystem. The advantage of using the nk.nb0 file would be that we can simply copy it to RAM and run it directly as it is a raw file. Of course it would be good idea to use some sort or check sum to check if our nk.nb0 is intact.

Have fun!

No comments: