BF514 SDRAM odd memory address problem

Hello,

I've got a problem with with my SDRAM.  I've allocated some space in the SDRAM, I run through a for loop where I write 50 values to sequential memory and then read them back out.  The even memory addresses write/read back the number I expect, but the odd memory addresses do not.  Has anyone seen anything like this?

Here are some of the details of my configuration:

Hardware:

I'm using the BF514F and a 32MB SDRAM MT48LC32M8A2P.

SDRAM -

  • Configuration - 8 Meg x 8 x 4 banks
  • Row addressing - 8K A[12:0]
  • Bank addressing - 4 BA[1:0]
  • Column addressing - 1K A[9:0]

Memory initialization in the .ldf:

      sdram0_bank2

      {

         INPUT_SECTION_ALIGN(4)

         // ... (more statements, but removed for this posting)

         INPUT_SECTIONS($OBJECTS(mem_test))                               //Memory I've defined

      } > MEM_SDRAM0_BANK2

SDRAM register initialization

void InitializeSDRAM()
{

    //Initialize registers to enable use of sdram

    *pEBIU_SDRRC  = 800;
    *pEBIU_SDGCTL = 0x0492998D;

    *pEBIU_SDBCTL = 0x23;     
    printf(" -> SDRAM Initialized ... \n");

}

Test Code

section("mem_test") unsigned char memTest4[500];

void TestMem()

{

int i;

int ctr=0;

printf("memory test\n");

for(i=0; i<50; i++)

{

  memTest4[i] = i;

  ctr++;

}

for(i=0; i<50; i++)

{

  printf("(0x%x, %d, %d), \n", &memTest4[i], i, memTest4[i]);

}

printf("\n");

}

Test Results

memory test

(0x1000000, 0, 0),

(0x1000001, 1, 49),

(0x1000002, 2, 2),

(0x1000003, 3, 49),

(0x1000004, 4, 4),

(0x1000005, 5, 49),

(0x1000006, 6, 6),

(0x1000007, 7, 49),

(0x1000008, 8, 8),

(0x1000009, 9, 49),

...

(0x1000029, 41, 49),

(0x100002a, 42, 42),

(0x100002b, 43, 49),

(0x100002c, 44, 44),

(0x100002d, 45, 49),

(0x100002e, 46, 46),

(0x100002f, 47, 49),

(0x1000030, 48, 48),

(0x1000031, 49, 49),

..End test results

 

In the results, the hex number is the memory address, followed by the index of the memory array, followed by the data value read from the array/memory.  The index and the number read should be the same.  Why do all odd memory locations show the number written to the last odd memory location (49)?

Does anyone have any idea as to what would cause this???  I've double checked our schematic and it appears that all the pins are hooked up according to the data sheet.

 

Thanks for any insight,

Patrick

  • 0
    •  Analog Employees 
    on Apr 15, 2012 10:07 PM

    Hi Patrick,

    Are you using single chip of that SDRAM part in your system? If yes, note that, it is an 8-bit wide memory and Blackfin does not directly support 8bit addressing . Refer the "SDRAM Configurations Supported" section in BF51x HRM on p7-25.

    you should have use 16-bit wide memory part, like the one we have on BF518 EZ-KIT. If you want to use MT48LC32M8A2P part only, you should have two such parts connected to Blackfin SDC, as shown in BF537 EZ-KIT schematic.

    The SDQM[1:0] (SDC data masks) pin can be used to access 8-bit words from memory system, (it allows masked 8-bit I/O writes to dedicated chip and the other 8-bit I/O is masked at its input buffer of the other chip).

  • Just as a follow up to this posting, we did replace the SDRAM with a 16 bit wide and the problem is fixed. Thanks a bunch!

    Patrick