writing to SDRAM problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

writing to SDRAM problem

3,595 次查看
wmunlai
Contributor I
Hi,
we have a board with MCF5235 coldfire connected to a
128Mbit Sdram (ELPIDA EDS1216AGTA 8M words x 16 bit) chip. It is connected with the
following configurations:
16-bit Port,9-Column Address
MCF5235 Pin - A16 A15 A14 A13 A12 A11 A10 A9  A18 A19 A20 A21  A22  A23
SDRAM Pin   - A0    A1   A2   A3   A4   A5   A6   A7  A8   A9   A10 A11  BA0  BA1
where BA0,BA1 are the Bank Select Addresses
 
We currently face a problem when reading and writing to SDRAM using the  Pemicro ICDCFZ_PRO BDM debugger.
 
We have configured the SDRAM memory space to start from 0x10000000 to 0x10FFFFFF.
We have no problem reading and writing to the first half of that memory space (0x10000000 to 0x107fffff).
But when we try to write to to the 2nd half of that memory space(0x10800000 to 0x10ffffff), this is what happened:
 
when we write a byte to 0x10800000, another location 0x10800008 gets written with the same value.
 when we write a byte to 0x10800001, another location 0x10800009 gets written with the same value.
 when we write a byte to 0x10800002, another location 0x1080000A gets written with the same value.
 when we write a byte to 0x10800003, another location 0x1080000B gets written with the same value.
 when we write a byte to 0x10800004, another location 0x1080000C gets written with the same value.
 when we write a byte to 0x10800005, another location 0x1080000D gets written with the same value.
 when we write a byte to 0x10800006, another location 0x1080000E gets written with the same value.
 when we write a byte to 0x10800007, another location 0x1080000F gets written with the same value.
 when we write a byte to 0x10800008, another location 0x10800000 gets written with the same value.
 when we write a byte to 0x10800009, another location 0x10800001 gets written with the same value.
when we write a byte to 0x1080000A, another location 0x10800002 gets written with the same value.
when we write a byte to 0x1080000B, another location 0x10800003 gets written with the same value.
when we write a byte to 0x1080000C, another location 0x10800004 gets written with the same value.
when we write a byte to 0x1080000D, another location 0x10800005 gets written with the same value.
when we write a byte to 0x1080000E, another location 0x10800006 gets written with the same value.
when we write a byte to 0x1080000F, another location 0x10800007 gets written with the same value.
when we write a byte to 0x10800010, another location 0x10800018 gets written with the same value.
....... and so on.......
 
This problem seems to appear only on the 2nd half of the SDRAM memory space. We are puzzled as to what could have caused it to behave this way. Hope someone could give us some answers.
 
Thanks in advance!
Mun Lai
 
标签 (1)
0 项奖励
回复
5 回复数

1,397 次查看
wmunlai
Contributor I
Hi,
 
we found the problem.....it was because of a wrong wiring!
 
Thanks for all advice given!
 
Mun Lai
0 项奖励
回复

1,397 次查看
Edison_Tran
Contributor I

Hi Mun Lai

 

I'm facing the same problem as yours. When I write to one location, the location offset by 200 hex also be updated. 

for example, write to 0x40000000 with value 12 causes the location 0x40000200 updated with 12

 

You have mentioned you have the wiring problem, can you tell me which wrong wires cause that problem ?

 

Thank you.

Edison.

0 项奖励
回复

1,397 次查看
wmunlai
Contributor I
Hi,
 
We are still unable to solve the problem. We have tried everything we can think of. If register settings are wrong, why does it affect only the 2nd half of SDRAM memory space?
 
Hope someone can advise us.
 
here is a script we have used :
 
;;;;;;;;Clock module Chapter 7
;Crystal Frequency = 13.56MHz
;Sets the Core Frequency = 10 * 13.56MHz =135.6MHz
;Internal Bus Frequency = 75MHz
MM.L 0x40120000 0x03000000
DELAY 100
;;;;;;;;GPIO module Chapter 12
;A[23:21] pin configured for address bit 23-21
;D[15:0] pins configured for data 15-0 functions
MM.B 0x40100040 0xE0
;Only CS1 pin is configured for CS function
;The rest of CS pins are used for GPIO functions
MM.B 0x40100045 0x02
;SD_WE pin configured for SDRAMC WE function
;SD_CAS pin configured for SDRAMC CAS function
;SD_SRAS pin configured for SDRAMC SRAS function
;SD_CKE pin configured for SDRAMC CKE function
;SD_CS pin configured for SDRAMC CS function
;CS2 abd CS3 are NOT configured for SDRAMC function
MM.B 0x40100046 0x3F 
 
;;;;;;;;;; SDRAM module Chapter 18
;Refresh Timing = 6 clocks
;Refresh Count = 0x42
MM.W 0x40000040 0x0242
 
;set RAM base address to 0x10000000
;CBM set to 3
;CASL set to bit value 01
;set Port Size 32 bit
MM.L 0x40000048 0x10001320
;set RAM base address mask to allow for 16M range
;set bit V to initialize registers controlling DRAM block
MM.L 0x4000004C 0x00fc0001 
;set IP bit to initiate Precharge All command
MM.L 0x40000048 0x10001328
;DELAY 10

; Write to SDRAM to initiate precharge
MM.w 0x10800000 0xA596
; Turn On Refresh Enable bit
MM.L 0x40000048 0x10009328
;DELAY 1
;Initiate Mode Register Set command
MM.L 0x40000048 0x10009368
;Write to the SDRAM Mode Register
MM.W 0x10800200 0xA596
 
 
 
0 项奖励
回复

1,397 次查看
wmunlai
Contributor I
Correction to my previous post:
 
It seems that the problem also occurs in the 1st half of SDRAM memory space.
 
For example, if I write a byte to the last location at 0x10ffffff, the last location in 1st half of SDRAM space (at 0x107fffff) also gets written.
 
Does this look like a wiring problem to you?
0 项奖励
回复

1,397 次查看
mccPaul
Contributor I
I don't know your board, so I can't say if the settings are right or not, but you have a comment in your script that refers to a 32bit port and you say that your SDRAM is connected on a 16bit bus so you should sheck that.
 
Also, I had similar confusing issues with SDRAM using a 5282, until I realised that the cpu reset my SDRAM port size to 16 bit when booting from external flash. Only you can say if you have a wiring problem (should be easy enough to find) but there is plenty of scope for the wiring to be fine and the problem to be elsewhere!
 
Good luck.
0 项奖励
回复