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.

EMIF16 and NOR Flash Spansion S29GL-P

I have a TMS320C66678 on a custom board and am having trouble writing the subject NOR Flash.  It is wired according to Figure 2-2 in the EMIF16 user guide, with EMIFA[23] -> A[0] on the flash. I still haven't fully understood what the user guide means when it says "EMIFA[23:22] behave as address selects." 

We uses CE0.  Select Strobe mode is not set. It is a 16 bit flash and operates in 16 bit mode.  A scope shows CE and WE toggling at the correct times.  (It is not really easy to look at the addr lines, they are buried in one or more of the 18 planes on this board, and do not surface to any discreet components).  

I believe I can read the device.  A variable changes from 0 to FFFF when I do a read.  Can't tell what address I read from since they are all FFFF.

I cannot seem to write.  The write procedure involves writing a command sequence to addr 0x0555 and 0x02AA, then writing the desired address with the desired data. Given the address line connections, if I tell the EMIF to write 0x70000555, will the device address pins see A[23:0] = 0x000555 ?  I.e. does EMIFA[23] = 1?

Thanks for any help.

Mike

  • Hello Mike,

    The EMIF16 address mapping is explained clearly in the below threads. Please have a look.

    https://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/166642

    https://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/116583

    Regards,

    Senthil

  • Senthil,

    Thanks for the pointer, excellent information.  I think I understand now how 32 bit accesses work.  The compiler/EMIF generate the addresses and multiple accesses automatically to read/write the full 32 bits at one time. 

    What I didn't see in the posts above is what does the compiler/EMIF combination does with 16 bit accesses?  E.g. *((uint16 *)0x70000555) = 0x00AA?

    To perform a write I need to send this sequence to the part:

    &0x000555  = 0x00AA

    &0x0002AA = 0x0055

    &0x000555 = 0x00A0

    &desiredAddr = desiredData

    The consecutive command writes are not to consecutive addresses, so doing this as 32bit accesses is not going to work.  I believe that casting the address to uint16 as shown above does cause only one write access (WE goes low only once) to the external chip.  The question is how does the address mapping work with 16 bit accesses?

    Mike

  • Hi Mike,

    The 0x000555 address required by the Spansion NOR flash represents the address as it is presented at the address pins of the memory. You need to understand how the address used in you software is presented on the external address lines as they are connected to the memory. I'll try to show that below.

    Addresses

    Program                   EMIF_Ax                           16bit Memory

    A3                            EMIF_A1                           A2                            

    A2                            EMIF_A0                           A1                   EMIF_A0 is always associated with a 32bit word boundary.

    A1                            EMIF_A23                         A0                   EMIF_A23 is used as the LSB of a 16bit bus memory address

    A0                            n/a                                    n/a                   The byte address of the program address is not used externally

                                                                                                         by a 16bit memory.

    Based on this you would need to use the sequence below.

    *((uint16 *)0x70000AAA) = 0x00AA

    *((uint16 *)0x70000554) = 0x0055

    *((uint16 *)0x70000AAA) = 0x00A0

    Regards, 

    Bill

  • Perfect, thank you.  The mapping from program to external address lines is exactly what I needed. 

    So using 16 bit accesses such that there is only 1 access externally (instead of 2 with 32 bit accesses) and shifting the address up 1 bit works fine. Thanks again for the help.

    P.s.  Two quick tables like this in the user guide (1 for 16 bit, the other for 8 bit)  would go a long way to explaining exactly how the addressing works, if you guys are ever in that documentation again.  Maybe I'm just dense, but saying that "EMIFA[23:22] act as address selects" doesn't describe the situation to me at all.

    Mike

  • Hi Mike,

    I'm glad that worked for you. I'll add the information to the users guide the next time it is updated. You can find a link at the bottom of the document labeled 'Submit Documentation Feedback'. In future, you can click on that link and provide suggestions directly if there is something that needs attention. These submissions must be reviewed before the document is update so it's a convenient way be sure the suggestion isn't lost. If you've had your issue addressed on E2E, you can include a link to the E2E post in that submission.

    Regards,

    Bill

  • Well, it works until I try and access the upper half of the flash. Then it seems to wrap to address 0.
    The upper half of the address range starts at 0x800000. To access this, I need to do

    *((uint16 *)0x71000000) = 0xaaaa

    which should map back to the external memory address 0x800000, but either the compiler or the EMIF hardware looks like it is dropping the upper bit before is gets there. I'm not nearly familiar enough with C6000 assembler to be able to tell if the compiler is doing it. Is there a way to access addresses with the uppermost bit set?

    Mike
  • Never mind. It is working fine. Dumb user error. Sigh.
    Mike