AUTOSIZE problem and Data Abort in AtoUCopy in SHIP Build



OS: Windows CE 6.0
QFES: All until July 2008
SDRAM: 128 MB
ARCH: ARM

Our platform is getting a Data Abort if our Image Size is 0x1A80670
(the trigger point is around 0x1A80000) which is about 26.5 MB. This
Data Abort is only happening in the SHIP builds (WINCESHIP=1 via build
option) and does not happen in the DEBUG or RETAIL builds (that we've
seen.) The Debug build gets up to about 50-60 MB and the RETAIL only
slightly larger than the Ship Build.

The data abort itself is occuring in kernel.dll:AtoUCopy (NK\KERNEL
\resource.c), this function is getting called when someone tries to
get ROM info (filename in this case) out of either the MODULES section
or the FILES section. The Data Abort only occurs when the image is
being loaded from flash and the system has had power removed from the
system. Performing a processor reset does not cause the system to
fail.

Build Options for Ship:
IMGEBOOT=1
WINCESHIP=1
IMGRAM64=1

Now if I change config.bib to have a NK size that is larger than we
require, but turn off AUTOSIZE then the image boots correctly.
However, I don't think that this is really solving the issue, just
moving memory around so that it doesn't get corrupted. In this case
we are allocating 32 MB for NK and taking the extra out of the RAM
section.

If I change the build so that AUTOSIZE=OFF, but modify the values so
that they match up with the values that viewbin -t reports when I have
the AUTOSIZE=ON set it will still fail and still have the same
result. In this case, output from both .bin files show the same
addresses and offsets.

Lastly, there is one thing that viewbin -t shows between a
working .bin and a non-working .bin (Same source just a config.bib
change), and that is the size of the first Copy Section is different.

My Questions:
1. Has anyone seen this before?

2. I am going to start looking at the Copy Section stuff as all the
other data looks fine, my understanding (may be wrong at this point)
of the Copy Section is that it is going to contain all of the globals
and such not that are required for the Kernel to run, so they get
copied to the RAM section (before RAM FREE) so that the globals are
all intialized properly.

3. Is my understanding correct that AUTOSIZE=ON should work with an NK
that has to be either Shrunk or Enlarged to fit the actual Image?

4. I am currently setting IMGRAM64=1 as my image is right on the
boundary (and has gone over due to catalog options.) Do I really need
this since I'm on an ARM and I don't do an IF IMGRAMXX in my
config.bib?

I'd really appreciate any advice or help others could give me, I've
posted viewbin -t outputs and config.bib contents below.

Thank you,
Brad.

[viewbin -t of failing image]
ViewBin... nk.bin
Image Start = 0x8007C000, length = 0x01A80670
Start address = 0x8007D000
Checking record #17 for potential TOC (ROMOFFSET = 0xFE6ECD3C)
Checking record #364 for potential TOC (ROMOFFSET = 0x00000000)
Found pTOC = 0x81afa270
ROMOFFSET = 0x00000000

ROMHDR ----------------------------------------
DLL First : 0x4001C001
DLL Last : 0x410FC098
Physical First : 0x8007C000
Physical Last : 0x81AFC670
RAM Start : 0x81B00000
RAM Free : 0x81B0F000
RAM End : 0x87C00000
Kernel flags : 0x00000002
Prof Symbol Offset : 0x00000000
Num Copy Entries : 2
Copy Entries Offset : 0x801E0E60
Num Modules : 211
Num Files : 85
MiscFlags : 0x00000002
CPU : 0x01c2 (Thumb)
Extensions : 0x8007D040

ROMHDR Extensions -----------------------------
PID[0] = 0x00000000
PID[1] = 0x00000000
PID[2] = 0x00000000
PID[3] = 0x00000000
PID[4] = 0x00000000
PID[5] = 0x00000000
PID[6] = 0x00000000
PID[7] = 0x00000000
PID[8] = 0x00000000
PID[9] = 0x00000000
Next: 00000000

COPY Sections ---------------------------------
Src: 0x803A2324 Dest: 0x81B06000 CLen: 0xCD5 DLen:
0x176C
Src: 0x8033DD00 Dest: 0x81B09000 CLen: 0x2F9 DLen:
0x2714

[viewbin -t of working image (same source, 32MB change as mentioned
above.)]
ViewBin... nk.bin
Image Start = 0x8007C000, length = 0x01A88798
Start address = 0x8007D000
Checking record #16 for potential TOC (ROMOFFSET = 0xFE6E8C14)
Checking record #366 for potential TOC (ROMOFFSET = 0x00000000)
Found pTOC = 0x81b02398
ROMOFFSET = 0x00000000

ROMHDR ----------------------------------------
DLL First : 0x4001C001
DLL Last : 0x410FC099
Physical First : 0x8007C000
Physical Last : 0x81B04798
RAM Start : 0x8207C000
RAM Free : 0x8208F000
RAM End : 0x87C00000
Kernel flags : 0x00000002
Prof Symbol Offset : 0x00000000
Num Copy Entries : 2
Copy Entries Offset : 0x801E4D28
Num Modules : 211
Num Files : 85
MiscFlags : 0x00000002
CPU : 0x01c2 (Thumb)
Extensions : 0x8007D040

ROMHDR Extensions -----------------------------
PID[0] = 0x00000000
PID[1] = 0x00000000
PID[2] = 0x00000000
PID[3] = 0x00000000
PID[4] = 0x00000000
PID[5] = 0x00000000
PID[6] = 0x00000000
PID[7] = 0x00000000
PID[8] = 0x00000000
PID[9] = 0x00000000
Next: 00000000

COPY Sections ---------------------------------
Src: 0x813F0000 Dest: 0x82086000 CLen: 0x1125 DLen:
0x1BCC
Src: 0x80341D00 Dest: 0x82089000 CLen: 0x2F9 DLen:
0x2714

[Original failing config.bib]

MEMORY
BLDR 80000000 00068000 RESERVED
EMACBUF 80068000 00013000 RESERVED
DRVGLOB 8007b000 00001000 RESERVED
NK 8007c000 00200000 RAMIMAGE
RAM 8027c000 07984000 RAM
VIDEOMEM 87c00000 00400000 RESERVED

CONFIG
AUTOSIZE=ON
KERNELFIXUPS=ON

; @CESYSGEN IF !NK_NKNOCOMP
COMPRESSION=ON
; @CESYSGEN ENDIF !NK_NKNOCOMP
; @CESYSGEN IF NK_NKNOCOMP
COMPRESSION=OFF
; @CESYSGEN ENDIF NK_NKNOCOMP
IF IMGPROFILER
PROFILE=ON
ELSE
PROFILE=OFF
ENDIF

IF IMGTRUSTROMONLY
IF IMGNOTALLKMODE
ROMFLAGS=12
ELSE
ROMFLAGS=10
ENDIF
ELSE
IF IMGNOTALLKMODE
ROMFLAGS=02
ELSE
ROMFLAGS=00
ENDIF
ENDIF

[Changed Portions of config.bib for 32MB AUTOSIZE=OFF build]

BLDR 80000000 00068000 RESERVED
EMACBUF 80068000 00013000 RESERVED
DRVGLOB 8007b000 00001000 RESERVED
NK 8007c000 02000000 RAMIMAGE ; 32 MB
RAM 8207c000 05B84000 RAM
VIDEOMEM 87c00000 00400000 RESERVED

CONFIG
AUTOSIZE=OFF

.