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.

Trying to bring up WinCE 7 eboot on a Sitara AM3517 from 8-bit NAND flash

Other Parts Discussed in Thread: AM3517

Hi,

I have problems to start eboot with 8bit NAND Flash. Everithing works fine up to the call of "memcpy(pData, (BYTE*)pDevice->pFifo, FIFO_THRESHOLD)"  in the function NAND_Read().

For 8bit NAND FLash support I have changed the source code lines

#define WRITE_NAND(x,y)         OUTREG16(x,y)    // 16-bit access
#define READ_NAND(x)            INREG16(x)       // 16-bit access
typedef REG16 NANDREG;

to

#define WRITE_NAND(x,y)         OUTREG8(x,y)    // 8-bit access
#define READ_NAND(x)            INREG8(x)       // 8-bit access
typedef REG8 NANDREG;

Here are my debug messages:

Microsoft Windows CE Bootloader Common Library Version 1.4 Built Jul 20 2012 10:20:54

Texas Instruments Windows CE EBOOT for AM35x, Built Jul 27 2012 at 08:42:48
EBOOT Version 1.2, BSP 2.00.00.02

TI AM3517 Version 0x1 (Hawkeye 0xb868 / manufacturer ID  0x17)
System ready!
Preparing for download...
INFO: Predownload....
Checking bootloader blocks are marked as reserved (Num = 14)
 Skip bad block 0
 Skip bad block 1
 Skip bad block 2
 Skip bad block 3
 Skip bad block 4
 Skip bad block 5
 Skip bad block 8
 Skip bad block 10
 Skip bad block 12

What could be the problem?

Best regards,

