Segger file system and SDRAM

I am working with an LPC2478 and the Segger file system and an IAR IDE. I am having trouble getting the file system to work out of SDRAM. It works fine from on chip RAM. The SDRAM even passes a memory check. But when I try to open a file with the Segger file system using SDRAM, at one point in the execution a function that is accessed by pointer goes bad.

Any thoughts greatly appreciated.

--------------------------------------- Posted through

formatting link

Reply to
bikerdan
Loading thread data ...

Op Tue, 25 Jan 2011 13:43:48 +0100 schreef bikerdan :

What makes you think that we are more suited to solve this problem than the Technical Support department of your Segger distributor and/or Segger itself?

--
Gemaakt met Opera's revolutionaire e-mailprogramma:  
http://www.opera.com/mail/
Reply to
Boudewijn Dijkstra

I

works

Excellent question. I think that because they were unable to solve the problem after two weeks of troubleshooting. I was finally able to solve the problem myself. It turned out that there were some functions in the Segger source code that were called by pointer. Those pointers were in initialized RAM. If you didn't know that (and I didn't) then when you set the linker to put variables in external SDRAM the initialized pointers got whacked. A single line in the linker file putting all initialized RAM in the internal chip RAM fixed the problem. It's surprising to me that Segger tech support had not run across that already but they never suggested to me that it could be a linker problem.

--------------------------------------- Posted through

formatting link

Reply to
bikerdan

I don't think it is surprising that the tech support people hadn't come across the problem. If they deliver C code, then it will be tested to work in a normal C environment. That means it assumes that the data section is initialised on startup, and the bss section is clearer. If you mess about with linker arrangements to put the data and/or bss sections somewhere your tools don't expect, then it is up to you to ensure that these are initialised properly.

If you have moved the bss section (or part of it) to external ram, make sure that you are correctly zeroing it at startup - otherwise you might find some unpredictable problems later on.

Reply to
David Brown

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.