赛灵思
直播中

王秀华

7年用户 154经验值
私信 关注
[问答]

自定义板中的内存损坏

大家好。
抱歉打扰你。
我已经构建了一个基于Spartan3E 1200,16 MB Numonyx闪存和64 MB Micron ram(2 x MT48LC32M8A2)的定制板。
我在上面安装了petalinux(http://developer.petalogix.com/)。
我知道这不是寻求帮助的合适地方,但我已经在petalinux邮件列表上询问了这个问题,我开始认为这是一个EDK问题。
如果我在Linux中启动多个应用程序 - 例如snmp守护程序和tftp传输 - 内核突然崩溃抱怨内存已损坏。
如果单独启动,两个应用程序运行良
让我想到设计问题的原因是我可以在我的定制板和Xilinx Spartan3E 1600E评估板上运行相同的可执行文件(linux内核+应用程序)。
在评估板上看不到崩溃。
它们的主要区别在于使用的内存:评估板中的DDR和我定制板中的SDRAM。
我已经尝试建立一个小的调试应用程序,在microblaze启动时执行,在无限循环中一次一个字节地写入整个内存。
没有发现错误并且内存写入正确(通过jtag调试检查)。
EDK是版本9.2i和Microblaze 6.00.b.
我已尝试过不同的设置:
- 微博上没有缓存
- 带和不带多通道的sdram控制器
- 以太网
- 以太网精简版
-  opb总线@ 50 MHz
我总是经历同样的行为。
注意:我没有在momet上使用sdram反馈
我知道这个问题难以描述和理解,如果我们考虑它可能只与Linux内核有关,我想知道是否有其他人遇到类似问题或者可以建议我更多
测试尝试。
我会很高兴的。
非常感谢您的时间和精力。
朱利奥·马佐莱尼

以上来自于谷歌翻译


以下为原文

Hello everybody.
Sorry to bother you.

I have built a custom board based on Spartan3E 1200, 16 MB Numonyx flash and 64 MB Micron ram (2 x MT48LC32M8A2).
I installed petalinux on  it (http://developer.petalogix.com/). I know this is not the right place to ask for help, but  I already asked on the petalinux mailing list about thisproblem and I'm starting to think it's an EDK issue.

If I start multiple applications in Linux - snmp daemon and tftp transfer for example - the kernel suddenly crashes complaining about the memory having been corrupted.
Both applications run fine if started alone.

What makes me think about a design issue is that I can run the same executable (linux kernel + applications) on both my custom board and a Xilinx Spartan3E 1600E evaluation board.
On the evaluation board no crashes can be seen. Their main difference is in the memory used: DDR in the evaluation board and SDRAM in my custom board.

I already tried putting up a small debug application, executed at microblaze boot, to write the whole memory one byte at a time in an infinite loop. No error is found and the memory is written correctly (checked via jtag debug).

EDK is version 9.2i and Microblaze 6.00.b.

I already tried with different settings:
- no cache on microblaze
- sdram controller with and without multi-channel
- ethernet
- ethernet lite
- opb bus @ 50 MHz

I always experience the same behaviour.  

Note: I'm not using the sdram feedback at the momet

I know this problem is hard do  describe and to understand, even more if we consider the fact that it may be related just to the Linux kernel, but I would like to know if anybody else has encountered a similar problem or can suggest me some more tests to try.
I would be very glad.

Many thanks for your time and effort.

Giulio Mazzoleni

回帖(4)

陈存楼

2019-5-23 08:42:31
我终于解决了我的问题。
这是SDRAM参数设置错误的设计问题
(列宽)。
它导致RAM被不同的地址覆盖。
它没有出现在我简单的RAM测试中,因为我正在测试RAM
交替写入和读取。
写作会更有帮助
整个ram具有已知的数据序列并将其读回。
非常感谢您的帮助。
朱利奥·马佐莱尼
在原帖中查看解决方案

以上来自于谷歌翻译


以下为原文

I finally resolved my problem.

It was a design issue in an incorrect setting in SDRAM parameters
(column width).
It was causing RAM being overwritten by different adresses.

It was not showing up in my simple RAM test because I was testing RAM
alternating a write and a read. It would have been more helpful writing
the whole ram with a known sequence of data and reading it back.

Many thanks for your help.
Giulio MazzoleniView solution in original post
举报

陈存楼

2019-5-23 08:51:50
我终于解决了我的问题。
这是SDRAM参数设置错误的设计问题
(列宽)。
它导致RAM被不同的地址覆盖。
它没有出现在我简单的RAM测试中,因为我正在测试RAM
交替写入和读取。
写作会更有帮助
整个ram具有已知的数据序列并将其读回。
非常感谢您的帮助。
朱利奥·马佐莱尼

以上来自于谷歌翻译


以下为原文

I finally resolved my problem.

It was a design issue in an incorrect setting in SDRAM parameters
(column width).
It was causing RAM being overwritten by different adresses.

It was not showing up in my simple RAM test because I was testing RAM
alternating a write and a read. It would have been more helpful writing
the whole ram with a known sequence of data and reading it back.

Many thanks for your help.
Giulio Mazzoleni
举报

肖东菁

2019-5-23 08:59:45
如何从Spartan 3AN上的SDRAM开始 - 简单的应用程序将数据写入RS232上的SDRAM?

以上来自于谷歌翻译


以下为原文

How start with SDRAM on board Spartan 3AN - simple aplication read write data to SDRAM on RS232?
举报

陈存楼

2019-5-23 09:19:30
嗨至强。
我不是专家,但也许我可以给你一些提示。
希望其他更有经验的人也能回答你(如果我错了,请纠正我)。
似乎每个EDK项目都带有一些测试(用于存储器和外围设备)。
您可以在编译比特流时开始启用它们,即使它们以非交互方式运行。
我曾经和petalinux一起工作,uboot bootloader也有一些内存测试。
无论如何,要从内存中读/写,只需使用正确的内存地址即可。
*(volatile unsigned int *)MEM_ADDR
*(volatile unsigned short *)MEM_ADDR
*(volatile unsigned char *)MEM_ADDR
您可以通过观察XPS项目中的地址映射找到正确的地址。
然后,您可以修改在比特流中编译的小程序的代码。
例如:
*(volatile unsigned int *)0x8000F000 = 24;
unsigned int x = *(volatile unsigned int *)0x8000F000;
或使用适当的附件功能(in_8,in_16,in_32,out_8,out_16,out_32,具体取决于您的软件环境)。
希望得到一些帮助。
如果您想要更精确的答案,请提供更多详细信息。
朱利奥

以上来自于谷歌翻译


以下为原文

Hi xeon.
I am no expert, but maybe I can give you a few hints. Hope somebody else more experienced could answer you as well (and correct me if I am wrong).
 
It seems that every EDK project comes with a few tests (for memory and peripherals). You can start to enable them when compiling the bitstream, even if they are run in a non interactive way.
I used to work with petalinux and uboot bootloader comes with some memory tests, too.
 
Anyway, to read/write from memory it simply a matter of using the right memory address.
*(volatile unsigned int *) MEM_ADDR
*(volatile unsigned short *) MEM_ADDR
*(volatile unsigned char *) MEM_ADDR
 
You can find the correct address by watching the address map in the XPS project.
Then you can modify the code of the little program that get compiled in the bitstream.
 
For example:
*(volatile unsigned int *) 0x8000F000 = 24;
unsigned int x = *(volatile unsigned int *) 0x8000F000;
 
or using the proper accessory functions (in_8, in_16, in_32, out_8, out_16, out_32 depending of your software environment).
 
Hope to have been of some help.
Please provide a few more details if you want a more precise answer.
 
Giulio
举报

更多回帖

发帖
×
20
完善资料,
赚取积分