Andreas

  • The 2.30 BSP NAND driver currently does not support 8-bit access.The small modification you made goes in the right direction but is most likely not enough to add 8-bit support in the driver. For instance, the SectorAccess and BlockAccess will probably need to be rewritten as your 8-bit FLASH may have a different sequence for passing offsets. You could have a look at your NAND part datasheet and see if these sequences match the NAND's expected sequence.

  • The BSP support the following flash Types:

    Manufacturer ID     Device ID   Nb of Blocks    Nb of Sectors per block     Sector Size     Bus width   Total Size 
    0x2C (Micron)       0xBA        2048            64                          2048            x16         256 Mbytes 
    0x2C (Micron)       0xBC        4096            64                          2048            x16         512 Mbytes  

    we use the follwing flash from Micron

    0x2C (Micron)      0xDA         2048            64                          2048            x8          256 Mbytes 

    I think it is nearly the same in all till the bus size. So it cann't be a big deal to adapt the driver, or? How different is the driver for the AM335x? This BSP support or NAND FLlash.

    Best regards,

    Andreas

  • The AM3xx BSP  uses a different NAND driver but supports only 16bit NAND parts:

    \PLATFORM\COMMON\SRC\SOC\COMMON_TI_V1\COMMON_TI_AMXX\BLOCK\NAND\fmd.c:

     if ((pBSPNandInfo->sectorSize != 2048) && (pBSPNandInfo->wordData != 2)){        

              ERRORMSG(1,(TEXT("FMD driver supports only 16bits large page (2KB) devices\r\n")));        

              goto cleanUp;    

    }

     It is not a big deal to adapt the driver but changing the WORD access as you did is most likely not enough. You will need to have a look at how you are supposed to send addresses offset through th 8-bit parallel port, which is defined in the datasheet of your NAND chip.

  • You wrote, that the AM335x BSP also doesn't support 8-bit NAND Flash. If this is correct, the information of the TI wiki is wrong: http://processors.wiki.ti.com/index.php/WinCE-BSP_ARM-A8_User_Guide#Supported_NAND_chip

    And I found some code like

    #define NANDREG_SIZE(p)   ((int)((IS_NAND_16BIT(p))?(sizeof(REG16)):(sizeof(REG8))))

    at \PLATFORM\COMMON\SRC\SOC\COMMON_TI_V1\COMMON_TI_AMXX\BLOCK\NAND\fmd.c.

    Are you really sure that this dirver only supports 16bit NAND Flash? I will try it as soon as I possibly.

    Best regards,

    Andreas

     

  • Hi Andreas,

    Were you able to resolve the issue.

    1) Can you just share the files to which you made changes.

    2) from your thread i observed in your debug messages you are able to detect the Manufacture ID, presently i am not even able to read my NAND ID.

    Could you please help me in resolving the issue, i am Newbie to this.

    Thanks ...................

  • Hi Rajath,

    I'm not working on this problem at the moment. But I don't have solved it so I need to spend some time on it later.

    At the moment I'm able to read the manufacturer ID be changing the following defines

    #define WRITE_NAND(x,y)         OUTREG16(x,y)    // 16-bit access
    #define READ_NAND(x)            INREG16(x)       // 16-bit access
    typedef REG16 NANDREG;

    to

    #define WRITE_NAND(x,y)         OUTREG8(x,y)    // 8-bit access
    #define READ_NAND(x)            INREG8(x)       // 8-bit access
    typedef REG8 NANDREG;

    But this changes are not enough, because the driver hangs on reading a block.

    At the moment I don't have more information. If you find something, it would be nice to hear from you. I will do the same to you.

    Best regards,

    Andreas

  • hi andreas...

    same problem here..... im not even able to detect the  nand ID's...

     the boot gets stuck after below...........

    Microsoft Windows CE Bootloader Common Library Version 1.4 Built Jul 20 2012 10:20:54

    Texas Instruments Windows CE EBOOT for AM35x, Built Jul 27 2012 at 08:42:48
    EBOOT Version 1.2, BSP 2.00.00.02

    System ready!
    Preparing for download...
    INFO: Predownload....

    i have heard that 8 bit nand is not supported by the BSP.....

    pls share the changes i have to make.....

    thnx in advance............

  • Please compare the fmd.c implementation in \PLATFORM\COMMON\SRC\SOC\COMMON_TI_V1\COMMON_TI_AMXX\BLOCK\NAND\fmd.c vs the \PLATFORM\COMMON\SRC\SOC\COMMON_TI_V1\COMMON_TI\BLOCK\NAND\fmd.c.  In the AMXX implementation there is a macro that detects the 8 or 16bit NAND bus size.  With this information it can use either the 8 or 16 bit code paths.  You'll need to port these changes and then debug the port to get your 8 bit NAND working.

  • Thanks for your answer.

    With your suggestion I have done the following changes, to get the 8bit NAND Flash working with the AM35x NAND Flash driver:

    16bit NAND Flash:

    #define WRITE_NAND(x,y)         OUTREG16(x,y)

    #define READ_NAND(x)            INREG16(x)  

    typedef REG16 NANDREG; 

    // Offset is provided to this function in bytes; NAND device requires words
    offset = offset / 2;

    pDevice->pFifo = MmMapIoSpace(pa, pDevice->memLen[1], FALSE);

     pDevice->ECCCfg = (GPMC_ECC_CONFIG_16BIT | (chipSelect << 1) | (0x3<<4));

    8bit NAND Flash:

    #define WRITE_NAND(x,y)         OUTREG8(x,y)

    #define READ_NAND(x)            INREG8(x)

    typedef REG8 NANDREG;

    // Offset is provided to this function in bytes; NAND device requires words
    offset = offset / sizeof(NANDREG);

     pDevice->pFifo = (NANDREG *)MmMapIoSpace(pa, pDevice->memLen[1], FALSE);

     pDevice->ECCCfg = (GPMC_ECC_CONFIG_8BIT | (chipSelect << 1) | (0x3<<4));

    Thanks and best regards,

    Andreas

     

  • hey andreas........

    i got my 8 bit nand working too..... :)

    but issues im facing are....

    1. the nand read/write spped is too slow wen compared to POP... its coming around 200KBPS...and the file copy speed is coming around 65KBPS.. which are too low as per the data sheet of the nand.. i tested these speeds with this utillity 6761.CETestContainer.rar ...

    2. some times the data that i have copied to nand is getting corrupted after cold reboot and some times its not...

    3. some times the data is getting lost.. i.e nand gets erased completely upon cold reboot  and some times its not....

    r u facing the same issues?????? wat might be the cause to it?????

    pls help me andreas....

    thnx in advance...

  • Hi,

    sorry for the late answer. I currently have a lot of work. I will check your notes as soon as possible with our platform and I'm writing again.

    Best regards,

    Andreas

  • hey i made all the changes wat u hav done , im able to read device id n manufacture id of my 8bit nand but eve im getting stuck at  memcpy(pData, (BYTE*)pDevice->pFifo, FIFO_THRESHOLD);

    wat did u do to solve this problem... pls share..... :)

    can u pls share files fmd.c, bsp_def.h, bspcfg.c, cfg.c, flashmenu.c,,......whch made the 8bit nand work.... pls pls pls... im also trying to bring up 8bit nand... but have not seen much success... im able to read the device ID  n manufac id... but after reading, the boot hangs... unable to boot... pls can u share...... 

    pls pls pls........... :)

     

  • Hi,

    all the changes I have done are explained above.

    Best regards,

    Andreas

  • hi andreas,

    thnx for timely reply.......


    but i have made all the changes wat u hav done , im able to read device id n manufacture id of my 8bit nand.......BUT BUT BUT.... still EBOOT is getting stuck at  memcpy(pData, (BYTE*)pDevice->pFifo, FIFO_THRESHOLD) line in  in the function NAND_Read().

    this is the same problem that u have posted in 1st post of this blog.....

    how did u solve this ??????

  • Try to add line

    // Configure CS GPMC_CONFIG7_0

    OUTREG32(&pDevice->pGpmcRegs->GPMC_CONFIG7_0, 0xF48); // Chip-select size of 16 Mbytes + CS enable + CS base address 0x800_0000 (FIFO)

    in the function NAND_Initialize() after

    // configure prefetch engine

    OUTREG32(&pDevice->pGpmcRegs->GPMC_PREFETCH_CONFIG2, pBSPNandInfo->sectorSize);        

    SETREG32(&pDevice->pGpmcRegs->GPMC_PREFETCH_CONFIG1, GPMC_PREFETCH_CONFIG_ENABLEENGINE);

    Best regards,

    Andreas