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.

Why my flash can not be written?

I have a 6416 board,now I want to boot my program from flash, so now I configure EMIFB CE1 to let me burn data into the

flash (AMD29lv320d) , here is my code:

/**
 * Initialize EMIFB
 */
void EmifInit()
{
    /* config EMIFB */
    EMIFB_configArgs(
        /* gblctl */
        /* ek2rate,ek2hz,ek2en,brmode,nohold,ek1hz,ek1en */
        EMIFB_GBLCTL_RMK(
            EMIFB_GBLCTL_EK2RATE_QUARCLK,
            EMIFB_GBLCTL_EK2HZ_CLK,
            EMIFB_GBLCTL_EK2EN_ENABLE,
            EMIFB_GBLCTL_BRMODE_MSTATUS,
            EMIFB_GBLCTL_NOHOLD_DISABLE,
            EMIFB_GBLCTL_EK1HZ_CLK,
            EMIFB_GBLCTL_EK1EN_ENABLE
            ),

        /* cectl0 */
        /* wrsetup,wrstrb,wrhld,rdsetup,ta,rdstrb,mtype,wrhldmsb,rdhld */
        0x00000000,

        /* cectl1 for flash */
        EMIFB_CECTL_RMK(
            EMIFB_CECTL_WRSETUP_OF(2),
            EMIFB_CECTL_WRSTRB_OF(2),
            EMIFB_CECTL_WRHLD_OF(2),
            EMIFB_CECTL_RDSETUP_OF(1),
            EMIFB_CECTL_TA_OF(3),
            EMIFB_CECTL_RDSTRB_OF(3),
            EMIFB_CECTL_MTYPE_ASYNC8,
            EMIFB_CECTL_WRHLDMSB_OF(1),
            EMIFB_CECTL_RDHLD_OF(1)
        ),

        0x00000030, /* cectl2 */
        0x00000000,  /* cectl3 */
        0x00000000, /* sdctl */
        0x00000000, /* sdtim */
        0x00000000, /* sdext */
        0x00000000, /* cesec0 */
        0x00000000, /* cesec1 */
        0x00000000, /* cesec2 */
        0x00000000 /* cesec3 */
    );   
}

/*******************************************************************/
/* void main(void)                                                 */
/*******************************************************************/
void main(void)
{
    int i;

    /* initialize the CSL library */
    CSL_init();

    /* initialize EMIF for flash */
    EmifInit();


    // read Manufacturer ID


    for(i=0;i<0xFFFF;i++);
    *((volatile Uint8*)0x64000AAA) = 0xAA; // AAA AA

    for(i=0;i<0xFFFF;i++);
    *((volatile Uint8*)0x64000555) = 0x55; // 555 55

    for(i=0;i<0xFFFF;i++);
    *((volatile Uint8*)0x64000AAA) = 0x90; // AAA 90

    for(i=0;i<0xFFFF;i++);

    printf("ID=%d\n",*(volatile Uint8 *)0x64000000);

    printf("Test is over\n");

}

unfortunately, the result of running is:

ID=255
Test is over

 

I know that's not correct, according to the AMD datasheet, the ID should be 01.

The clock is 160 MHz, / 4 (I use QUARCLK) .

Is there somebody tell me why, thanks!