how to write an image file into flash memory in linux

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

Translate This Thread From English to

Threaded View
Hello everybody,,,,

I have a task to get it done. it is to write an image file downloaded
from a http server and to load it in the FLASH memory.

how do i do this under the Linux environment using C.

Help in this regard is expected from all the peers....

Thanks in advance.

Regards,
Uresh.


Re: how to write an image file into flash memory in linux

Quoted text here. Click to load it

Into what flash memory?

Quoted text here. Click to load it

You don't need C.

1) Put the flash chip in the programmer.

2) Connect the serial port on the programmer to the PC serial
   port.

3) Set the baud rate and parity using stty.

4) Tell the programmer to load a hex file from the serial port.

5) "cat" the hex file out the serial port.

6) Push the "program" button on the programmer.

Quoted text here. Click to load it

I'm no peer, just a commoner....

But seriously, your question is so vague it's almost
meaningless. There is no chance at all you'll get a useful
answer.

http://www.catb.org/~esr/faqs/smart-questions.html

--
Grant Edwards                   grante             Yow!  Yow! We're going to
                                  at               a new disco!
We've slightly trimmed the long signature. Click to see the full one.
Re: how to write an image file into flash memory in linux
Can you elaborate? This is such a vague question.

Vividh
snipped-for-privacy@gmail.com wrote:
Quoted text here. Click to load it

Re: how to write an image file into flash memory in linux
thanks for your concern and for better clarity i shall explain the
same. plz continue to read.

we have some image files hosted in a http server. the main task is to
get an image file (may be of .jpg/.gif/.png/ etc....) downloaded and
then copy that image file into the computer's flash memory.

this has to be done in Linux 2.4 kernel based user running on a ARM
based chipset.

so this has particularly two steps....

1. first the image file is to be downloaded from the http server in the
pc.
2. Write the image file into the flash memory of the PC.

This is what is to be done.

hoping a reply from you.

thanks in advance,

regards,
uresh


Re: how to write an image file into flash memory in linux
Quoted text here. Click to load it

I think you mean the ARM...
This needs to have a flash file system running (like JFFS2)
Easiest is if you run a browser on the ARM machine
and then just save the file on the local system

If you need a program to do it, then it is probably
easier to do an ftp transfer than http transfer.
Set up your PC to be an ftp server.

A file on a flash file system is like any other file
and you can open a file for writing

Quoted text here. Click to load it



--
Best Regards,
Ulf Samuelsson
We've slightly trimmed the long signature. Click to see the full one.
Re: how to write an image file into flash memory in linux

Quoted text here. Click to load it
to
and
the

Do you mean ftp client?  Why server?

Quoted text here. Click to load it

Or a ftp client.

Quoted text here. Click to load it

If it's file based, otherwise use "/dev/kmem" for memory based flash.

Quoted text here. Click to load it


Re: how to write an image file into flash memory in linux
hello mr. ulf samuelsson,

thanks for responding.

i need to write a c program which downloads the image file from the
http server (of which the code is to be compiled with ARM tools). i
could not understand how to configure them. after downloading the image
file, we need to write that image file into the flash memory.

the arm tools are supplied in a .tar file. this file contain all the
libraries, compilers, etc for the proper compilation of the written
code. so how do we configure the arm tools to get them to work. any
idea?????? ;-?

since am a newbie in linux, how could i write a c program to download
the image file from the http server (or a ftp server). what is to be
taken care of while coding for downloading an image from the http
server as well as from a ftp server.

plz mention or suggest all that can help me in this regard.

thanks in advance.

regards,
uresh


Re: how to write an image file into flash memory in linux
Quoted text here. Click to load it

You would do better to get a basic U-boot running on your board.
U-boot is available on sourceforge.net

Using the AT91RM9200 is very easy since the bootROM on the chip
supports downloading small programs like U-boot over the serial port
and then program the flash.

Once U.Boot is running, you can give commands to U-boot over a serial port.
You then download Linux using tftp (Trivial File Transfer protocol) from
your host machine.

Your commands would look like:

tftp uImage 2100000                  # download Linux Kernel from host over
Ethernet
cp.b 2100000 c0000000            # Write Linux Kernel to flash
tftp ramdisk-http 2100000         # download ramdisk from host over Ethernet
cp.b 2100000 c0100000            # Write ramdisk to flash

----
If your linux is already running, then you should check out the wget program
which probably does what you want.
This can get the tar file, and once it is downloaded
then you can tar it into your file system.

An even better way is if you can NFS mount your host and tar from that host
to your flash file system.


--
Best Regards
Ulf at atmel dot com
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline