This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335X, 16-bit NAND Flashing Problem

Other Parts Discussed in Thread: AM3358

Hi everyone,
I am experiencing problems with my company's custom AM3358 board with MT29F2G16ABBEAHC, 16 bit NAND device (2048 + 64)
Currently, i am using  XDS100v2 device, Code Composer Studio 5.4.0 and AM335X_StarterWare_02_00_01_01 source code.

Problem appears when i try to write SPL/MLO image (address 0x0, BHC-8), using NAND Flasing Tool, as it outputs "Verify failed. Attempting to clear page"  for each writing attempt.
Tracing down function calls, i found out it fails at the following location:

@AM335X_ecc.c
DEVICE_NAND_ECC_BCH_correct
ELM_CheckErrors, call returns E_FAIL

Some important facts regarding this issue:

  1. I have carefully read many TI forum topics related to NAND booting problems
  2. GPMC_WAIT0 is connected to NAND signal R/B, GPMC_CS0 is used
  3. NAND Flash Tool can sucessfully detect ONFI support and read NAND info parameters
  4. Analyzing source code for NAND Flashing Tool i have noticed it uses 8-bit mode by default, and i had to put a few changes for 16 bit GPMC init.
    1. Added AD[8]..AD[15] pin mux initialization @AM335X_device.c, struct PAD_Conf_NANDFlash[] ( also AM335X_device.h )

{ GPMC_AD8_OFF, MODE(0) | RXACTIVE | PULLUP_EN},
{ GPMC_AD9_OFF, MODE(0) | RXACTIVE | PULLUP_EN},
{ GPMC_AD10_OFF, MODE(0) | RXACTIVE | PULLUP_EN},
{ GPMC_AD11_OFF, MODE(0) | RXACTIVE | PULLUP_EN},
{ GPMC_AD12_OFF, MODE(0) | RXACTIVE | PULLUP_EN},
{ GPMC_AD13_OFF, MODE(0) | RXACTIVE | PULLUP_EN},
{ GPMC_AD14_OFF, MODE(0) | RXACTIVE | PULLUP_EN},
{ GPMC_AD15_OFF, MODE(0) | RXACTIVE | PULLUP_EN},

b. changed default GPMC regs init @AM335X_device.c, to set 16-bit mode for

// Rom Code Defaults.
// 0x00000810,
0x00001810, // set 16 bit mode NAND, bits 13,12 to 1h
0x001e1e00,
0x001e1e00,
0x16051807,
0x00151e1e,
0x16000f80,
0x00000048,


5. I am not an expert with NAND devices, and have not profound knowledge on ECC schemes (i suspect the problem is there)

Thank you in advance for any help or advice regarding this issue.

  •    Hi Dimitrije,

       Sorry for the delayed response.
      
       The changes you have tried out regarding for interfacing with 16-bit device
       with the PinMux, GPMC ECC configuration are correct. Just make sure you have
       defined the correct offsets for different control registers. and make sure
       you pass the correct device size (8/16 bit) to the nandwriter function.

       The changes should be in the following registers GPMC_ECC_CONFIG for ECC16B
       and GPMC_CONFIG1_i register set the device size bit for the Nand device.
      
       I suggest you can try writing to the flash by disabling the ECC to confirm
       whether the Read and Write to the device happens, the change can be
       done in the AM335X_Device_setECC function. Additionally, you can also try
       out using  the Hamming ECC scheme.

       Alternately, you can also use Uboot to get a raw dump from the attached nand
       device.
      
       Regards
       Anant Pai

  • Hi Anant, no porblems..

    A week ago we found out the problem, it was NAND device for 1V8 soldered instead of 3V3. Right now i am expecting one 8-bit compatible NAND device with the same PCB layout, to try it.

    Our next hardware revision (in 2-3 weeks) will have correct 16-bit NAND device.

    In meanwhile i will try to boot MLO/uBoot form 8-bit NAND device, and i will post the result.

    Thanks for assistance.

    Dimitrije Dinic

  • Hi Anant and anyone who's reading this post.

    As i mentioned above, root of my problem was inappropriate hardware component, that's why the Flashing tool was stuck while trying to access NAND device.

    I have tested the same NAND Flashing Tool with 8bit device

    MT29F2G08ABAEAH4-IT:E

    and it works fine. So there is no problem with source code.

    Then i decided to use U-Boot approach to debug and flash NAND device, which lead me into totally different direction.

    Thanks again for assistance :)