2009-01-28 07:33:12 Read/Write to flash from Bluetechnix CM-BF537E
Nikolaj Fogh (UNITED KINGDOM)
Message: 68469
Hi,
I am using a Bluetechnix CM-BF537E board with 1.5R3 distribution and Xenomai for a data logging program.
Right now, I am using u-boot to execute the compiled uImage which contains the ext2 filesystem with my program in it.
However, I need to save some settings. I can't write it to a file, as the ext2 filesystem is loaded into volatile RAM. I don't need to save many settings, so I guess that it would be sufficient to be able to read and write to the last block of the flash chip. I have been fiddling around with some mtd drivers, but cannot seem to get it working. Is there any easy way of doing this?
Cheers,
Nikolaj Fogh
QuoteReplyEditDelete
2009-01-28 07:56:10 Re: Read/Write to flash from Bluetechnix CM-BF537E
Michael Hennerich (GERMANY)
Message: 68473
I wound't use an ext2 rootfs.
Please use the initramfs for your volatile rootfs (less overhead and smaller)
Then use a small jffs2 filesystem for your files that need to be preserved during power cycle.
Check this:
http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:mtd&s[]=jffs
http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:jffs
For the CM-BF537 Core module you need GPIO-assisted Flash Chip Support !!!
[*] Support non-linear mappings of flash chips
<M> CFI Flash device in physical memory map
(0x20000000) Physical start address of flash mapping
(0x0) Physical length of flash mapping
(2) Bank width in octets
<*> GPIO-assisted Flash Chip Support
-Michael
QuoteReplyEditDelete
2009-01-28 08:50:42 Re: Read/Write to flash from Bluetechnix CM-BF537E
Nikolaj Fogh (UNITED KINGDOM)
Message: 68479
Unfortunately, the 1.5R3 distribution does not contain the GPIO assisted Flash Chip support. And trunk does not contain xenomai, which I need. I will try to backport the GPIO-assisted flash chip support to the 1.5R3 kernel and see what I can do.
About the ext2 rootfs. I thought that the uImage contained an ext2 filesystem, which is then loaded into a ramdisk and mapped into a /dev/mtdblock device. Is this not right? I am a bit confused about the whole mtd layer.
What I thought about was not to create a filesystem for the settings, but just use the raw block in the flash. There must be some easy way of doing this.
QuoteReplyEditDelete
2009-01-28 14:12:55 Re: Read/Write to flash from Bluetechnix CM-BF537E
Mike Frysinger (UNITED STATES)
Message: 68488
backporting the flash driver is pretty trivial and a few people have done it ... just search the forums