LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 02-21-2011, 03:45 AM   #1
_spectrum_
LQ Newbie
 
Registered: Jun 2009
Posts: 16

Rep: Reputation: 0
jffs2 and suggestions


hi all,

i have actually a custom board with Coldfire MCF5307, a 4MB flash and 16MB of sdram.

Actually linux start from a ROMFS located in the flash just after the kernel. So, bootloader load "image.bin" (kernel+romfs) into ram and execute it.

It works fine, but i cannot save anything as non-volatile.

So my idea is to create a jffs2 partition on the last megabyte of the flash, to store some sensible data.

Reading some docs, seems i have to create a jffs2 partition image file from a folder on disk. This is clear. What i don't know is that if i save then this image file on last megabyte of the flash, MTD driver is able to see it automatically at boot.

Is it a right approach ?
Anyone can suggest some links that help on how to do this better ?

regards,
angelo
 
Old 02-22-2011, 02:39 PM   #2
nini09
Member
 
Registered: Apr 2009
Posts: 991

Rep: Reputation: 67
If you pass correct MTD information, you can save kernel image at any position.
 
Old 02-23-2011, 05:24 AM   #3
_spectrum_
LQ Newbie
 
Registered: Jun 2009
Posts: 16

Original Poster
Rep: Reputation: 0
hi nini09,

many thanks, si specified a partition table in the fw, and i moved forward, now partitions are seen correctly from MTD:

Creating 3 MTD partitions on "physmap-flash":
0x000000000000-0x000000010000 : "Colilo (64K)"
mtd: Giving out device 0 to Colilo (64K)
0x000000010000-0x000000310000 : "Kernel+ROMfs (3072K)"
mtd: Giving out device 1 to Kernel+ROMfs (3072K)
0x000000310000-0x000000400000 : "JFFS2 (960K)"
mtd: Giving out device 2 to JFFS2 (960K)
physmap platform flash device: 00400000 at ffc00000

Then, from here, i created from a pc a jffs2 fs, creating the image file from a folder:

sudo mkfs.jffs2 -r flash -e 64 -o rootfs.jffs2

And written this image in the 960K partition.

But when i try to mount it i get the following error

/ # mount -t jffs2 /dev/mtdblock2 /media
MTDSB: lookup_bdev() returned 0
MTDSB: New superblock for device 2 ("JFFS2 (960K)")
jffs2: Flash size not aligned to erasesize, reducing to 0KiB
jffs2: Too few erase blocks (0)
mount: mounting /dev/mtdblock2 on /media failed: Invalid argument

any help is appreciated.

thanks
angelo
 
Old 02-23-2011, 02:24 PM   #4
nini09
Member
 
Registered: Apr 2009
Posts: 991

Rep: Reputation: 67
Different flash chip has different erase block size. Find out a correct value for your chip. The error message complain your erase block size is wrong.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shifting from Jffs2 to UBIFS sunr2007 Linux - Kernel 3 03-17-2011 07:40 AM
how to mount jffs2 nesta Linux - Kernel 1 08-24-2008 08:39 AM
Problems with CF and jffs2....... webquinty Linux - Embedded & Single-board computer 1 06-13-2008 02:22 AM
NFS and JFFS2 in 2.6.23-rc3 sandyman Linux - Networking 0 09-13-2007 07:35 AM
writing into JFFS2 filesystem Deepak Inbasekaran Programming 0 06-26-2006 03:23 AM


All times are GMT -5. The time now is 01:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration