Running code out of RAM

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
We are in the process of writing code to execut out of SDRAM for the first
time in an upcoming project. Until now all our systems executed code out of
eprom or flash. However we need the speed that comes with running out of
SDRAM but are concerned about SDRAM reliability issues and the possbility of
rouge pointers corrupting SDRAM. Any RAM corruption will cause down time and
reliability issues in our systems but will not kill anybody. Has this been a
concern for anybody and if so how have you handled it?

Thanks.



Re: Running code out of RAM

Quoted text here. Click to load it

Even if you're code is in ROM, I presume you're used to have
data and stack in RAM, right?  

Quoted text here. Click to load it

Just as it would have with code in ROM.

Quoted text here. Click to load it

Same as with code in ROM: pay attention to what you're doing
during design and coding -- then test your software.

--
Grant Edwards                   grante             Yow!  How many retired
                                  at               bricklayers from FLORIDA
We've slightly trimmed the long signature. Click to see the full one.
Re: Running code out of RAM
wrote in comp.arch.embedded:

Quoted text here. Click to load it

In addition to what Grant said, you can (and probably should) test
your image in RAM.

Use your development tools to separate writeable sections (initialized
variable data, stack space, uninitialized data, etc.) from
non-writable sections (code, constant data), that is the ones that are
still in EPROM or flash right now.

At system start up, when your initialization code copies the code and
constant sections from original storage to SDRAM, compute some soft of
checksum or CRC on the image.  Then have a background task
periodically repeat this calculation.  If the background task finds
that the image area has been changed, it should lock the system in
some sort of fail safe condition and indicate the reason.

--
Jack Klein
Home: http://JK-Technology.Com
We've slightly trimmed the long signature. Click to see the full one.
Re: Running code out of RAM

Quoted text here. Click to load it

Some CPUs have memory protection hardware, so that you can make
sections of memory read-only.  If this capability exists it's well
worth using it; and you can catch hardware exceptions when these
illegal writes occur in order to detect the culprits.

There are also poor man's memory protection methods as well, where
write enable lines to the RAM pass through a GPIO gateway (with some
address logic as well).

--
Darin Johnson
    "Look here.  There's a crop circle in my ficus!"  -- The Tick

Re: Running code out of RAM
wrote in comp.arch.embedded:

Quoted text here. Click to load it

But none of these features provides any protection against soft errors
or actual RAM hardware errors.  With any type of DRAM, in particular,
it pays to be careful.

--
Jack Klein
Home: http://JK-Technology.Com
We've slightly trimmed the long signature. Click to see the full one.
Re: Running code out of RAM

Quoted text here. Click to load it

Since the original code is in (((E)E)P)ROM, why not just copy it from
ROM to RAM at frequent intervals ? Some simple memory word parity
could be used to trigger the copying operation in addition to the
periodic copying. Frequent copying (in order to avoid more than one
SEU in a memory word) should not be a problem compared to RAM CRC
calculations, unless the RAM:ROM speed ratio is larger than 10:1.

If you do not have a reliable code backup copy in the system, then
using ECC RAM and frequently reading and writing back (with corrected
memory words and ECC bits) every memory word should largely prevent
the formation of two or more bit errors in the same word, which would
not be correctable.

Paul


Re: Running code out of RAM
Quoted text here. Click to load it

Broken code is broken code, whereever it runs.

Buffers should always be checked for overruns.
If you are concerned, I think a code review is
in order.



Re: Running code out of RAM

Quoted text here. Click to load it

Are you worried about the actual reliability of RAM vs. ROM or do
you suspect that you have buggy code that is rying to overwrite
program memory and failing because it it read-only?


--
Guy Macon, Electronics Engineer & Project Manager for hire.
Remember Doc Brown from the _Back to the Future_ movies? Do you
We've slightly trimmed the long signature. Click to see the full one.
Re: Running code out of RAM
Actually both. As most of the postings have indicated, buggy code has to be
dealt with through better development and testing processes but what are
your views on RAM reliability?

Thanks


"Guy Macon" <http://www.guymacon.com wrote in message
Quoted text here. Click to load it
first
of
of
and
been a



Re: Running code out of RAM


Quoted text here. Click to load it

Very reliable.  


Re: Running code out of RAM

Quoted text here. Click to load it

Unless the device is working in some extreme conditions, RAM
reliability would never be an issue. You're more likely to have a
dicky power supply or ill-designed power-down circuitry.

Ken.

Quoted text here. Click to load it


+====================================+
I hate junk email. Please direct any
genuine email to: kenlee at hotpop.com

OT: Power supply reliability

Quoted text here. Click to load it
be
Interesting that you should say this as I've had three pieces of "consumer
kit" (firewall, router, external disc drive) all fail because of power
supply circuit problems recently. I suspect that the power supply tends to
get forgotten in a lot of designs (reference designs from which they are
derived tending to be "the logic" and the power supply an afterthought).

    Andrew




Re: OT: Power supply reliability

Quoted text here. Click to load it

These people make good power supplies:
http://www.pcpowerandcooling.com/home.htm


--
Guy Macon, Electronics Engineer & Project Manager for hire.
Remember Doc Brown from the _Back to the Future_ movies? Do you
We've slightly trimmed the long signature. Click to see the full one.
Re: OT: Power supply reliability


Quoted text here. Click to load it

These people make good power supplies:
http://www.pcpowerandcooling.com/home.htm


--
Guy Macon, Electronics Engineer & Project Manager for hire.
Remember Doc Brown from the _Back to the Future_ movies? Do you
We've slightly trimmed the long signature. Click to see the full one.
Re: Running code out of RAM
Quoted text here. Click to load it
of
of
and
a
Assuming your code is in one contiguous block of RAM, then if you are really
paranoid, you can make a debug board that monitors the address bus / write
line and generates an external interrupt on any attempt to write to the code
area.
Tanya



Re: Running code out of RAM
Quoted text here. Click to load it

The rouge problem is cured by forbidding makeup to the sisters
:-)  After that, write correct code.  About the only thing that
can harm is cosmic rays, and you can detect most of those (very
rare) events with CRC checksums over the load module, or with ECC
memory.

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
We've slightly trimmed the long signature. Click to see the full one.
Re: Running code out of RAM
Quoted text here. Click to load it

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
We've slightly trimmed the long signature. Click to see the full one.
Re: Running code out of RAM
Thank you all for some very useful suggestions. I feel a lot more
comfortable now and have some strategies to pursue.

Thanks.
Haran.

Quoted text here. Click to load it
of
of
and
a



Site Timeline