<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de-AT">
	<id>https://becomwiki.live.md-websolutions.com/index.php?action=history&amp;feed=atom&amp;title=Flash_memory_%28CM-i.MX27%29</id>
	<title>Flash memory (CM-i.MX27) - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://becomwiki.live.md-websolutions.com/index.php?action=history&amp;feed=atom&amp;title=Flash_memory_%28CM-i.MX27%29"/>
	<link rel="alternate" type="text/html" href="https://becomwiki.live.md-websolutions.com/index.php?title=Flash_memory_(CM-i.MX27)&amp;action=history"/>
	<updated>2026-05-13T12:46:01Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in BECOM Systems Support</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://becomwiki.live.md-websolutions.com/index.php?title=Flash_memory_(CM-i.MX27)&amp;diff=82&amp;oldid=prev</id>
		<title>Peter: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://becomwiki.live.md-websolutions.com/index.php?title=Flash_memory_(CM-i.MX27)&amp;diff=82&amp;oldid=prev"/>
		<updated>2023-10-31T08:03:06Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de-AT&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 31. Oktober 2023, 10:03 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;de-AT&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(kein Unterschied)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://becomwiki.live.md-websolutions.com/index.php?title=Flash_memory_(CM-i.MX27)&amp;diff=81&amp;oldid=prev</id>
		<title>en&gt;Peter: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://becomwiki.live.md-websolutions.com/index.php?title=Flash_memory_(CM-i.MX27)&amp;diff=81&amp;oldid=prev"/>
		<updated>2023-08-22T19:35:47Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== NAND Flash ==&lt;br /&gt;
&lt;br /&gt;
A 512 MiB flash chip is available on the core module.&lt;br /&gt;
&lt;br /&gt;
=== Test in Redboot ===&lt;br /&gt;
&lt;br /&gt;
*Load any file onto the core module over Ethernet:&lt;br /&gt;
 RedBoot&amp;gt; load -r -b 0x2100000 32MBrandomfile          &lt;br /&gt;
 Using default protocol (TFTP)&lt;br /&gt;
 Raw file loaded 0x02100000-0x040fffff, assumed entry at 0x02100000&lt;br /&gt;
