AnsweredAssumed Answered

K66F, 16-bit SDRAM, 16-bit FLEXBUS

Question asked by Christie Su on Dec 4, 2017
Latest reply on Dec 11, 2017 by xiangjun.rong

Hi,

 

I am using K66F with 16-bit SDRAM, 16-bit external flash on FLEXBUS and have the following questions:

1) I configure flexbus and SDRAM to 16-bit port, and using KDS 3.2.0

2) When I am trying to read external flash on FLEXBUS, it works fine with 32-bit access

sdram_pointer = (UINT16*)(0x61EE0000);

PRINTF("\r\nINIT_30=0x%x_0x%x", sdram_pointer, *((UINT32*)(sdram_pointer)));

I get 0x12345678 because external flash is programmed as 0x12345678

3) When I access SDRAM with 32-bit access, I got 0x12341234 as following code:

sdram_pointer = (UINT16*)(SDRAM_START_ADDRESS + 0x00800000); // SDRAM_START_ADDRESS defined on fsl_sdram.h

*((UINT32*)(sdram_pointer)) = 0x12345678;

PRINTF("\r\nINIT_31=0x%x_0x%x", sdram_pointer, *((UINT16*)(sdram_pointer)));

3) When I access SDRAM with 32-bit access, I got 0x1234, 0x5678 as following code:

sdram_pointer = (UINT16*)(SDRAM_START_ADDRESS + 0x00800000); // SDRAM_START_ADDRESS defined on fsl_sdram.h

*((UINT16*)(sdram_pointer)) = 0x1234;

*((UINT16*)(sdram_pointer+1)) = 0x5678;

PRINTF("\r\nINIT_31=0x%x_0x%x_0x%x", sdram_pointer, *((UINT16*)(sdram_pointer)), *((UINT16*)(sdram_pointer+1)));

 

Looks like it works with 16-bit access, not 32-bit access on SDRAM, but it works fine with 16-bit and 32-bit on FLEXBUS...

Could you tell me where the problem is on SDRAM?

Can  I run program in 16-bit SDRAM and hot to configure for it?

 

Thanks,

Christie

 

 

 

Outcomes