Skip to contentSkip to conversation

Writing data to Flash

DISCUSSION Subrahmanyam 1 participant 1 message Dec 13, 2004 1 message not in the archive Memory technology devices (MTD)

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Stephan,

Your bootloader doesn't access flash using MTD ! In such case how do you access the contents of the flash!

I'll start looking at physmap.c, If you don't mind can I ask you a question, are you also working on storing data in the flash?

I'll look into other possiblities also,

Thanks,
Subrahmanyam.

----- Original Message ----- From: "Stephan Linke" <[email protected]>
To: "Subrahmanyam" <[email protected]>; <[email protected]>
Sent: Monday, December 13, 2004 06:23 PM
Subject: RE: Writing data to Flash

Quoted 138 lines

Hi Subrahmanyam,

I can't tell you anything about tools sources or environment of your bootloader. I don't even know if it actualy uses MTD to access the flash (our bootloader doesn't).
So everything I can tell you is related to MTD drivers in linux environment. To have a first start in the mtd/maps directories I suggest locking at physmap.c which is a simple mapping that can be configured using the linux kernel configuration scripts ("make menuconfig" etc.).

About the C progam: well this program is located in the /bin directory of my linux root filesystem.
About the /dev directory: this directory belongs to the linux root directory too. you can find out a lot about this directory by reading Documentation/devices.txt
Most likely you can't use any of this in the bootloader. So you have to ask someone who knows you bootloader for more specific assistance.

Regards, Stephan Linke

Quoted 117 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Subrahmanyam
Sent: Montag, 13. Dezember 2004 13:24
To: [email protected]
Subject: Re: Writing data to Flash

Hi Stephan,

Our target board consists of a IOP80321 processor with 16mb of flash and 512mb ram which basically consists of RedHat ecos, but the basic build environment in the host side is a Monta Vista Linux OS. When we connect to the target through "minicom" tool and when red boot is in the process of booting, we basically stop the booting process by which red boot prompt appears. It is here that fis-meaning flash image system comes into effect, wherein one can create partitions. It is in this context that I have thought of to load the key into the flash. Is this approach correct or not!

You have said that you create a new flash mapping file in mtd/maps directory, can you please suggest a method by which I can proceed. I have looked into the mtd/maps directory in which there are number of files, please suggest which file is the one I have to start with, for acheiving writing data (key) to the flash, dynamically, after the target has been identified by the host.

You have said you write a C program that uses normal file access functions to read/write the data, do you load this program/file into the flash or does it reside in the target. Where exactly does the flash partition inode has to be set up in the /dev directory. How to use this mknod tool.

Kindly suggest an approach.

Thanks,
Subrahmanyam.

----- Original Message -----
From: "Stephan Linke" <[email protected]>
To: "Subrahmanyam" <[email protected]>
Sent: Monday, December 13, 2004 05:25 PM
Subject: RE: Writing data to Flash

Quoted 28 lines

Hi Subrahmanyam,

what kind of operating system do you use? Unfortunately I don't know this "fis"
tool.
It sounds like you are not working in a linux kernel environment. The way I do it I am writing a "new" flash mapping file for mtd/maps that supports the flash layout for my target system. I do run the new linux kernel
which provides the new partition layout for the flash. And then I write a new C
program that uses normal file access functions to read/write the data. The flash
partition inode. has to be set up in the /dev directory using the mknod tool. In
the Documentation directory of the linux kernel you can find the correct device
mappings for this.
How to load the data into RAM depends verry much on you operating system. If you
run linux you can simply use the ftp tool to place a copy of the file in your
filesystem. If you are runing some kind of bootloader you actualy have to read
the bootloader documentation. In that case I can be of verry little help. But
most likely there is some tftp download support you can use.

Quoted 35 lines

Regards, Stephan

Quoted 32 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Subrahmanyam
Sent: Montag, 13. Dezember 2004 11:25
To: [email protected]
Subject: Writing data to Flash

Hi Stephan,

In my target there is a Redhat ecos wherein basically I can find out the usnused & used partiitions. To store data (ex: string) in the flash firstly
I need to load the file into the RAM using the "fis load" command, thereafter I need to create a partition in the flash based on the data in the RAM using the command "fis create".

To acheive it, the first step is how exaclty should I load data into the (target's) RAM. After the data is available in the target's RAM then only I
can create a partition and store data into the flash.

Kindly suggest a suitable approach.

Thanks,
Subrahmanyam.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/