How to write into Flash Memory (JS28F640 J3D75)?

Sebastian Huber sebastian.huber at
Tue Oct 19 06:54:25 UTC 2010

On 10/18/2010 03:15 PM, Detlef Rudolph wrote:
> 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).

>  - 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.

>  - 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

> 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 at
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

More information about the users mailing list