Skip to contentSkip to conversation

Howto write to flash from user space (II)

DISCUSSION [email protected] 2 participants 2 messages Oct 21, 2004 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I already read http://www.linux-mtd.infradead.org/
but I found no useful informations
How can I write directly into flash from an user space application ? I am using a SA1110 with 16MB StrataFlash.
I tried using /dev/mem but I can only read and not write to flash. I do not have any /dev/mtd* device in my /dev , why ?
Do I need to develop a driver ?
Please help me, with at least a useful link or better a sample. TIA

(sorry for the broken thread, I've lost the original message)

#1 lore raw
Quoted 2 lines · On Thu, 2004-10-21 at 11:24, [email protected] wrote:

I already read http://www.linux-mtd.infradead.org/
but I found no useful informations

There's all kinds of useful information on there... for MTD developers ;).

Quoted 1 line

How can I write directly into flash from an user space application ?

Using either /dev/mtdblock (CONFIG_MTD_BLOCK) or /dev/mtd (CONFIG_MTD_CHAR).

You might also want to look into JFFS2 if you haven't already.

Quoted 2 lines

I am using a SA1110 with 16MB StrataFlash.
I tried using /dev/mem but I can only read and not write to flash.

That's for DRAM only.

Quoted 1 line

I do not have any /dev/mtd* device in my /dev , why ?

You need to configure MTD into your kernel, and create the /dev nodes if you aren't using devfs or udev. The MAKEDEV script in the utils directory helps with that.

Quoted 1 line

Do I need to develop a driver ?

No, StrataFlash is handled by the cfi_cmdset_0001 driver (CONFIG_MTD_CFI_INTELEXT).

Also, the more information you give us, the more help we can provide. The board and flash chip types are a great start. If you are still having trouble, let us know what version of the kernel, what MTD snapshot, etc.

josh