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.

AM3517: NAND Flash tool error

Part Number: AM3517
Other Parts Discussed in Thread: FLASHTOOL

We are using AM3517 CPU with a 4Gb x16 NAND flash from Micron (MT29F4G16) on a custom board. For flashing the image to this memory we are using TI flashtool (v1.6). This is working fine, the NAND flash is properly detected by the flashtool and programmed accordingly. This is part of the ONFI detection trace:

» Sending data (41008 bytes) :::::::::::::::::::: [41008]
Interface 'OMAPFLASH DRIVER v5'
Driver 'NAND ONFI 16/8 BIT'
Driver configuration: gpmc = 0x6E000000
Driver configuration: cs = 0x00000000
Driver configuration: address = 0x30000000
Driver configuration: bberase = 0x00000000
NAND HW ECC
NAND BCH Mode = 0
NAND HWECC offset = 2, size = 12
NAND ONFIv2 VENDOR 0x2C MICRON
NAND 16 BIT DEVICE 0xBC MT29F4G16ABBDAHC
NAND NAND CYCLES 0x23 (3 ROW, 2 COLUMN)
NAND 2048 BYTES/PAGE (SPARE 64)
NAND 64 PAGES/BLOCK (131072 BYTES/BLOCK)
NAND 4096 BLOCKS/UNIT (536870912 BYTES/UNIT)
NAND 4 BIT(S) ECC REQUIRED
NAND 512 MB TOTAL SIZE
NAND ONFI DRIVER INIT COMPLETE
» Downloading complete
» Elapsed time: 0:00.480 (85433 bytes/s)

Now this Micron flash got obsolete and we are looking for alternative components. One of the possible candidate is a NAND flash from Cypress/Spansion (S34MS04G2). But here the problem starts: The flashtool doesn't properly detect the page size, spare part and total size of this NAND flash. This is the trace when trying to flash the board with the Cypress/Spansion NAND flash:

» Sending data (40768 bytes) :::::::::::::::::::: [40768]
Interface 'OMAPFLASH DRIVER v5'
Driver 'NAND ONFI 16/8 BIT'
Driver configuration: gpmc = 0x6E000000
Driver configuration: cs = 0x00000000
Driver configuration: address = 0x30000000
Driver configuration: bberase = 0x00000000
NAND HW ECC
NAND BCH Mode = 0
NAND HWECC offset = 2, size = 12
NAND ONFIv2 VENDOR 0x01 SPANSION
NAND 16 BIT DEVICE 0xBC S34MS04G2
NAND NAND CYCLES 0x23 (3 ROW, 2 COLUMN)
NAND -256 BYTES/PAGE (SPARE 65408)
NAND -192 PAGES/BLOCK (49152 BYTES/BLOCK)
NAND -256 BLOCKS/UNIT (-12582912 BYTES/UNIT)
NAND 4 BIT(S) ECC REQUIRED
NAND 4084 MB TOTAL SIZE
» Download failed (final data response error): Remote: : Driver init error 0x000
00011 - DRIVER PAGE MEMORY ALLOCATION ERROR DURING INITIALIZATION
» Elapsed time: 0:00.438 (93077 bytes/s)
» Operation FAILED (Remote: : Driver init error 0x00000011 - DRIVER PAGE MEMORY
ALLOCATION ERROR DURING INITIALIZATION)
» Elapsed time: 0:00.000

It looks like the NAND flash driver included in the flashtool (nand_onfi_16bit_8bit.bin) is not able to determine the correct size of the Cypress/Spansion flash. The only difference between the Micron and the Cypress/Spansion flash is the spare area (64byte vs 128byte). But this should be detected by the NAND driver from the flashtool because it is defined by ONFI specification which both NAND flash chips supports.

Any idea why the NAND flash driver from flashtool (nand_onfi_16bit_8bit.bin) is struggling with the Cypress/Spansion NAND flash?

Regards,
Bruno

  • The factory team have been notified. They will respond here.
  • Bruno, is the Cypress NAND being used on the same board design as the Micron NAND?  I'm just trying to eliminate the possibility of any hardware issues in reading the ONFI parameters.

    If the processor is having trouble reading the ONFI parameters, an alternative is to use the Porting feature which allows you to plug in the NAND parameters.  See this wiki for more info: 

  • Hi Biser,

    Thanks for replying. It's indeed the very same board design for both NAND flashes.

    Your suggestion did work, I now changed the parameter of the NAND flash driver as following (to overwrite the wrongly read ONFI parameters):

    memory NAND driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 0 address 0x30000000 bberase 0 onfi 0 bpp 2048 sbpp 128 ppb 64 bpl 4096 l 1 acv 0x23 f 0x0019

    This generates the following trace:

    » Sending data (41008 bytes) :::::::::::::::::::: [41008]
              Interface 'OMAPFLASH DRIVER v5'
              Driver 'NAND ONFI 16/8 BIT'
              Driver configuration: gpmc = 0x6E000000
              Driver configuration: cs = 0x00000000
              Driver configuration: address = 0x30000000
              Driver configuration: bberase = 0x00000000
              Driver configuration: onfi = 0x00000000
              Driver configuration: bpp = 0x00000800
              Driver configuration: sbpp = 0x00000080
              Driver configuration: ppb = 0x00000040
              Driver configuration: bpl = 0x00001000
              Driver configuration: l = 0x00000001
              Driver configuration: acv = 0x00000023
              Driver configuration: f = 0x00000019
              NAND HW ECC
              NAND BCH Mode = 0
              NAND HWECC offset = 2, size = 12
              NAND NONEv0 VENDOR 0x00 UNKNOWN
              NAND 16 BIT DEVICE 0x00 UNKNOWN
              NAND NAND CYCLES 0x23 (3 ROW, 2 COLUMN)
              NAND 2048 BYTES/PAGE (SPARE 128)
              NAND 64 PAGES/BLOCK (131072 BYTES/BLOCK)
              NAND 4096 BLOCKS/UNIT (536870912 BYTES/UNIT)
              NAND 0 BIT(S) ECC REQUIRED
              NAND 512 MB TOTAL SIZE
              NAND ONFI DRIVER INIT COMPLETE
    » Downloading complete

    With this I was able to flash image data into the NAND flash. Now I need to modify all the instances where the NAND is accessed (X-Loader, U-Boot, Kernel, ...) to get it running. But this is a different story.

    Thanks and regards,
    Bruno