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.

.bss -> EMIF SDRAM

Other Parts Discussed in Thread: HALCOGEN

Hi!
I want to run .bss section on the SDRAM of the RM48 board.
The uC is RM48L952LWTT.
The SDRAM is ISSI IS42S16400F http://www.issi.com/pdf/42S16400F.pdf.
Softs : HALCOEN v3.05 and CSSV5

What i've done :

/* Linker Settings                                                            */
--retain="*(.intvecs)"

/*----------------------------------------------------------------------------*/
/* Memory Map                                                                 */
MEMORY{
    VECTORS (X)  : origin=0x00000000 length=0x00000020
    FLASH0  (RX) : origin=0x00000020 length=0x0017FFE0
    FLASH1  (RX) : origin=0x00180000 length=0x00180000
    STACKS  (RW) : origin=0x08000000 length=0x00001500
    RAM     (RW) : origin=0x08001500 length=0x0003EB00
    SDRAM    (RW) : origin=0x80000000 length=0x00800000
}

/*----------------------------------------------------------------------------*/
/* Section Configuration                                                      */
SECTIONS{
    .intvecs : {} > VECTORS
    .text    : {} > FLASH0 | FLASH1
    .const   : {} > FLASH0 | FLASH1
    .cinit   : {} > FLASH0 | FLASH1
    .pinit   : {} > FLASH0 | FLASH1
    .bss     : {} > SDRAM
    .data    : {} > RAM
    .sysmem  : {} > RAM
}

In halcogen (linked in .zip) :
driver EMIF enabled
Emif_clk = 100 MHz
trc = 63ns
trp = trcd = twr = 20ns
tras = 42ns
trc = 63 ns
trrd = 14ns
txsr = 75ns (?)
refresh period = 64ms
refresh cycles = 4096
cas = 2
banks = 4
page size = 1024
PINMUX checkbox EMIF enabled (=> conflict on ball D17 between EMIF_nWE and EMIF_RNW)

What i have :
global variables have a strange behaviour (always NULL or with a value which never change).

1- Txsr is not referenced in the datasheet, what should be its value?
2- Where does emif_SDRAMInit() should be called? (for .bss section, then before global declarations).
3- What is the maximal frequency for Emif_clk?
4- And do you have and idea about my problem?
5- Maybe the conflict on ball D17 (pinmux)?

Thanks a lot, king regards!
Pierre.

Bench_FFT.zip
  • Do you have an example project with BSS in external memory?

  • Hi,

    I have forwarded you thread to an expert in the team. They will be responding shortly.

    - Forum support

  • Hi Pierre,

    1- Txsr is not referenced in the datasheet, what should be its value?

    >> This is mentioned in the "SELF REFRESH" section of the SDRAM datasheet to be the same as trc.

    2- Where does emif_SDRAMInit() should be called? (for .bss section, then before global declarations).

    >> You need accesses to the .bss memory region defined before performing initialization of global / static variables.

    3- What is the maximal frequency for Emif_clk?

    >> 100MHz for EMIF_CLK is not supported. Maximum EMIF_CLK frequency specified is 66.67MHz.

    5- Maybe the conflict on ball D17 (pinmux)?

    >> The multiplexing on D17 allows you to use this terminal either as a write-enable (nWE) or as a combined RnW (Read when '1, Write when '0') signal. This SDRAM requires a nWE signal, so you do not need to change the multiplexer configuration for D17.

    Please slow down the EMIF_CLK frequency by slowing down the VCLK3 domain frequency. Let me know if this helps.

    Regards, Sunil

  • Thanks Sunil! I tried with VCLK3=66.67MHz, then with 10MHz (=> Twr = 200ns). Still the same problems.

    In sys_startup.c if I call emif_SDRAMInit() after systemInit(), variables in SDRAM are null. If call enif_SDRAMInit() before systemInit(), variables in SDRAM = 0x009C009C (?!?!?)

    About software, do I have to do anything else than calling emif_SDRAMInit() to make SDRAM work? Is there a process to read/write (I don't know, considering timing or parsing data)? Do I have to run other init (setting all SDRAM's bit to 0)?

    About hardware, Is the SDRAM 1024-page-sized? The datasheet says that, whereas several forum-topic specify 256. Is there an other driver than EMIF which should be enabled?

    Do I have to enable some interrupts?

  • I "up" this topic.

    Can you help me please?

    Regards and thanks,

    Pierre.

  • Pierre,

    Some EMIF signals are multiplexed with other functions. These need to be configured correctly for the EMIF functions to be output on the assigned terminals. HALCoGen will generate this code for you when you configure the PINMUX tab. Also, there are 8 EMIF outputs that are gated off using the system module GPREG1 register bit 31. You need to set this bit for those 8 EMIF signals to be output on the assigned terminals.

    No interrupts are necessary to be able to use the EMIF.

    Regards, Sunil

  • I really don't know what to do, variables in .bss (i tried with sections .sysmem and . const too) are still null.
    In CCS, register GPREG1 = 0x805FFFFF

    In Halcogen 3.05 :

    Vclk3 = Emif_clk = 55MHz.
    driver EMIF enabled
    trc = 63ns
    trp = trcd = 20ns
    twr = 37 ns
    tras = 49ns
    trc = 63ns
    trrd = 14ns
    txsr = 63ns
    refresh period = 64ms
    refresh cycles = 4096
    cas = 2
    banks = 4
    page size = 256
    PINMUX : checkbox "EMIF" enabled
    , "Gate off EMIF_clk" disabled.

    In CCSV5 :

    I call emif_SDRAMInit() and set 31th bit of GPREG1 in sys_startup.c, just after systemInit() (but the result is the same when i call this in main() ), where muxInit() is called :
    emif_SDRAMInit();
    systemREG1->GPREG1 |= (unsigned int)(1<<31);

    I also tried to set PIMMR29[8] but nothing changed (also, the register doesnt seem to change). Thanks to p.222 of http://www.ti.com/lit/ug/spnu503a/spnu503a.pdf :

    • EMIF_CLK Control:
    PINMMR29[8] is set by default. This is used to block the EMIF_CLK from being output from the
    microcontroller. If the EMIF is used to connect to an external SDRAM module, then the application must
    enable the EMIF_CLK output by clearing the PINMMR29[8] bit.

  • For the benefit of those arriving at this dead thread via a web search:

    "To enable write access to the PINMMRs, the CPU must write 0x83e70b13 to the kick0 register followed by a write of 0x95a4f1e0 to the kick1 register."

    Those magic values may be different for your hardware so check your documentation.