T20: WinCE7 Crash during boot


I built my own image upon BSP 2.2. Before we were still on BSP version 1.4. There I could build my own BSP without problem and it booted normaly.

Using now BSP V2.2 I’m no longer able to compile a bootable image. It always crashes during the loading of the filesystem. The output on the serial output shows the following:

Toradex Bootloader 2.2 for Tegra Built Dec  7 2018 15:05:43

Press [SPACE] to enter Bootloader Menu

Colibri T20 512MB 1.2A  Serial: 4822467
RAM: 512 MB, CarveOut: 64 MB
Locating kernel image in flash...Done(1186)
Decompressing IMAGE(22349667, 44091304) from FLASH(0) to RAM(16000)...Done(503ms)
Jumping to image at 0x80016000...

Toradex Windows CE 7.0 2.2 for Tegra Built Dec  7 2018 15:05:21
INFO:OALLogSetZones: dpCurSettings.ulZoneMask: 0xb
L2 cache enabled
MainMemoryEndAddress adjusted from 0x9F000000 to 0x9C000000
Main Phys Mem: 0x00000000:0x1BFFFFFF
Carveout Phys: 0x1C000000:0x1FFFFFFF
Cold boot selected
DeviceId................. Tegra_4822467
pArgs->flags............. 0x0
pArgs->devLoc.IfcType.... 0
pArgs->devLoc.LogicalLoc. 0x0
pArgs->devLoc.PhysicalLoc 0x0
pArgs->devLoc.Pin........ 0
WARN: OALKitlInit: KITL Disabled
-OALKitlStart(rc = 1)
SMP: Active CPUs = 2
Loading ResourceManager...
Chip Id: 0x20 (Handheld SOC) Major: 0x1 Minor: 0x4 SKU: 0x8
Speedo: CPU: 304 (Corner: 1), Core: 200 (Corner: 2)
                                                   NVRM Initialized shmoo database
PllClocks(Mhz): X=1000, M=666, C=600, P=216, A=24.576
SysClocks(Mhz): CPU=1000, AVP=240, SysBus=240, Mem=333, EMem=666
GraphicClocks(Mhz): Host=108, 3D=111, 2D=111, Epp=111, Mpe=111, Vde=240
Done Loading ResourceManager (57 ms)
Loading FlashFileSystem(eMMC)...
Failed(0) Loading FlashFileSystem(eMMC) (0 ms)
Loading FlashFileSystem(NAND)...
Micron M71M PS:4KB BS:256KB DS:1024MB BCH16 ECC
INFO: TotalBlocks = 4096, FreeBlocks = 179
BBs: 0
No TAT bad block found.
No TT bad block found.
Done Loading FlashFileSystem(NAND) (221 ms)
Exception 'Data Abort' (0x4): Thread-Id=00520002(pth=a2802cf8), Proc-Id=00400002(pprc=82a945e0) 'NK.EXE', VM-active=00400002(pprc=82a945e0) 'NK.EXE'
PC=8005be24(NK.EXE+0x00045e24) RA=800323c4(NK.EXE+0x0001c3c4) SP=a68fe5b8, BVA=00000020
Exception 'Data Abort' (0x4): Thread-Id=00520002(pth=a2802cf8), Proc-Id=00400002(pprc=82a945e0) 'NK.EXE', VM-active=00400002(pprc=82a945e0) 'NK.EXE'
PC=8005be24(NK.EXE+0x00045e24) RA=800323c4(NK.EXE+0x0001c3c4) SP=a68fe5b8, BVA=00000020

When I connect the debugger I get the following crash dump:

KERNEL!OEMIoControl(unsigned long 0x00000004, void * 0x00000000, unsigned long 0x8009b0e0, void * 0x00000000, unsigned long 0x00000004, unsigned long * 0x00000000)  line 153
KERNEL!KernelIoctl(unsigned long 0x00000004, void * 0x00000000, unsigned long 0x00000004, void * 0xefe66a70, unsigned long 0x00000004, unsigned long * 0x00000000)  line 999 + 76 bytes
K.COREDLL!xxx_KernelIoControl(unsigned long 0x00000004, void * 0x00000000, unsigned long 0x00040000, void * 0x00000001, unsigned long 0x00000004, unsigned long * 0x00000000)  line 1726
FILESYS!InitUserHives()  line 1251
FILESYS!prgInitHiveRegistry(int 0xefe67d80, unsigned short * 0x00000004)  line 1356
FILESYS!DoGeneralInit(unsigned short * 0xefe67d80)  line 2133 + 12 bytes
FILESYS!FileSysMain(HINSTANCE__ * 0x00000000)  line 2670 + 12 bytes
K.COREDLL!ThreadBaseFunc(unsigned long (void *)* 0xf100add0, void * 0x008b0003)  line 1240

I really don’t see where I’m missing something.

Thanks for any help.

The following components are included for building the image:

<Feature Name="Item" CatalogItemId="Item:MS:sysgen_notify" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_pm" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_usbfn_serial" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_usb_hid" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_usb_hid_clients" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_usb_printer" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_usb_storage" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_gdi_alphablend" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_ddraw" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_imaging_png_decode" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_imaging_bmp_decode" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_kbd_us" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_nls_en" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_nls_en_us" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_fsramrom" />
<Feature Name="Item" CatalogItemId="Item:MS:img_screen_medium" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_iphlpapi" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_redir" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_battery" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_backlight" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_sd_memory" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_exfat" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_tfat" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_touchgesture" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_cursor" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_menu_overlap" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_touch" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_usb" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_tcpip" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_winsock" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_sdbus" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_ndis" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_auth_ntlm" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_auth_schannel" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_commctrl" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_fsreghive" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_usbfn" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_audio" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_watson_xfer" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_watson_dmpgen" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_auth_kerberos" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_as_file" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_standardshell" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_console" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_storemgr_cpl" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_usbfn_composite" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_netutils" />
<Feature Name="Item" CatalogItemId="Item:MS:sysgen_watson_ctlpnl" />

Dear @andreas

Thank you for the detailed description. There are two possible reasons for the issue:

  1. Nvidia flash partitions
    Between V1.4 and V2.2 we moved the registry from the filesystem into a separate flash partition. By default this partition does not exist and can lead to various boot problems.
    Try to flash our standard V2.2 image using either the Update Tool or NvFlash - use the *.cfg file to do the update. This way the additional partition will be generated automatically.
    After this debug your customized OS.
  2. Filesys.dll
    We patched the filesys.dll, the patched version is part of our workspace. Please make sure you include this patched version, not the Msft default one.

Regards, Andy

Thanks for your answer.

I finally got it running. I had to change several things:

Add the filesys_hive_based_registry.dll and the filesys_ram_based_registry.dll

Add the new environment variables to the pbxml file so it looks like that now as in your workspace:

<StringDictionary Name="EnvironmentVariables">
    <Entry Name="sysgen_pcl">1</Entry>
    <Entry Name="sysgen_printing">1</Entry>
    <Entry Name="sysgen_ramdisk">1</Entry>
    <Entry Name="os_config">COMPLETE</Entry>
    <Entry Name="sysgen_usb_printing">1</Entry>
    <Entry Name="prj_enable_fsreghive">
    <Entry Name="bsp_load_async">1</Entry>
    <Entry Name="bsp_load_filter">1</Entry>

Add these BspFeatures in the pbxml file:

<FeatureCollection Name="BspFeatures" EnforceUniqueItems="True">
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_BACKLIGHT" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_ODM" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_DISPLAY" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_AUDIO" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_RM" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_SDIO" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_UART" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_NAND" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_EMMC" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_FSSTREAM" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_USBF" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_USBH" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_NV_USBOTG" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_TDX_LAUNCHER" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_TDX_RTCSYNC" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_TDX_UPDATE" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_TDX_KEYBOARD" />
    <Feature Name="Item" CatalogItemId="Item:Toradex:BSP_TDX_TOUCH" />