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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-21-2011, 03:45 AM
|
#1
|
Member
Registered: Jun 2009
Posts: 36
Rep:
|
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
|
|
|
02-22-2011, 02:39 PM
|
#2
|
Senior Member
Registered: Apr 2009
Posts: 1,900
Rep: 
|
If you pass correct MTD information, you can save kernel image at any position.
|
|
|
02-23-2011, 05:24 AM
|
#3
|
Member
Registered: Jun 2009
Posts: 36
Original Poster
Rep:
|
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
|
|
|
02-23-2011, 02:24 PM
|
#4
|
Senior Member
Registered: Apr 2009
Posts: 1,900
Rep: 
|
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.
|
|
|
All times are GMT -5. The time now is 04:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|