Discussion:
How to write into Flash Memory (JS28F640 J3D75)?
Detlef Rudolph
2010-10-18 13:15:13 UTC
Permalink
Hello list members,

before I say anything else, you should know that I am a beginner
with RTEMS and driver programming.

I have a LEON3 CPU programmed in FPGA. So my RTEMS is a rtems-4.10-mingw
"ready to use" descendant included in the GRTools from Gaisler Research.

My question is how to write into a flash memory from my program
during runtime, in this case a JS28F640 J3D75. Searching for an
example, I don't find something appropriate, but many concepts,
so I don't see yet the wood for the trees.

What is the "easiest or best" way to implement R/W Access to Flash
Memory?

- Direct Access? What i have to use from RTEMS?

- or use the Non-volatile Memory Driver? Seems to be only a Template
which i have to feed to get real access?

- what of using a File System?

- have to implement Wear Leveling and PowerFailure Handling myself?
Or exists "simple solutions" for these problems?

Under what circumstances I have to recompile RTEMS?

I am grateful for any suggestions.
Many regards, Detlef

PS: Source Examples would be fantastic. ;-)
--
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
Sebastian Huber
2010-10-19 06:54:25 UTC
Permalink
Post by Detlef Rudolph
Hello list members,
before I say anything else, you should know that I am a beginner
with RTEMS and driver programming.
I have a LEON3 CPU programmed in FPGA. So my RTEMS is a rtems-4.10-mingw
"ready to use" descendant included in the GRTools from Gaisler Research.
My question is how to write into a flash memory from my program
during runtime, in this case a JS28F640 J3D75. Searching for an
example, I don't find something appropriate, but many concepts,
so I don't see yet the wood for the trees.
What is the "easiest or best" way to implement R/W Access to Flash
Memory?
- Direct Access? What i have to use from RTEMS?
Unfortunately we have no general infrastructure for flash devices (like MTD in
Linux). Mostly this is BSP specific. There is some support for the bdbuf
block device cache (see cpukit/libblock/src/flashdisk.c).
Post by Detlef Rudolph
- or use the Non-volatile Memory Driver? Seems to be only a Template
which i have to feed to get real access?
- what of using a File System?
You may add a bdbuf based driver for your flash and then you can use FAT or RFS.
Post by Detlef Rudolph
- have to implement Wear Leveling and PowerFailure Handling myself?
Or exists "simple solutions" for these problems?
There exists no simple solution for this problem at all. If you look at the
various flash file systems supported by Linux you see that this problem is by
no means successfully solved. There are some posts related to this topic on
the RTEMS list. Maybe it is worth to evaluate JFFS2 and UFFS
(http://sites.google.com/site/gouffs/).
Post by Detlef Rudolph
Under what circumstances I have to recompile RTEMS?
I am grateful for any suggestions.
Many regards, Detlef
PS: Source Examples would be fantastic. ;-)
--
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail : sebastian.huber-L1vi/***@public.gmane.org
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Mick Davis
2010-10-19 07:22:07 UTC
Permalink
Hi Detlef

For NOR flash devices, take a look at RTEMS' flash disk driver, which
will implement a filesystem for you.

The RTEMS filesystem is described in

http://wiki.rtems.org/wiki/index.php/RTEMS_File_System

which provides an example application that includes a flash device.

The source provides some more notes;

cpukit/libblock/src/flashdisk.c
c/src/libchip/flash/am29lv160.c
Post by Detlef Rudolph
Hello list members,
before I say anything else, you should know that I am a beginner
with RTEMS and driver programming.
I have a LEON3 CPU programmed in FPGA. So my RTEMS is a rtems-4.10-mingw
"ready to use" descendant included in the GRTools from Gaisler Research.
My question is how to write into a flash memory from my program
during runtime, in this case a JS28F640 J3D75. Searching for an
example, I don't find something appropriate, but many concepts,
so I don't see yet the wood for the trees.
What is the "easiest or best" way to implement R/W Access to Flash
Memory?
- Direct Access? What i have to use from RTEMS?
- or use the Non-volatile Memory Driver? Seems to be only a Template
which i have to feed to get real access?
- what of using a File System?
- have to implement Wear Leveling and PowerFailure Handling myself?
Or exists "simple solutions" for these problems?
Under what circumstances I have to recompile RTEMS?
I am grateful for any suggestions.
Many regards, Detlef
PS: Source Examples would be fantastic. ;-)
--
Mick Davis
Goanna Technologies Pty Ltd
+61 8 9444 2634

"Shock your lizard today!"
Continue reading on narkive:
Loading...