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.

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

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

art Number: TMS570LS3137

Hi ,

On my Board NOR FLASH device is connected as Figure 17.8b in TMS570LS31x/21x TRM and the EMIF registers are set to:

Actually, I am seeing two writings WE# 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" with WE#, and then it writes the good 16 bits word at address "0006" with another WE#.

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.

Do you think that this extra writing at the address next to the good one could be caused by an other setting in HalCoGen ? Or even a setting in Code Composer Studio ?

The Address signal generated to NOR FLASH A1 and NOR FLASH A0 (EMIF_BA1 and EMIF_A0 lines of TMS570LS3137) are not correct .

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 execution of sending same values for 3 lower nibbles and reading the  A0 & A1 that should follow A4 & A5 that should follow A8& A9 .  

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;   expected 1100 binary

A2 is 1

A1 is 1

A0 is 1  Wrong bit set

BA1 is 0

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

A2 is 0

A1 is 1

A0 is 1 Wrong bit set

BA1 is 0 Wrong Bit Reset

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 .

Similar problem was mentioned in following thread with no solution

https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/284785?EMIF-16-bit-async-write-generates-multiple-writes

2nd thread

https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/788623?TMS570LS3137-EMIF-Asynchronous-Timing-unable-to-Write-Read-device-properly

Following suggestions are implemented 

1. Please make your pinmux is configured correctly.


2. For memory interface, the EMIF address pin EMIF_A[0] always provides the least significant bit of a 32-bit word address. Therefore, when interfacing to a 16-bit asynchronous device, the EMIF_BA[1] pin provide the least-significant bits of the halfword. EMIF_BA[1] should be connected to Memory A[0] pin.


3. Suggest to try maximum value for SETUP, STROBE, and HOLD fields in CE2FFG register first, make sure your setup work.

4.Most likely, the problem is caused by the timing. Any special requirements for setup, strobe, and hold for the EMIF device? Can you lower the EMIF clock to 16MHz too?

5.You are right, to write data to EMIF async memory correctly, the memory has to be configured as device type or strongly-ordered type using MPU

6)

I also have to add following lines of code Possibly Halcogen Bugs  that toggles the EMIF data lines and EMIF address lines.

systemREG1->GPREG1 |= 0x80000000;

dmmREG->PC1 = 1 /* DATA[0] */ /*!!! should be 1 << 2 !!!*/
| (1 << 1) /* DATA[1] */ /*!!! should be 1 << 3 !!!*/
| (1 << 2) /* DATA[2] */ /*!!! etc !!!*/
| (1 << 3) /* DATA[3] */
| (1 << 4) /* DATA[4] */
| (1 << 5) /* DATA[5] */
| (1 << 6) /* DATA[6] */
| (0 << 7) /* DATA[7] */
| (0 << 8) /* DATA[8] */
| (0 << 9) /* DATA[9] */
| (0 << 10) /* DATA[10] */
| (1 << 11) /* DATA[11] */
| (0 << 12) /* DATA[12] */
| (1 << 13) /* DATA[13] */
| (1 << 14) /* DATA[14] */
| (0 << 15) /* DATA[15] */
| (0 << 16) /* DMM SYNC */
| (1 << 17) /* DMM CLK */
| (1 << 18); /* DMM ENA */

7) EMIF at 45MHz

8) mpuInit() .

9) The EMIF clock should be < 50MHz. 90MHz is out of the valid range.

10) Also the setting " DEVICE MODE" for 0x6000_0000 memory region in MPU setting. If using NORMAL mode, there are more than 1 new pulse in one nCS cycle.

