Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Modifying a JFFS2 Image
PostPosted: Sat Oct 06, 2007 8:52 pm 
Offline

Joined: Wed Feb 14, 2007 5:51 am
Posts: 10
I was going to post this to the JFFS2 mailing list, but thought I'd ask here first.

I'd like to be able to build a JFFS2 image in Dataflash, download the contents to a image using
Code:
DATAFLASH::receiveFile "fs.img" addr size


via a tcl script in SAM-BA, then mount fs.img as a JFFS2 fs on my desktop Linux machine, modify the contents a bit, save it back to the file "fs.img" and reload it using
Code:
DATAFLASH::sendFile "fs.img" addr

via a tcl script in SAM-BA.

I have the script working in that I can get the image and reload the image. I can mount the image on my desktop machine using the dd command and then mount. However, after I umount and dd the new img, once it's reloaded on the board, JFFS2 gives me errors at boot time.

I'm using the following to copy the image to a device:
Code:
sudo dd if=filesystem.dat of=/dev/mtdblock0


And the following to save the image:
Code:
sudo dd if=/dev/mtdblock0 of=filesystem.tmp count=3689 bs=1056


The image file size is 3,895,584 bytes.

Does anyone have a suggestion as to what I might be doing wrong? Should I use the same count and bs parameter values for the initial dd command?

_________________
- Coleman


Top
 Profile  
 
 Post subject: Re: Modifying a JFFS2 Image
PostPosted: Tue Dec 28, 2010 9:25 pm 
Offline

Joined: Mon Oct 26, 2009 4:44 pm
Posts: 8
bs=1056? i'm sure than that is a problem. It must be the size of an erase block from your memory, in my case using a nand flash it was bs=128k
Count is the length of the file, if you don't specify it it will copy until the end of the input file is rearched.

bs is more absolutely important when you are copying a file o the memory, but not when you are copying from the memory to a file.

Be sure that the file is into another mtdblock.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: