Part Number: 66AK2G12
Hello,
I am using CCS 10.4 and TI-RTOS with a custom board having a K2G and 512MB of DDR3. Most of our device initialization firmware uses the same code as the evmK2G examples. I've discovered a curious behavior with DDR3 initialization and would like to understand its origin and purpose.
I am using the CCS Debugger. I have written a small program that runs on the A15 core and resides entirely in internal L2 (MSMC) RAM (including stack, heap, and all variables). This program reads and writes a large buffer that I have positioned at the start of external L3 (DDR3) RAM, at address 0x80000000.
Here is the sequence of steps to produce the behavior.
1. Load the program into the target. The DDR3 section containing the large buffer is marked "NOLOAD" in the linker script, so nothing is loaded into the DDR3 buffer during this step. This step runs the evmk2g_arm.gel script, which initializes the EMIF controller (among other things). The debugger is set to Run to main().
2. Fill the DDR3 buffer with all zeros (0x00000000). I've discovered this can be done either from firmware, or from the Memory Browser window.
3. Start single-stepping the program from main(). The first function to execute is Board_init(), as shown in the below code:
#include "board/board.h"
int main()
{
Board_initCfg boardCfg;
boardCfg = BOARD_INIT_PLL |
BOARD_INIT_MODULE_CLOCK |
BOARD_INIT_DDR |
BOARD_INIT_PINMUX_CONFIG;
Board_init(boardCfg);
return 0;
}
Although the PLLs, clocks, and DDR were all configured in the GEL script, they are all re-configured in Board_init(). (I don't think this has any bearing on the behavior I'm seeing.)
4. Step into Board_init(), and continue stepping until reaching function Board_DDR3Init() in file ${PDK_INSTALL_DIR}/packages/ti/board/src/evmK2G/evmK2G_ddr.c.
5. With the Memory Browser window open to address 0x80000000, I can confirm that the buffer is still filled with zeros.
6. If I now step OVER function Board_DDR3Init(), the Memory browser shows that the first 64 bytes of DDR3 (the start of my large buffer) has been overwritten with the following pattern.

Further experimentation has shown that the same behavior occurs within the GEL script, too.
I would like to understand the source of this phenomenon, so I can have assurance that my data will not be overwritten at an inconvenient time.
Thank you.