i.MX28 NAND Implementation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX28 NAND Implementation

Jump to solution
1,440 Views
markwilliams
Senior Contributor I

Hi all,

I am struggling to get my NAND device to show up in Windows CE 6.0 with the i.MX28 development board. I am booting from SD card and using the NAND as storage only.

I have built a debug image to see where the NAND is getting stuck but I am not too sure why it is failing. The debug output around the loading of the driver is shown below.

In the test below I have given the NAND driver DSK an index of 2 in the registry (I thought it was failing due to conflicting with the USB driver mass storage settings that use DSK1 but this made no difference). I have also suppressed a debug message that prints out BLOCK_STATUS_RESERVED for all blocks during the flash scan:

DEVICE!RegReadActivationValues RegQueryValueEx(Drivers\BuiltIn\FlashPDD\BusPrefix) returned 2

Kernel DLL 'flashmdd.dll' needs thread creation/deletion notification

reset GPMI module

NAND FullCode = 0x1590d198

NAND FullCode = 0x0

NumberOfChip=1

NAND_ECCConfLayout, pagesize=2048,sisize=64

INFO: Set NAND flash blocks [0x0 ~ 0x9bf] as reserved.

[NOTIFY] Initializing.

DB:OpenDB fail: DB DB_notify_queue not found

[NOTIFY] Initialization completed successfully

BBT_ReadOperation : dwStartBlock = 0x4, SectorAddr = 0x101

BBT_ReadOperation : dwStartBlock = 0x5, SectorAddr = 0x141

[NOTIFY] ProcessDatabase::started at local time 01/01/2006 16:53:36

ERROR: C:\WINCE600\PLATFORM\COMMON\SRC\SOC\MX28_FSL_V2_PDK1_9\MEDIA\NAND\CORE\.\cspnand.c line 505: FMD_Deinit: FMD Driver is unloading (c0f54860)

DEVICE!LaunchDevice: Init() failed for device 0xd002ca60

DEVICE!I_ActivateDeviceEx: couldn't activate: prefix DSK, index 2, dll flashmdd.dll, context 0xd02be67c

So for some reason the flash chip is detected, finds my driver settings, marks blocks as reserved, scans (printing out marked blocks and BBT info) but then is unloaded.

Does anyone know what I could have done wrong? Please note that I am not booting from NAND, just using it as storage. I want to get to the point where I can see the NAND in WCE explorer.

Thanks in advance, Mark

Labels (1)
0 Kudos
1 Solution
706 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think you need modify the "image_cfg.h", the followed default setting had reserved 312MB nand for eboot and NK, and it had set boot region to 512 blocks. They are too big, if your NAND size is less than 512MB, the driver will fail to work due to no free NAND space.

#define IMAGE_BOOT_NANDDEV_RESERVED_SIZE    (DWORD)((DWORD)(312 * 1024 * 1024))

#define IMAGE_BOOT_BOOTIMAGE_NAND_BLOCKS      (512)

You can try with:

#define IMAGE_BOOT_NANDDEV_RESERVED_SIZE    (DWORD)((DWORD)(40 * 1024 * 1024))

#define IMAGE_BOOT_BOOTIMAGE_NAND_BLOCKS      (8)

View solution in original post

0 Kudos
2 Replies
707 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think you need modify the "image_cfg.h", the followed default setting had reserved 312MB nand for eboot and NK, and it had set boot region to 512 blocks. They are too big, if your NAND size is less than 512MB, the driver will fail to work due to no free NAND space.

#define IMAGE_BOOT_NANDDEV_RESERVED_SIZE    (DWORD)((DWORD)(312 * 1024 * 1024))

#define IMAGE_BOOT_BOOTIMAGE_NAND_BLOCKS      (512)

You can try with:

#define IMAGE_BOOT_NANDDEV_RESERVED_SIZE    (DWORD)((DWORD)(40 * 1024 * 1024))

#define IMAGE_BOOT_BOOTIMAGE_NAND_BLOCKS      (8)

0 Kudos
706 Views
markwilliams
Senior Contributor I

Hi Qiang Li,

Thanks - I actually found that yesterday! I was under the assumption that if I was using the SD card for the OS image then the NAND would be left free for 100% file system. After all the constants in image_cfg.h have the word 'BOOT' in them even though I am not booting from NAND.

The clue was the message: INFO: Set NAND flash blocks [0x0 ~ 0x9bf] as reserved

This is clearly too many blocks for the 128MB NAND I am using which only has 1024 blocks (assuming they are all good!).

I changed the total reserved size as well as well as the number of blocks reserved for eboot. After a NAND format from eboot I can now see the NANDflash drive in Windows CE and I am currently performing some read/write endurance tests.

Thank you for your help. Mark

0 Kudos