*Write into flash:&lt;br /&gt;
 RedBoot&amp;gt; fis create -b 0x2100000 -l 0x2000000 nandtest&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0x00080000: ..&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0x00080000: ..&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0x00080000: ..&lt;br /&gt;
 ... Erase from 0x000a0000-0x020a0000: &lt;br /&gt;
 Erase 0x000a0000: ................................&lt;br /&gt;
 Erase 0x004a0000: ................................&lt;br /&gt;
 Erase 0x008a0000: ................................&lt;br /&gt;
 Erase 0x00ca0000: ................................&lt;br /&gt;
 Erase 0x010a0000: ................................&lt;br /&gt;
 Erase 0x014a0000: .......................&lt;br /&gt;
 Warning: nfc_erase_region(addr=0x1780000, block=188): skipping bad&lt;br /&gt;
 ........&lt;br /&gt;
 Erase 0x018a0000: ................................&lt;br /&gt;
 Erase 0x01ca0000: ................................&lt;br /&gt;
 Erase 0x020a0000: .&lt;br /&gt;
 nfc_erase_region(skip bad blocks=1&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ... Program from 0x02100000-0x04100000 at 0x000a0000: ......................................................................................................................................................................................&lt;br /&gt;
 Warning: nfc_program_region(addr=0x1780000, block=188): skipping bad&lt;br /&gt;
 .........................................................................&lt;br /&gt;
 nfc_program_region(skip bad blocks=1&lt;br /&gt;
 .&lt;br /&gt;
 ... Unlock from 0x00080000-0x000a0000: .&lt;br /&gt;
 ... Erase from 0x00080000-0x000a0000: &lt;br /&gt;
 Erase 0x00080000: .&lt;br /&gt;
 ... Program from 0x07ee0000-0x07f00000 at 0x00080000: ..&lt;br /&gt;
 ... Lock from 0x00080000-0x000a0000: .&lt;br /&gt;
*It must show up in the list of flash images now:&lt;br /&gt;
 RedBoot&amp;gt; fis list&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0x00080000: ..&lt;br /&gt;
 Name              FLASH addr  Mem addr    Length      Entry point&lt;br /&gt;
 RedBoot           0x00000000  0x00000000  0x00040000  0x00000000&lt;br /&gt;
 FIS directory     0x00080000  0x00080000  0x0001F000  0x00000000&lt;br /&gt;
 RedBoot config    0x0009F000  0x0009F000  0x00001000  0x00000000&lt;br /&gt;
 nandtest          0x000A0000  0x02100000  0x02000000  0x02100000&lt;br /&gt;
*Load from NAND flash and compare with the original:&lt;br /&gt;
 RedBoot&amp;gt; fis load -b 0x100000 nandtest&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0x00080000: ..&lt;br /&gt;
 ... Read from 0x00100000-0x02100000 at 0x000a0000: ........................................................................................................................................................................................&lt;br /&gt;
 Warning: nfc_read_region(addr=0x1780000, block=188): skipping bad&lt;br /&gt;
 ..........................................................................&lt;br /&gt;
 RedBoot&amp;gt; mcmp -s 0x100000 -d 0x2100000 -l 0x2000000&lt;br /&gt;
 RedBoot&amp;gt; &lt;br /&gt;
*Done!&lt;br /&gt;
&lt;br /&gt;
=== Update Redboot ===&lt;br /&gt;
&lt;br /&gt;
We assume you have booted Redboot. Type&lt;br /&gt;
 factive nand&lt;br /&gt;
to activate NAND flash in Redboot. Then load the new Redboot image onto the core module and run it:&lt;br /&gt;
 load -r -b 0x100000 redboot.bin&lt;br /&gt;
 run&lt;br /&gt;
Now type&lt;br /&gt;
 romupdate&lt;br /&gt;
to update Redboot in NAND flash.&lt;br /&gt;
&lt;br /&gt;
=== Update Redboot from Linux ===&lt;br /&gt;
&lt;br /&gt;
 flash_eraseall /dev/mtd4&lt;br /&gt;
 nandwrite -a -p /dev/mtd4 redboot.bin&lt;br /&gt;
&lt;br /&gt;
=== Linux: JFFS2 file system ===&lt;br /&gt;
&lt;br /&gt;
For NAND flash devices, the JFFS2 file system is recommended, because it handles bad blocks of the NAND flash correctly and transparently to the user.&lt;br /&gt;
Here&amp;#039;s how you create such a file system on the rootfs partition:&lt;br /&gt;
&lt;br /&gt;
*List the available partitions on flash chips and choose the right one (here, we have to take &amp;#039;&amp;#039;mtd5&amp;#039;&amp;#039;):&lt;br /&gt;
 root@btmxc27:~# cat /proc/mtd&lt;br /&gt;
 dev:    size   erasesize  name&lt;br /&gt;
 mtd0: 02000000 00020000 &amp;quot;mxc_nor_flash.0&amp;quot;&lt;br /&gt;
 mtd1: 00080000 00020000 &amp;quot;nand.RedBoot&amp;quot;&lt;br /&gt;
 mtd2: 0001f000 00020000 &amp;quot;nand.FIS_directory&amp;quot;&lt;br /&gt;
 mtd3: 00001000 00020000 &amp;quot;nand.RedBoot_config&amp;quot;&lt;br /&gt;
 mtd4: 00500000 00020000 &amp;quot;nand.kernel&amp;quot;&lt;br /&gt;
 mtd5: 1fa00000 00020000 &amp;quot;nand.rootfs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*Erase the partition (you have to use the char device &amp;#039;&amp;#039;/dev/mtdX&amp;#039;&amp;#039;):&lt;br /&gt;
 root@btmxc27:~# flash_eraseall  /dev/mtd5&lt;br /&gt;
 Erasing 128 Kibyte @ 1560000 --  4 % complete.&lt;br /&gt;
 Skipping bad block at 0x01580000&lt;br /&gt;
 Erasing 128 Kibyte @ 2de0000 --  9 % complete.&lt;br /&gt;
 Skipping bad block at 0x02e00000&lt;br /&gt;
 Erasing 128 Kibyte @ 151e0000 -- 66 % complete.&lt;br /&gt;
 Skipping bad block at 0x15200000&lt;br /&gt;
 Erasing 128 Kibyte @ 16b40000 -- 71 % complete.&lt;br /&gt;
 Skipping bad block at 0x16b60000&lt;br /&gt;
 Erasing 128 Kibyte @ 16fc0000 -- 72 % complete.&lt;br /&gt;
 Skipping bad block at 0x16fe0000&lt;br /&gt;
 Erasing 128 Kibyte @ 1f960000 -- 99 % complete.&lt;br /&gt;
 Skipping bad block at 0x1f980000&lt;br /&gt;
&lt;br /&gt;
 Skipping bad block at 0x1f9a0000&lt;br /&gt;
&lt;br /&gt;
 Skipping bad block at 0x1f9c0000&lt;br /&gt;
&lt;br /&gt;
 Skipping bad block at 0x1f9e0000&lt;br /&gt;
 Erasing 128 Kibyte @ 1fa00000 -- 100 % complete.&lt;br /&gt;
&lt;br /&gt;
*Now, simply mount the partition as &amp;#039;&amp;#039;jffs2&amp;#039;&amp;#039; (you have to use the block device &amp;#039;&amp;#039;/dev/mtdblockX&amp;#039;&amp;#039;). JFFS2 will automatically create the necessary structure.&lt;br /&gt;
 root@btmxc27:~# mount -t jffs2 /dev/mtdblock5 /mnt/card/&lt;br /&gt;
 JFFS2 doesn&amp;#039;t use OOB.&lt;br /&gt;
 root@btmxc27:~#&lt;br /&gt;
&lt;br /&gt;
*Ready!&lt;br /&gt;
&lt;br /&gt;
=== Test in Linux ===&lt;br /&gt;
&lt;br /&gt;
We assume that you have mounted your &amp;#039;&amp;#039;rootfs&amp;#039;&amp;#039; partition on NAND flash at &amp;#039;&amp;#039;/mnt/card&amp;#039;&amp;#039; (see &amp;quot;Linux: JFFS2 file system&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* We load a 32 MiB large random file onto the core module:&lt;br /&gt;
 root@btmxc27:~# tftp -r 32MBrandomfile -g 192.168.5.1&lt;br /&gt;
&lt;br /&gt;
* We write the file to the NAND flash for 15 times:&lt;br /&gt;
 root@btmxc27:~# for i in `seq 1 15` ; do cp 32MBrandomfile /mnt/card/file${i} ; done&lt;br /&gt;
&lt;br /&gt;
* and compare each file with the original afterwards. If &amp;quot;diff&amp;quot; does not output anything, the files are identical.&lt;br /&gt;
 root@btmxc27:~# for i in `seq 1 15` ; do diff 32MBrandomfile /mnt/card/file${i} ; done&lt;br /&gt;
 root@btmxc27:~#&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* It is possible to incorporate a larger NAND flash device (&amp;gt; 512 MiB) on a custom board. In this case, the NAND flash on the core module is&lt;br /&gt;
automatically deactivated.&lt;br /&gt;
* The i.MX27 supports NAND flash devices with 512 B or 2KiB page sizes. The maximum supported size is 8 GiB (for 2KiB page size chips) and 1 GiB (for 512 B page size chips) respectively. (See i.MX27 Reference Manual, Chapter 19 &amp;#039;&amp;#039;NAND Flash Controller (NFC)&amp;#039;&amp;#039;).&lt;br /&gt;
== NOR Flash ==&lt;br /&gt;
&lt;br /&gt;
A 32 MiB NOR flash chip is available on the core module V2.1.&lt;br /&gt;
&lt;br /&gt;
=== Test in Redboot ===&lt;br /&gt;
&lt;br /&gt;
*Initialize the Redboot flash image system:&lt;br /&gt;
 RedBoot&amp;gt; fis init&lt;br /&gt;
 About to initialize [format] FLASH image system - continue (y/n)? y&lt;br /&gt;
 *** Initialize FLASH Image System&lt;br /&gt;
 ... Unlock from 0xc1fe0000-0xc2000000: .&lt;br /&gt;
 ... Erase from 0xc1fe0000-0xc2000000: .&lt;br /&gt;
 ... Program from 0x07ee0000-0x07f00000 at 0xc1fe0000: .&lt;br /&gt;
 ... Lock from 0xc1fe0000-0xc2000000: .&lt;br /&gt;
*Load any file onto the module via Ethernet:&lt;br /&gt;
 RedBoot&amp;gt; load -r -b 0x200000 1MBrandomfile&lt;br /&gt;
 Using default protocol (TFTP)&lt;br /&gt;
 Raw file loaded 0x00200000-0x002fffff, assumed entry at 0x00200000&lt;br /&gt;
*Write it to NOR flash:&lt;br /&gt;
 RedBoot&amp;gt; fis create -b 0x200000 -l 0x100000 testfile&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0xc1fe0000: .&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0xc1fe0000: .&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0xc1fe0000: .&lt;br /&gt;
 ... Erase from 0xc0040000-0xc0140000: ........&lt;br /&gt;
 ... Program from 0x00200000-0x00300000 at 0xc0040000: ........&lt;br /&gt;
 ... Unlock from 0xc1fe0000-0xc2000000: .&lt;br /&gt;
 ... Erase from 0xc1fe0000-0xc2000000: .&lt;br /&gt;
 ... Program from 0x07ee0000-0x07f00000 at 0xc1fe0000: .&lt;br /&gt;
 ... Lock from 0xc1fe0000-0xc2000000: .&lt;br /&gt;
*It must show up in the list of flash images now:&lt;br /&gt;
 RedBoot&amp;gt; fis list&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0xc1fe0000: .&lt;br /&gt;
 Name              FLASH addr  Mem addr    Length      Entry point&lt;br /&gt;
 RedBoot           0xC0000000  0xC0000000  0x00040000  0x00000000&lt;br /&gt;
 testfile          0xC0040000  0x00200000  0x00100000  0x00200000&lt;br /&gt;
 FIS directory     0xC1FE0000  0xC1FE0000  0x0001F000  0x00000000&lt;br /&gt;
 RedBoot config    0xC1FFF000  0xC1FFF000  0x00001000  0x00000000&lt;br /&gt;
*Load from flash and compare with the original:&lt;br /&gt;
 RedBoot&amp;gt; fis load testfile&lt;br /&gt;
 ... Read from 0x07ee0000-0x07eff000 at 0xc1fe0000: .&lt;br /&gt;
 ... Read from 0x00200000-0x00300000 at 0xc0040000: ........&lt;br /&gt;
 RedBoot&amp;gt; mcmp -s 0x100000 -d 0x200000 -l 0x100000&lt;br /&gt;
 RedBoot&amp;gt; &lt;br /&gt;
*If &amp;#039;&amp;#039;mcmp&amp;#039;&amp;#039; does not output anything, the files are identical.&lt;br /&gt;
&lt;br /&gt;
=== Update Redboot ===&lt;br /&gt;
&lt;br /&gt;
We assume you have booted Redboot. Type&lt;br /&gt;
 factive nor&lt;br /&gt;
to activate NOR flash in Redboot. Then load the new Redboot image onto the core module and run it:&lt;br /&gt;
 load -r -b 0x100000 redboot.bin&lt;br /&gt;
 run&lt;br /&gt;
Now type&lt;br /&gt;
 romupdate&lt;br /&gt;
to update Redboot in NOR flash.&lt;br /&gt;
&lt;br /&gt;
=== JFFS2 file system ===&lt;br /&gt;
&lt;br /&gt;
If you want a file system on NOR flash, it is recommended to use JFFS2.&lt;br /&gt;
&lt;br /&gt;
*List all MTD partitions. As you can see, the rootfs on NOR flash corresponds to &amp;#039;&amp;#039;/dev/mtd2&amp;#039;&amp;#039;.&lt;br /&gt;
 root@btmxc27:~# cat /proc/mtd        &lt;br /&gt;
 dev:    size   erasesize  name&lt;br /&gt;
 mtd0: 00040000 00020000 &amp;quot;nor.bootloader&amp;quot;&lt;br /&gt;
 mtd1: 00200000 00020000 &amp;quot;nor.kernel&amp;quot;&lt;br /&gt;
 mtd2: 01da0000 00020000 &amp;quot;nor.rootfs&amp;quot;&lt;br /&gt;
 mtd3: 00020000 00020000 &amp;quot;nor.redbootconf&amp;quot;&lt;br /&gt;
 mtd4: 00100000 00020000 &amp;quot;nand.bootloader&amp;quot;&lt;br /&gt;
 mtd5: 00500000 00020000 &amp;quot;nand.kernel&amp;quot;&lt;br /&gt;
 mtd6: 1fa00000 00020000 &amp;quot;nand.rootfs&amp;quot;&lt;br /&gt;
 root@btmxc27:~#&lt;br /&gt;
&lt;br /&gt;
*Delete the contents (if any) of the rootfs partition:&lt;br /&gt;
 root@btmxc27:~# flash_eraseall /dev/mtd2&lt;br /&gt;
 Erasing 128 Kibyte @ 1da0000 -- 100 % complete.&lt;br /&gt;
 root@btmxc27:~#&lt;br /&gt;
&lt;br /&gt;
*Mount the partition with the JFFS2 file system:&lt;br /&gt;
 root@btmxc27:~# mount -t jffs2 /dev/mtdblock2 /mnt/card/&lt;br /&gt;
 root@btmxc27:~# mount&lt;br /&gt;
 ...&lt;br /&gt;
 /dev/mtdblock2 on /media/card type jffs2 (rw)&lt;br /&gt;
 ...&lt;br /&gt;
 root@btmxc27:~#&lt;br /&gt;
&lt;br /&gt;
You have successfully created a JFFS2 file system on the rootfs partition.&lt;br /&gt;
&lt;br /&gt;
=== Test in Linux ===&lt;br /&gt;
&lt;br /&gt;
We copy a 1 MiB random file to the partition, unmount and re-mount it, and compare the file:&lt;br /&gt;
 root@btmxc27:~# tftp -r 1MBrandomfile -g 192.168.5.1&lt;br /&gt;
 root@btmxc27:~# cp 1MBrandomfile /mnt/card/&lt;br /&gt;
 root@btmxc27:~# ls -l /mnt/card/&lt;br /&gt;
 -rw-r--r--    1 root     root      1048576 Feb 10 12:39 1MBrandomfile&lt;br /&gt;
 root@btmxc27:~# umount /mnt/card/&lt;br /&gt;
 root@btmxc27:~# mount -t jffs2 /dev/mtdblock2 /mnt/card/&lt;br /&gt;
 root@btmxc27:~# diff 1MBrandomfile /mnt/card/1MBrandomfile &lt;br /&gt;
 root@btmxc27:~#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:i.MX27]]&lt;/div&gt;</summary>
		<author><name>en&gt;Peter</name></author>
	</entry>
</feed>