none
.BIN image signature offset RRS feed

  • Question

  • Hi,

     

    I'm experiencing a somewhat very strange problem with my WEC7 NK.BIN images. They seems fine, at least no issues with uploading NK.BIN from PB over ethernet or USB. The problems start when I'm trying to boot from flash memory or other media. Namely BootBlockLoadBinFsImage() from c:\WINCE700\platform\common\src\common\bldr\block\utils\loadbinfs.c fails to find the ROM_SIGNATURE signature in the right offset ROM_SIGNATURE_OFFSET.

    From romldr.h:

    #define ROM_SIGNATURE_OFFSET  0x40     // Offset from the image's physfirst address to the ROM signature.
    #define ROM_SIGNATURE     0x43454345

    I checked my NK.BIN and as you can see below the signature is at 0x2B instead, not at 0x40 as expected!

    HEX dump: NK.BIN

    Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
    
    00000000 42 30 30 30 46 46 0A 00 60 01 80 48 96 39 02 00 B000FF..`.€H–9..
    00000010 60 01 80 04 00 00 00 04 02 00 00 AE 6C 00 EA 40 `.€........®l.ê@
    00000020 60 01 80 08 00 00 00 BA 02 00 00 45 43 45 43 18 `.€....º...ECEC.
    00000030 D6 3A 82 48 60 01 80 04 00 00 00 C9 00 00 00 18 Ö:‚H`.€....É....
    00000040 76 39 02 00 70 01 80 54 EF 07 00 76 77 E1 02 00 v9..p.€Tï..vwá..
    00000050 00 00 00 63 4F 0C 4E 00 00 00 00 02 00 00 00 20 ...cO.N........ 
    00000060 00 00 00 A0 B2 01 00 A0 B2 01 00 01 00 00 00 46 ... ².. ²......F
    

    Any useful ideas anyone?   

    Thursday, June 30, 2011 3:01 PM

Answers

  • The ROM_SIGNATURE_OFFSET is for flat file format: .NB0 and .BIN if a packed format with file header and record info followed by its payload.
    According to your dump, the image should be loaded to 0x80016000, and the record contains ROM Signature (0xCECE) should be loaded to 0x80016040 and that is also correct (offset 0x40).
    There is nothing wrong with your NK.BIN, the root cause could be in BootBlockLoadBinFsImage or its dependency modules (file system, disk IO and etc)
    Do you have detail error message during boot? (The output from serial port may provide more detail than console)

    Thursday, June 30, 2011 3:29 PM

All replies

  • The ROM_SIGNATURE_OFFSET is for flat file format: .NB0 and .BIN if a packed format with file header and record info followed by its payload.
    According to your dump, the image should be loaded to 0x80016000, and the record contains ROM Signature (0xCECE) should be loaded to 0x80016040 and that is also correct (offset 0x40).
    There is nothing wrong with your NK.BIN, the root cause could be in BootBlockLoadBinFsImage or its dependency modules (file system, disk IO and etc)
    Do you have detail error message during boot? (The output from serial port may provide more detail than console)

    Thursday, June 30, 2011 3:29 PM
  • Oh I see. So BootBlockLoadBinFsImage() is for loading absolute .NB0 images! OK, what do I use for loading .BIN images then? Seems can't find anything related in \WINCE700\platform\common\src\common\bldr\
    Thursday, June 30, 2011 3:38 PM
  • Just simple parsing of the BIN file.  There's probably code scattered all over various bootloaders that does this; one place to look is the DownloadImage() routine in blcommon...
    Dean Ramsier eMVP BSQUARE Corporation
    Thursday, June 30, 2011 4:19 PM
  • To load .BIN file, you need to use BootFileSystemReadBinFile (platform\common\src\common\bldr\fileSystem\utils\fileSystemReadBinFile.c).
    You can take a look at BootLoaderLoadOs in platform\cepc\src\boot\bldr\loados.c as an example.

    Thursday, June 30, 2011 8:05 PM