11) Can you make sure that the MPU initialization function mpuInit() is actually called from the main routine? This initialization is not done by the default start-up sequence generated by HALCoGen.

  • Hello Chandre,

    1. Pin L17 is dedicated to nCS2. No pinmux config is required for nCS2. nCS3 and nCS4 are multiplexed with NHET and RTP, so the pinmux configuration is required before using them. There is no silicon error on EMIF.

    2. You schematics around EMIF looks good. Don't you use nDQM[1:0] (byte enable) for your NOR flash?

    3. Can you try the normal mode instead of select strobe mode?

    4. When reading the scope display. The 1st bit of Address on the scope is byte (DQM[1:0]), the 2nd bit is BA[1] (half-word), and the 3rd bit is EMIF_addr[0]

  • Hello Mr. Q J Wang ,

    Thanks with providing the details , There are 4 sections in following description

    Section 1:

     From TMS570LS3137 that there is 3 write cycles corresponding to a single write command. Please see below Image .

    This is the scope for write operation in the source code.

    FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_UNLOCK_DATA1);

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x00000555)))) = (((0xAA)*0x00000001))

    I have repeated with different EMIF Frequencies of 36 MHz and 90 MHz I am getting same 3 write cycles . 

    Is this expected or should there are 3 write cycles (WC1..3) for a single write operation ?.

    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. 

    SECTION 2:

    The Address signal generated to NOR FLASH A0 and NOR FLASH A1 (EMIF_BA1 and EMIF_A0 lines of TMS570LS3137) are not correct .

    My Question in Description NOR FLASH A0 and NOR FLASH A1 (EMIF_BA1 and EMIF_A0 lines from TMS570LS3137) are not setting Correctly , Correct me if I am doing any mistakes in whole hardware or firmware .

    NOR Flash device S29GL256S10DHV020 is 16Mx16(32MB) does not require nDQM as it is 16 bit device and it never switch to byte addressing please correct us if I am stating this wrong

    As per the Oscilloscope plot shown below while setting commands at address 0x60000555 and 0x60000CCC , these Address lines are probed at the Signal 0 ( A0 of NOR FLASH , EMIF_BA1 of TMS570) and Signal 1( A1 of NOR Flash , EMIF_A0 of TMS570 Please refer to the schematic snapshot above)  is setting wrongly to address 0x60000556 and 0x60000CCE as per the Oscilloscope plot below

    As per Shown in oscilloscope plot that are probing A0 and A1 of NOR flash connected to TMS570LS3137 EMIF_BA1 and EMIF_A0  .

    1. Thanks for Clarifying the Pin L17 details .

    2.  NOR FLASH S29GL256S10DHV020 is 16 bit accessible and there are no specific DQM pins on the IC  . Should we still use nDQM[1:0]  ? . NOR Flash,16Mx16(32MB)  . Is this correct or should we implement in different method ?.

    3. Yes I tried the normal mode instead of select strobe mode and getting same response .

    4. Sorry I did not understand your statement  . As per specification we do not use 1st bit nDQM[1:0]  , Our configuration 16-bit Asynchronous and is as shown in snap shot EMIF_CONNECTIONS below .

    The data width is always 16 bit so CEnCFG is set to 16_bit .

    EMIF_CONNECTIONS of S29GL256S10DHV020 Automotive NOR Flash,16Mx16(32MB)

     

      

    SECTION 3: With Strobe Mode ON

    I Cannot Access the Lines on the Production Board . We have an TMS570LS3137 HDK that has access to all lines  . 

    base_addr is 0x60000000

    void emif_ASYNC1Init(void)
    {

    emifREG->CE2CFG = 0x00000000U;
    emifREG->CE2CFG = (uint32)((uint32)1U << 31U)|
    (uint32)((uint32)0U << 30U)|
    (uint32)((uint32)2U << 26U)|
    (uint32)((uint32)6U << 20U)|
    (uint32)((uint32)1U << 17U)|
    (uint32)((uint32)1U << 13U)|
    (uint32)((uint32)11U << 7U)|
    (uint32)((uint32)3U << 4U)|
    (uint32)((uint32)3U << 2U)|
    (uint32)((uint32)emif_16_bit_port);

    emifREG->AWCC = (emifREG->AWCC & 0xC0FF0000U)|
    (uint32)((uint32)emif_pin_low << 29U)|
    (uint32)((uint32)emif_pin_low << 28U)|
    (uint32)((uint32)emif_wait_pin1 << 16U)|
    (uint32)((uint32)0U);

    emifREG->PMCR = (emifREG->PMCR & 0xFFFFFF00U)|
    (uint32)((uint32)0U << 2U)|
    (uint32)((uint32)emif_8_words << 1U)|
    (uint32)((uint32)0U);

    }

    SCOPE PLOT 1:

    FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_UNLOCK_DATA1);

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x00000555)))) = (((0xAA)*0x00000001))

    Write operation:

    SIGNAL7 = DATA1

    SIGNAL6= DATA0,

    SIGNAL 5= WE#,

    SIGNAL 4= CS2,

    SIGNAL 3= A2 (A3 of flash),

    SIGNAL 2= A1 (A2 of flash),

    SIGNAL 1 = A0 (A1 of flash),

    SIGNAL 0 = BA1 (A0 of flash),

    tek0000.png

    ZOOM 100x

    tek0001.png

    SCOPE PLOT 2:

      FLASH_WR(base_addr, LLD_UNLOCK_ADDR2, NOR_UNLOCK_DATA2);

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x000002AA)))) = (((0x55)*0x00000001))

    tek0000.png

    Zoom In 100x

    tek0001.png

    Read operation: 

    SCOPE PLOT 3:

    FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_UNLOCK_DATA1);

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x00000555)))) = (((0xAA)*0x00000001))

    Read operation:

    SIGNAL7 = DATA1

    SIGNAL6= DATA0,

    SIGNAL 5= OE#,

    SIGNAL 4= CS2,

    SIGNAL 3= A2 (A3 of flash),

    SIGNAL 2= A1 (A2 of flash),

    SIGNAL 1 = A0 (A1 of flash),

    SIGNAL 0 = BA1 (A0 of flash),

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x008E))))

    tek0000.png

    ZOOM 100x

    tek0001.png

    SECTION 4: With Strobe Mode OFF

     void emif_ASYNC1Init(void)

    {

    emifREG->CE2CFG = 0x00000000U;
    emifREG->CE2CFG = (uint32)((uint32)0U << 31U)|
    (uint32)((uint32)0U << 30U)|
    (uint32)((uint32)2U << 26U)|
    (uint32)((uint32)6U << 20U)|
    (uint32)((uint32)1U << 17U)|
    (uint32)((uint32)1U << 13U)|
    (uint32)((uint32)11U << 7U)|
    (uint32)((uint32)3U << 4U)|
    (uint32)((uint32)3U << 2U)|
    (uint32)((uint32)emif_16_bit_port);

    emifREG->AWCC = (emifREG->AWCC & 0xC0FF0000U)|
    (uint32)((uint32)emif_pin_low << 29U)|
    (uint32)((uint32)emif_pin_low << 28U)|
    (uint32)((uint32)emif_wait_pin1 << 16U)|
    (uint32)((uint32)0U);

    emifREG->PMCR = (emifREG->PMCR & 0xFFFFFF00U)|
    (uint32)((uint32)0U << 2U)|
    (uint32)((uint32)emif_8_words << 1U)|
    (uint32)((uint32)0U);
    }

     

    FLASH_WR(base_addr, LLD_UNLOCK_ADDR1, NOR_UNLOCK_DATA1);

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x00000555)))) = (((0xAA)*0x00000001))

    Write operation:

    SIGNAL7 = DATA1

    SIGNAL6= DATA0,

    SIGNAL 5= WE#,

    SIGNAL 4= CS2,

    SIGNAL 3= A2 (A3 of flash),

    SIGNAL 2= A1 (A2 of flash),

    SIGNAL 1 = A0 (A1 of flash),

    SIGNAL 0 = BA1 (A0 of flash),

     


     

     

    SCOPE PLOT 2:

      FLASH_WR(base_addr, LLD_UNLOCK_ADDR2, NOR_UNLOCK_DATA2);

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x000002AA)))) = (((0x55)*0x00000001))

     

  • Hello,

    Section 1:

    The captured diagram doesn't look correct. Only one write cycle (nCS LOW) is needed to write a byte, or a half-word (16-bit), or a word (32-bit). When you write 32-bit data, the new signal is de-asserted after writing the first 16-bit data, then asserted to write the 2nd 16-bit data. The nCS keeps LOW for whole byte (byte write), whole half-word (16-bit write), and whole word (32-bit write).

    The EMIF clock should be < 50MHz. 90MHz is out of the valid range.

    When I write a 16 bits half-word at address 0x6000_0006, the BA[1]=1, A0=1, A1=0, A2=0, A3=0. But your capture diagram shows that A3 is always HIGH

    Please use DEVICE MODE for 0x6000_0000 memory region in MPU setting. If using NORMAL mode, there are more than 1 new pulse in one nCS cycle.

    My understanding, you write one 16-bit data in WC1, another 16-bit data in WC2, and 3rd 16-bit data in WC3.

  • SECTION 2:

    If the memory doesn't have byte enable, it is ok to leave the signals open or pulled down. Your signals connection in your schematics are correct: EMIF_A[0] -- Memory_A[1], EMIF_BA[1] --Memory_A[0], ...

    EMIF system bus width is 32-bit wide. A[0] is always the 3rd bit (32-bit word) of the memory address, and BA[1] is 2nd bit (16-bit). If you write data to 0x6000_0552, the BA[1]=1, A[0]=0, A[1]=0, A[2]=1, A[3]=0, A[4]=1,...

    This is why I swizzle the flash CMD and CMD address in my NOR flash example code.

    I will answer other sections later

  • Hi Mr. Q J Wang ,

    Appreciate for the Clarification .

    FOR WHATEVER MPU region settings, FOR WHAT EVER EMIF FREQUENCY , FOR WHAT EVER data width , From TMS570LS3137 there are at-least 2 write cycles corresponding to a single write command. Please see below Images .

    My Conclusion : So it seems that the TMS automatically writes ( more than 1 word )  an other word at the address next to the good.

    Do you think that this extra writing at the address next to the good one could be caused by an other setting in HalCoGen ? Or even a setting in Code Composer Studio ?

    I have run multiple tests . 

    I have repeated with different EMIF Frequencies of 11 MHz and 45 MHz I am not getting 1 write cycles . 

    Is this expected as there are 2 write Cycles (WC1..2) or  3 write cycles (WC1..3) for a single write operation ?.

    I have tried different MPU region settings but it doesn't change anything. I've ended up un-checking 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.

    Thus the result is correct but with unnecessary extra write cycles.  Is this expected behavior even for writes to even 16-bit addresses and could it be modified to a single write?

    This is the oscilloscope plot for write operation in the source code.

    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0xAA)*0x00000001))

    This is the oscilloscope plot for write operation in the source code.

    (*(( (volatile unsigned long*)((0x60000000)) ) + ((0x00000555)))) = (((0xAA)*0x00000001))

  • Hello,

    Can you make sure that the MPU initialization function mpuInit() is actually called from the main routine? This initialization is not done by the default start-up sequence generated by HALCoGen.

  • Hi Sunil ,

     

    Thanks for Sending in the 4 Required Changes . These 4 fixes that you suggested was implemented and I can see "Single Write" signal on WE#

    1) EMIF at 45MHz

    2) mpuInit() .

    3) The EMIF clock should be < 50MHz. 90MHz is out of the valid range.

    4) Also the setting " DEVICE MODE" for 0x6000_0000 memory region in MPU setting. If using NORMAL mode, there are more than 1 new pulse in one nCS cycle.

    TMS570LS3137 is able to Write to the Device and Read from NOR FLASH  . ( I still did not verify all timing diagrams and also write values and read values)

    I will be working with implementing the low level driver to write to NOR FLASH device and read data from the NOR FLASH device. 

    I also have to add following lines of code Possibly Halcogen Bugs  that toggles the EMIF data lines and EMIF address lines.

    systemREG1->GPREG1 |= 0x80000000;

    dmmREG->PC1 = 1 /* DATA[0] */ /*!!! should be 1 << 2 !!!*/
    | (1 << 1) /* DATA[1] */ /*!!! should be 1 << 3 !!!*/
    | (1 << 2) /* DATA[2] */ /*!!! etc !!!*/
    | (1 << 3) /* DATA[3] */
    | (1 << 4) /* DATA[4] */
    | (1 << 5) /* DATA[5] */
    | (1 << 6) /* DATA[6] */
    | (0 << 7) /* DATA[7] */
    | (0 << 8) /* DATA[8] */
    | (0 << 9) /* DATA[9] */
    | (0 << 10) /* DATA[10] */
    | (1 << 11) /* DATA[11] */
    | (0 << 12) /* DATA[12] */
    | (1 << 13) /* DATA[13] */
    | (1 << 14) /* DATA[14] */
    | (0 << 15) /* DATA[15] */
    | (0 << 16) /* DMM SYNC */
    | (1 << 17) /* DMM CLK */
    | (1 << 18); /* DMM ENA */

    Following are the Oscilloscope Plots and NOR FLASH Read Values :-

    Following is the NOR FLASH area Write and Read along with DEVICE IDENTIFICATION using Common Flash interface

    Thanks a lot again for taking time and fixing the EMIF related queries . 

    Following is Source Code for  NOR FLASH area Write and Read along with DEVICE IDENTIFICATION using Common Flash interface

    if(Enable_NOR_FLASH_command == 0xEA8EEA8E)
    {

    base_address_EMIF_SDRAM = (unsigned short*)0x80000000;
    base_address_nor_flash = (unsigned short*)0x60000000;

    // Read nor flash contents for external sdram 

    for(Read=0;Read<65535;Read++) 
    {

    base_address_EMIF_SDRAM = base_address_nor_flash;
    base_address_EMIF_SDRAM++;
    base_address_nor_flash++;
    }
    base_address_EMIF_SDRAM = (unsigned short*)0x80000000;
    base_address_nor_flash = (unsigned short*)0x60000000;

    if(Erase_Sector_command == 0xEA8EEA8E)
    // COMPLETE CHIP ERASE COMMAND REQUIRES 70 SECODNS
    {
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0)))) = (((0xF0)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0xAA)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x000002AA)))) = (((0x55)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0x80)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0xAA)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x000002AA)))) = (((0x55)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) )) = (((0x30)*0x00000001)); // SECTOR ERASE
    //(*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0x10)*0x00000001)); // CHIP ERASE
    for(delay=0;delay<65535;delay++);
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0)))) = (((0xF0)*0x00000001));
    }

    for(Read=0;Read<19;Read++) // Read DEVICE ID by CFI
    {
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0xAA)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x000002AA)))) = (((0x55)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0x90)*0x00000001));
    Device_ID[Read] = (unsigned char)((*(( (volatile unsigned short*)((0x60000000)) ) + ((0x0080+Read)))) & 0x000000FF) ;
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0)))) = (((0xF0)*0x00000001));
    }

    //lld_ProgramCmd(base_address_nor_flash,offset++,source_address++);
    for(Write_Nor=0;Write_Nor<65535;Write_Nor++)
    {
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0xAA)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x000002AA)))) = (((0x55)*0x00000001));
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0xA0)*0x00000001));
    ((*(( (volatile unsigned short*)((0x60000000)) ) + ((Write_Nor)))))= Write_Nor;

    for(delay=0;delay<5000;delay++);
    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0)))) = (((0xF0)*0x00000001));
    }


    }

  • Hello,

    Section 3:

    I am sorry I am not familiar with your code:

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x000002AA)))) = (((0x55)*0x00000001))

    The diagram you captured is not a expected diagram of writing one byte or one 16-bit word or one 32-bit word. 

    Can you please capture the waveform for writing bytes, half-word, and word using following instructions:

    *(char *)    0x60000652   = 0x11;
    *(short *)   0x60000752   = 0x2233;
    *(int *)       0x60000954   = 0x44556677;

     

    1. *(char *)    0x60000652   = 0x11; 

    one nCS and nWE

    EMIF_A[x:0] = base addr + 0x0652 >> 2 =  base addr + 0x0194

    BA[1] = 1

    2. *(short *)   0x60000752   = 0x2233;

    one nCS and nWE

    EMIF_A[x:0] = base addr + 0x0752 >> 2 =  base addr + 0x01D4

    BA[1] = 1

    3. *(int *)       0x60000954   = 0x44556677;

    one nCS, but 2 nWE. The 1st nWE assertion period is for 0x4455, and the 2nd one is for 0x6677

    EMIF_A[x:0] = base addr + 0x0952 >> 2 =  base addr + 0x0254

    BA[1] = 1

  • Section 4:

    Your EMIF configurations look good for me.

    One more to try is to increase the number of cycles to SETUP, STROBE, and HOLD. Those number should meet the minimum requirement of asyn memory chip.

    From the S20GLx NOR flash datasheet, the CMD for writing data to flash is: 0x555-AA, 0x2AA-55, 0x555-A0, A-PD

    0x555 is the flash address rather than EMIF address. Please refer to my example code given you weeks ago.

    flash 0x555 -->emif 0xAAA

    flash 0x2AA -->emif 0x554

    BTW, please check the assembly code for:

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x00000555)))) = (((0xAA)*0x00000001))

  • Hi Mr.Q J Wang ,

    Response  to the SECTION 3 :

    All Oscilloscope Plots have following signal information 

    SIGNAL7 = DATA1

    SIGNAL6= DATA0,

    SIGNAL 5= WE#,

    SIGNAL 4= CS2,

    SIGNAL 3= A2 (A3 of flash),

    SIGNAL 2= A1 (A2 of flash),

    SIGNAL 1 = A0 (A1 of flash),

    SIGNAL 0 = BA1 (A0 of flash),

    *(char *) 0x60000652 = 0x11;

    Expected 1. *(char *)    0x60000652   = 0x11; 

    one nCS and nWE

    EMIF_A[x:0] = base addr + 0x0652 >> 2 =  base addr + 0x0194

    BA[1] = 1

    *(short *) 0x60000752 = 0x2233;

    Expected 2. *(short *)   0x60000752   = 0x2233;

    one nCS and nWE

    EMIF_A[x:0] = base addr + 0x0752 >> 2 =  base addr + 0x01D4

    BA[1] = 1

    *(int *) 0x60000954 = 0x44556677;

    Expected 3. *(int *)       0x60000954   = 0x44556677;

    one nCS, but 2 nWE.

    The 1st nWE assertion period is for 0x4455>> 2 =  base addr + 0x1115

    BA[1] = 0

    2nd one is for 0x6677

    EMIF_A[x:0] = base addr + 0x0952 >> 2 =  base addr + 0x0254

    BA[1] = 1

    (*(( (volatile FLASHDATA*)((base_addr)) ) + ((0x00000555)))) = (((0xAA)*0x00000001))

    expands to 

    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0xAA)*0x00000001));

    Assembly equivalent is 

    (*(( (volatile unsigned short*)((0x60000000)) ) + ((0x00000555)))) = (((0xAA)*0x00000001));
    E59F0200    LDR R0, $C$CON23              real64__to__real32:
    E3A0C0AA   MOV R12, #170
    E1C0C0B0   STRH R12, [R0]

    Please review the following EMIF.C settings and let me know these are correct for S29GL256S10DHV020

    following are settings  in emif.c 

    emifREG->CE2CFG = 0x00000000U;

    emifREG->CE2CFG = (uint32)((uint32)0U << 31U)|
    (uint32)((uint32)0U << 30U)|
    (uint32)((uint32)16U << 26U)|
    (uint32)((uint32)48U << 20U)|
    (uint32)((uint32)8U << 17U)|
    (uint32)((uint32)8U << 13U)|
    (uint32)((uint32)88U << 7U)|
    (uint32)((uint32)24U << 4U)|
    (uint32)((uint32)24U << 2U)|
    (uint32)((uint32)emif_16_bit_port);

    emifREG->AWCC = (emifREG->AWCC & 0xC0FF0000U)|
    (uint32)((uint32)emif_pin_high << 29U)|
    (uint32)((uint32)emif_pin_low << 28U)|
    (uint32)((uint32)emif_wait_pin0 << 16U)|
    (uint32)((uint32)0U);

    emifREG->PMCR = (emifREG->PMCR & 0xFFFFFF00U)|
    (uint32)((uint32)0U << 2U)|
    (uint32)((uint32)emif_4_words << 1U)|
    (uint32)((uint32)0U);

    8463.S29GL256S10DHV020.pdf

    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 

  • Hello,

    The diagrams you captured for the instructions I gave you look ok.

    Please refer to section 17.4.3.2 for EMIF configuration for using async memory.

  • 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. 

    https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/820411

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

    Thanks & Warm Regards