Open main menu

DAVE Developer's Wiki β

Changes

Memory Tecnology Device (MTD)

494 bytes added, 15:33, 4 May 2015
m
UBIFS
{{InfoBoxBottom}}
{{WorkInProgress}}
= Memory Technology Devices (MTD) =
=== Command line configured MTD partitions ===
== MTD Utils ==
You can interact with the MTD subsystem using the MTD Utilities, a collection of tools that can be used to perform operations on Flash devices. For further information on this package, plese refer to http://processors.wiki.ti.com/index.php/MTD_Utilities
 
Usually the mtd-utils collection is provided as a pre-built binary package. Anyway, it can also be [http://processors.wiki.ti.com/index.php/MTD_Utilities#Target cross-compiled] for the specific target.
== UBI ==
The Journaled Flash File System v.2 provides non-volatile storing and compression of data on flash devices. For more details about is please see http://www.linux-mtd.infradead.org/doc/jffs2.html. It can be a good choice for not too big flash partitions (as a reference, not bigger than 128 MByte).
Lets Let's assume the MTD partition associated to the NAND flash is mapped as number 5. Please note that the same technique can be used with the NOR Flash partitions.
Let’s assume we run the kernel by using the [[Booting_Linux_Kernel#Configuration_net_nfs|net_nfs configuration]]. From the target shell, run
For more information on UBIFS, please refer to http://www.linux-mtd.infradead.org/doc/ubifs.html
The default Let's assume the MTD partition associated to the NAND flash is mapped as number 4. Let’s assume X and that we run the kernel by using the [[Booting_Linux_Kernel#Configuration_net_nfs|net_nfs configuration]].
To access and use UBIFS:
* Add the ubi.mtd=X parameter to the kernel command line, where X is the number of the mtd partition
* Erase the MTD partition:
<pre class="board-terminal">
flash_eraseall /dev/mtdX
</pre>
* As an alternative to point 1, launch Launch the following commandto create the UBI volume:
<pre class="board-terminal">
ubiattach /dev/ubi_ctrl -m X
* To mount the UBI file system as root file system, the binding between MTD and UBI must be specified from the kernel command line, adding the following parameters:
<pre class="board-terminal">
ubi.mtd=6 X root=ubi0_0 rootfstype=ubifs rw
</pre>
# the file system is formatted automatically the first time it is mounted
# the mount command don't use the /dev/ prefix before ubi0_0 device
 
== Additional information ==
 
* http://free-electrons.com/blog/managing-flash-storage-with-linux/