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.

not able to program single Byte to the NOR flash S29GL256S10DHV020

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Using provided NOR Flash driver code , I am not able to program single Byte to the NOR flash S29GL256S10DHV020 .

Is there some additional information that I should check .

Can someone help me with EMIF controller configuration . I have set parameters to Maximum wait cycles .

Thanks  For 

Attached my CCS project with NOR FLASH implementation

  • Hello Chandre,

    The code I posted is only an example for NOR flash. The commands for read/write/erase may be different from the commands defined in datasheet of the NOR flash you used. Please double check the commands:

    The commands for S92GL01GS are listed in Table 7.1 Command Definitions

    https://www.cypress.com/file/177976/download

  • Hello Mr. Q J Wang ,

    Should the Wave forms help to debug or resolve the NOR FLASH issue .

    I have updated the command set for the NOR FLASH as per the S92GL256S listed in Table 7.1 Command Definitions  .

    With the updated command set data is not being written in NOR FLASH as per the Command Definitions .

    Following are the Waveforms I Captured on my board .

    0- CS2

    1- EMIF_n_Wait

    2- EMIF_WE

    3- EMIF_OE

    4- EMIF_D0

    5- EMIF_A0

    6- EMIF_A1

    For the NOR FLASH S92GL256S  following are the waveform from TMS570LS3137 .

    I have tried different MPU region settings but it doesn't change anything. I've ended up unchecking all the "Enable MPU Region" from the 1st one to the last one (the 12th), but the extra nWE pulses are still there. Therefore, it doesn't seem to be a problem of 5th region being overridden by the other ones.
    Actually, I have two writings instead of just one. For instance, when I write a simple 16 bits word at address "0006" of external asynchronous memory region (0x60000000), the TMS first writes an other 16 bits word at address "0005", and then it writes the good 16 bits word at address "0006". So it seems that the TMS automatically writes an other word at the address next to the good one and then writes correctly at the good address. 

    For the SDRAM that works following are the waveform from TMS570LS3137 .

    Am I missing any important information or ERRATA that should be respected to ever successfully connected NOR FLASH to the TMS570LS3137

    Attached is my Project Space

    https://drive.google.com/file/d/1CCVbf-asL5R-bLeHL1D-RC1Ds2-cptSL/view?usp=sharing

  • Hello,

    I noticed that you enabled the extended wait mode. Did you have any input on the EMIF_nWAIT pin? When Extended Wait Mode is enabled, the EMIF monitors the EMIF_nWAIT pin to determine if the attached device wishes to extend the strobe period of the current access cycle beyond the programmed number of clock cycles. The polarity of the EMIF_nWAIT pin is configured by WPn bit of AWCC register. In its reset state of 1, the EMIF will insert wait cycles when the EMIF_nWAIT pin is sampled high. When set to 0, the EMIF will insert wait cycles only when EMIF_nWAIT is sampled low.

    How the EMIF addr signals are connected to NOR flash? Since the memory is 16-bit, so the EMIF BA[1] should be connected to memory A[0], and the EMIF A[x] should be connected to memory A[x+1].

    Please double check the pinmux.

    I am not able to access the google drive.

     

  • Are you able to erase the NOR flash?

    This is my code for erasing NOR flash. I gave you before:

    /* ------------------------------------------------------------------------ *

    * *

    * FLASH_erase( start, length ) *

    * Erase Flash containing address ( start ) to ( start + length ). *

    * Flash can only erase entire blocks containing the range. *

    * *

    * start <- starting address *

    * length <- length in bytes *

    * *

    * ------------------------------------------------------------------------ */

    uint16_t FLASH_erase( uint32_t start, uint32_t length )

    {

    uint32_t addr;

    uint32_t end;

    volatile uint16_t* addr16;

    end = start + length - 1; // Calculate end of range

    start &= 0xFFFFFFFE; // Align to 16-bit words

    /*

    * Erase each Flash block in the range

    */

    for ( addr = start ; addr <= end ; addr += FLASH_PAGESIZE )

    {

    addr16 = ( volatile uint16_t* )addr;

    *addr16 = FLASH_RESET; // Reset Flash

    FLASH_CTL555 = FLASH_CMD_AA;

    FLASH_CTL2AA = FLASH_CMD_55;

    FLASH_CTL555 = FLASH_ERASE; // Erase sector command

    FLASH_CTL555 = FLASH_CMD_AA;

    FLASH_CTL2AA = FLASH_CMD_55;

    *addr16 = FLASH_ERASE_SECTOR; // Erase sector confirm

    #ifdef EMIF_USE_REORDER_FIX

    EMIF_REVID = 0;

    #endif

    if ( _FLASH_waitWhileErasing( addr, timeout ) )

    {

    *addr16 = FLASH_RESET;

    return -1;

    }

    }

    return 0;

    }

  • Hi ,

    OSCILLOSCOPE plots of  EMIF  A0 to A15 ( Address line EMIF BA1 to EMIF A14 ) and I found an deviation from specification  on TMS570LS3137 

    The Address signal generated on A1 and A0 are not correct .

    Following Oscilloscope plot shows simple execution of sending same values for 3 lower nibbles and reading the  A0 & A1 that should follow A4 & A5 that should follow A8& A9 .  

    I have tried different MPU region settings but it doesn't change anything. I've ended up unchecking all the "Enable MPU Region" from the 1st one to the last one (the 12th), but the extra nWE pulses are still there. Therefore, it doesn't seem to be a problem of 5th region being overridden by the other ones.


    Actually, I have two writings instead of just one. For instance, when I write a simple 16 bits word at address "0006" of external asynchronous memory region (0x60000000), the TMS first writes an other 16 bits word at address "0005", and then it writes the good 16 bits word at address "0006". So it seems that the TMS automatically writes an other word at the address next to the good one and then writes correctly at the good address. 

    Attached my test project that I am using to perform test , with adding errata fix of line in main  systemREG1->GPREG1 |= 0x80000000;

    Error found wrong NOR FLASH Address A0 and A1 toggling for *( (uint16_t *)base_addr + 0x000C ) = 0x00AA;   

    A2 is 1

    A1 is 1

    A0 is 1

    BA1 is 0

    Error found wrong NOR FLASH Address A0 and A1 toggling  for *( (uint16_t *)base_addr + 0x0005 ) = 0x00AA;   

    A2 is 0

    A1 is 1

    A0 is 1

    BA1 is 0

    working as ok for *( (uint16_t *)base_addr + 0x000A ) = 0x00AA;   

    A2 is 1

    A1 is 0

    A0 is 1

    BA1 is 0

    working as ok for *( (uint16_t *)base_addr + 0x000F ) = 0x00AA;   

    A2 is 1

    A1 is 0

    A0 is 1

    BA1 is 0

    On the HALCOGEN PINMUX there L17 EMIF_nCS2 is not populated  . K17 EMIF_nCS3 and M17 EMIF_nCS4 are populated .

    Should the HalCoGen  not generate correct code for the NOR EMIF addr signals connected to NOR flash?

    EMIF_BA[1] is connected to NOR FLASH memory A[0], and the EMIF A[x] is connected to memory A[x+1]. as shown in following schematic .

    Attached is  the Test project SDRAM code in the project works , NOR FLASH does not work .

    7180.EMIF_NOR_FLASH_TESTING.ZIP

  • Hi Chandra.

    Because you opened several threads for NOR flash questions, I will close this thread.

  • Hi Mr. Q J Wang , 

    Thanks again for all the Solutions you suggested that helped in resolving the NOR Flash implementation issues .

    Appreciate taking time and for your support on the issue .

    For any one looking for a solution on EMIF NOR FLASH interface , please follow thread mentioned below. 

    The issue is now resolved by having correct MPU settings as DEVICE for CS2 address 0x60000000 to 0x61FFFFFF (32 MB).

    Thanks & Warm Regards