how to write an image file into flash memory in linux

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.

Reply to
uresh.kuruhuri
Loading thread data ...

Into what flash memory?

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.

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.

formatting link

--
Grant Edwards                   grante             Yow!  Yow! We're going to
                                  at               a new disco!
                               visi.com
Reply to
Grant Edwards

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

Reply to
uresh.kuruhuri

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

-- Best Regards, Ulf Samuelsson snipped-for-privacy@a-t-m-e-l.com This message is intended to be my own personal view and it may or may not be shared by my employer Atmel Nordic AB

Reply to
Ulf Samuelsson

to

and

the

Do you mean ftp client? Why server?

Or a ftp client.

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

Reply to
linnix

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

Reply to
uresh.kuruhuri

skrev i meddelandet news: snipped-for-privacy@o13g2000cwo.googlegroups.com...

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.
Reply to
Ulf Samuelsson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.