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.

TivaC129 xnczad and External SDRAM

All,

I've read lots of forum discussion on how to attach and configure an external SDRAM to TivaC129 but now Im' really stucked.

I'll try to summarize the fundamental steps I've understood :

1) set the cmd file with a new entry like:

     SDRAM (RWX) : origin = EXRAM_BASE, length = EXRAM_SIZE

2) set the section you want to map over SDRAM:

Program.sectMap[".heapSection"] = "SDRAM";

var heapMem0Params = new HeapMem.Params();
heapMem0Params.instance.name = "heapMem0";
heapMem0Params.sectionName = ".heapSection";
heapMem0Params.size = 1024;
Program.global.heapMem0 = HeapMem.create(heapMem0Params); 

Memory.defaultHeapInstance = Program.global.heapMem0;

BIOS.heapSection = ".heapSection";

 

3) add a reset entry in order to initialize the SDRAM

var Memory = xdc.useModule('xdc.runtime.Memory');
Startup.resetFxn = "&Board_ResetFunc";

where Board_ResetFunc:

   EPIModeSet(EPI0_BASE, EPI_MODE_SDRAM);

   EPIConfigSDRAMSet(EPI0_BASE, (EPI_SDRAM_CORE_FREQ_50_100 | EPI_SDRAM_FULL_POWER | EPI_SDRAM_SIZE_64MBIT), 1024);

   EPIAddressMapSet(EPI0_BASE, EPI_ADDR_CODE_SIZE_16MB | EPI_ADDR_RAM_BASE_6 );

   EPIDividerSet(EPI0_BASE, 0);

   while(HWREG(EPI0_BASE + EPI_O_STAT) & EPI_STAT_INITSEQ) {}

The compile process is ok, and also the loading process but when I start the debugger I don't reach the main function and if I stop the debugger the PC points to and address like 0x1a00 where no code symbol are present.

Doing a step by step debug process, the Board_ResetFunc is called correctly but after that the program stuck.

 

Could someone help me to understand if I'm missing something ? 

 

Thanks in advance

Marco Crivellari

  • Reset functions execute prior to initialized variable initialization. Consequently, if any of the functions executed within a Reset function thread rely on global variables having a valid initial values, something will probably go horribly wrong.

    The Startup.firstFxns functions are called just after C environment initialization and may be better suited for your application.

    Alan