i.mx28 nand boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx28 nand boot

30,691 Views
mehmet
Contributor I

Hi,

I use i.mx28 evk. And I have to boot from nand. I did steps from 5.1.3.2 nand boot header on linux_bsp_ug.pdf

flash_eraseall /dev/mtd0

kobs-ng init /boot/imx28_ivt_linux.sb

flash_eraseall /dev/mtd1

nandwrite /dev/mtd1 /boot/rootfs.jffs2

 

I set boot mode select 01001 for nand boot. I press KEY1 for nand rootfs while starting. Linux begins from nand but linux cannot mount rootfs. If I don't press KEY1, linux(from nand)  mounts rootfs on sd card.

I have changed alternative cmd line 1 from;

noinitrd console=ttyAM0,115200 ubi.mtd=1 root=ubi0:rootfs0 rootfstype=ubifsrw gpmi

to;

noinitrd console=ttyAM0,115200 root=/dev/mtdblock1 rootfstype=jffs2

 

But nothing has been changed.

 

What can I do for boot from nand?

 

Thanks.

Mehmet Kurnaz

Tags (1)
0 Kudos
55 Replies

2,596 Views
Brad1z
Contributor I
This is the only reference I have. (attached)

Robert M Girard said:

Brad,

Could you please upload the datasheet for the K9F1G08U08?

I cant find it on the web and I would like to compare against my ST NAND.

 

Thanks very much 

Robert


Robert M Girard said:

Hi Brad,

Thanks for the info.

So you didnt get any of the ECC errors we were having after rebooting a few times and /or writing to the root FS, I assume?

The size of your Samsung Flash is the same as my ST NAND, so I have high hopes that I can follow your advice with success.

One difference in your procedure is the use of the SD card to contain the .jffs2 file and bootstream file, I have been running a NFS mounted system from which I Flash the NAND, then switch to NAND boot after. Not sure how that would make any difference though.

One thing I see is that you defined the imx28_linux.sb bootstream, not the imx28_ivt_linux.sb type. This may indicate you are using an older EVK and older BSP, which could be a factor as well.

What versions do you have? I ask because Freescale Support recommended using an older BSP to work around the JFFS2 ECC errors I have been stuck with. I really do not want to use an older BSP though.

 

Regards

Robert

Brad Bierschenk said:

Hello:

These instructions worked for me to boot from a K9F1G08U08 Samsung 128MB NAND:

 

The main idea is to build the kernel and filesystem with NAND support, boot from an SD card, and write the NAND with the bootstream and filesystem.

In ltib configuration:

DO NOT select the "Build mfg firmware" option in the platform configuration

DO select kobs-ng, boot stream, and mtd-utils in the package list.

Under target image generation options, ensure the jffs2 erase block size setting matches that of the NAND being used (for example, 128K for K9F1G08U08)

Make the first two kernel command line options under the bootstream configuration look like this:

(noinitrd console=ttyAM0,115200 root=/dev/mtdblock1 rootfstype=jffs2 rw rootwait fec_mac=00:08:02:6B:A3:1A gpmi)
(noinitrd console=ttyAM0,115200 root=/dev/mmcblk0p3 rw rootwait fec_mac=00:08:02:6B:A3:1A gpmi)

This makes the default boot NAND, but allows you to boot SD first by using KEY1 on the EVK.

After ltib rebuilds your kernel and filesystem, do this command to ensure the bootstream gets built properly: ./ltib -p imx-bootlets -f

If that errors, use ./ltib -p imx-bootlets -m prep to extract the source.

 

Run the mk_mx28_sd script (from freescale i.MX28 page) from the ltib directory with the SD card enumerated on the host.

Copy the ltib/rootfs.jffs2 file to the SD card's Linux filesystem partition.

Insert the SD card into the EVK, put DIP block in NAND boot mode, and hold KEY1 down while applying power. This will force it to load kernel and filesystem off of the SD card.

Once the device is booted, login as root.

Execute these commands:

flash_eraseall /dev/mtd0

kobs-ng init /boot/imx28_linux.sb

flash_eraseall /dev/mtd1

nandwrite /dev/mtd1 rootfs.jffs2

sync

poweroff

Remove the SD card, and apply power.

The kernel and filesystem should be sourced from the NAND.

0 Kudos

2,596 Views
Brad1z
Contributor I

I hadn't noticed the ECC errors during the boot process until I reviewed the boot capture.

After logging in I did a lot of file I/O as a test, and never saw another ECC error message.

What I meant was, after booting, I never saw any other ECC error messages.


Robert M Girard said:

Brad,

I am confused regarding your statement " ...but yes, I am getting those. I am not getting them as I use the filesystem though."

 

I see you have the same errors as I have been getting, so that part I understand.

However, could you clarify the part  "I am not getting them as I use the filesystem though."

How do you avoid getting these errors based on the statement you made here?

 

Thanks

Robert

0 Kudos

2,596 Views
RobertMGirard
Contributor I

Brad,

Could you please upload the datasheet for the K9F1G08U08?

I cant find it on the web and I would like to compare against my ST NAND.

 

Thanks very much 

Robert


Robert M Girard said:

Hi Brad,

Thanks for the info.

So you didnt get any of the ECC errors we were having after rebooting a few times and /or writing to the root FS, I assume?

The size of your Samsung Flash is the same as my ST NAND, so I have high hopes that I can follow your advice with success.

One difference in your procedure is the use of the SD card to contain the .jffs2 file and bootstream file, I have been running a NFS mounted system from which I Flash the NAND, then switch to NAND boot after. Not sure how that would make any difference though.

One thing I see is that you defined the imx28_linux.sb bootstream, not the imx28_ivt_linux.sb type. This may indicate you are using an older EVK and older BSP, which could be a factor as well.

What versions do you have? I ask because Freescale Support recommended using an older BSP to work around the JFFS2 ECC errors I have been stuck with. I really do not want to use an older BSP though.

 

Regards

Robert

Brad Bierschenk said:

Hello:

These instructions worked for me to boot from a K9F1G08U08 Samsung 128MB NAND:

 

The main idea is to build the kernel and filesystem with NAND support, boot from an SD card, and write the NAND with the bootstream and filesystem.

In ltib configuration:

DO NOT select the "Build mfg firmware" option in the platform configuration

DO select kobs-ng, boot stream, and mtd-utils in the package list.

Under target image generation options, ensure the jffs2 erase block size setting matches that of the NAND being used (for example, 128K for K9F1G08U08)

Make the first two kernel command line options under the bootstream configuration look like this:

(noinitrd console=ttyAM0,115200 root=/dev/mtdblock1 rootfstype=jffs2 rw rootwait fec_mac=00:08:02:6B:A3:1A gpmi)
(noinitrd console=ttyAM0,115200 root=/dev/mmcblk0p3 rw rootwait fec_mac=00:08:02:6B:A3:1A gpmi)

This makes the default boot NAND, but allows you to boot SD first by using KEY1 on the EVK.

After ltib rebuilds your kernel and filesystem, do this command to ensure the bootstream gets built properly: ./ltib -p imx-bootlets -f

If that errors, use ./ltib -p imx-bootlets -m prep to extract the source.

 

Run the mk_mx28_sd script (from freescale i.MX28 page) from the ltib directory with the SD card enumerated on the host.

Copy the ltib/rootfs.jffs2 file to the SD card's Linux filesystem partition.

Insert the SD card into the EVK, put DIP block in NAND boot mode, and hold KEY1 down while applying power. This will force it to load kernel and filesystem off of the SD card.

Once the device is booted, login as root.

Execute these commands:

flash_eraseall /dev/mtd0

kobs-ng init /boot/imx28_linux.sb

flash_eraseall /dev/mtd1

nandwrite /dev/mtd1 rootfs.jffs2

sync

poweroff

Remove the SD card, and apply power.

The kernel and filesystem should be sourced from the NAND.

0 Kudos

2,596 Views
RobertMGirard
Contributor I

Brad,

I am confused regarding your statement " ...but yes, I am getting those. I am not getting them as I use the filesystem though."

 

I see you have the same errors as I have been getting, so that part I understand.

However, could you clarify the part  "I am not getting them as I use the filesystem though."

How do you avoid getting these errors based on the statement you made here?

 

Thanks

Robert

0 Kudos

2,596 Views
Brad1z
Contributor I

I am using 2.6.35-11.03.00

My EVK is a Rev B, with HAB not enabled. I think that is why I can use the non-ivt versio of the .sb file.

I hadn't noticed the ECC read errors on boot, but yes, I am getting those. I am not getting them as I use the filesystem though.

I am attaching a capture of the boot process output here.

0 Kudos

2,596 Views
RobertMGirard
Contributor I

Hi Brad,

Thanks for the info.

So you didnt get any of the ECC errors we were having after rebooting a few times and /or writing to the root FS, I assume?

The size of your Samsung Flash is the same as my ST NAND, so I have high hopes that I can follow your advice with success.

One difference in your procedure is the use of the SD card to contain the .jffs2 file and bootstream file, I have been running a NFS mounted system from which I Flash the NAND, then switch to NAND boot after. Not sure how that would make any difference though.

One thing I see is that you defined the imx28_linux.sb bootstream, not the imx28_ivt_linux.sb type. This may indicate you are using an older EVK and older BSP, which could be a factor as well.

What versions do you have? I ask because Freescale Support recommended using an older BSP to work around the JFFS2 ECC errors I have been stuck with. I really do not want to use an older BSP though.

 

Regards

Robert

Brad Bierschenk said:

Hello:

These instructions worked for me to boot from a K9F1G08U08 Samsung 128MB NAND:

 

The main idea is to build the kernel and filesystem with NAND support, boot from an SD card, and write the NAND with the bootstream and filesystem.

In ltib configuration:

DO NOT select the "Build mfg firmware" option in the platform configuration

DO select kobs-ng, boot stream, and mtd-utils in the package list.

Under target image generation options, ensure the jffs2 erase block size setting matches that of the NAND being used (for example, 128K for K9F1G08U08)

Make the first two kernel command line options under the bootstream configuration look like this:

(noinitrd console=ttyAM0,115200 root=/dev/mtdblock1 rootfstype=jffs2 rw rootwait fec_mac=00:08:02:6B:A3:1A gpmi)
(noinitrd console=ttyAM0,115200 root=/dev/mmcblk0p3 rw rootwait fec_mac=00:08:02:6B:A3:1A gpmi)

This makes the default boot NAND, but allows you to boot SD first by using KEY1 on the EVK.

After ltib rebuilds your kernel and filesystem, do this command to ensure the bootstream gets built properly: ./ltib -p imx-bootlets -f

If that errors, use ./ltib -p imx-bootlets -m prep to extract the source.

 

Run the mk_mx28_sd script (from freescale i.MX28 page) from the ltib directory with the SD card enumerated on the host.

Copy the ltib/rootfs.jffs2 file to the SD card's Linux filesystem partition.

Insert the SD card into the EVK, put DIP block in NAND boot mode, and hold KEY1 down while applying power. This will force it to load kernel and filesystem off of the SD card.

Once the device is booted, login as root.

Execute these commands:

flash_eraseall /dev/mtd0

kobs-ng init /boot/imx28_linux.sb

flash_eraseall /dev/mtd1

nandwrite /dev/mtd1 rootfs.jffs2

sync

poweroff

Remove the SD card, and apply power.

The kernel and filesystem should be sourced from the NAND.

0 Kudos

2,596 Views
Brad1z
Contributor I

Hello:

These instructions worked for me to boot from a K9F1G08U08 Samsung 128MB NAND:

 

The main idea is to build the kernel and filesystem with NAND support, boot from an SD card, and write the NAND with the bootstream and filesystem.

In ltib configuration:

DO NOT select the "Build mfg firmware" option in the platform configuration

DO select kobs-ng, boot stream, and mtd-utils in the package list.

Under target image generation options, ensure the jffs2 erase block size setting matches that of the NAND being used (for example, 128K for K9F1G08U08)

Make the first two kernel command line options under the bootstream configuration look like this:

(noinitrd console=ttyAM0,115200 root=/dev/mtdblock1 rootfstype=jffs2 rw rootwait fec_mac=00:08:02:6B:A3:1A gpmi)
(noinitrd console=ttyAM0,115200 root=/dev/mmcblk0p3 rw rootwait fec_mac=00:08:02:6B:A3:1A gpmi)

This makes the default boot NAND, but allows you to boot SD first by using KEY1 on the EVK.

After ltib rebuilds your kernel and filesystem, do this command to ensure the bootstream gets built properly: ./ltib -p imx-bootlets -f

If that errors, use ./ltib -p imx-bootlets -m prep to extract the source.

 

Run the mk_mx28_sd script (from freescale i.MX28 page) from the ltib directory with the SD card enumerated on the host.

Copy the ltib/rootfs.jffs2 file to the SD card's Linux filesystem partition.

Insert the SD card into the EVK, put DIP block in NAND boot mode, and hold KEY1 down while applying power. This will force it to load kernel and filesystem off of the SD card.

Once the device is booted, login as root.

Execute these commands:

flash_eraseall /dev/mtd0

kobs-ng init /boot/imx28_linux.sb

flash_eraseall /dev/mtd1

nandwrite /dev/mtd1 rootfs.jffs2

sync

poweroff

Remove the SD card, and apply power.

The kernel and filesystem should be sourced from the NAND.

0 Kudos

2,595 Views
RobertMGirard
Contributor I

Jon,

 

Due to the supposed fact from Freescale Support about the lack of verification of JFFS2 for the i.MX28EVK BSP, I have, for now, opted to try to get UBI to work.

From what I read from the web, this is a successor to JFFS2, and targetted for NAND use, so I have some interest in this anyway. Also, I think there is at least some verification from FS Support as to successful testing/use on this platform.

Maybe we can put our efforts in on this and get this to work, although it does have some new complexities involved.

I will attach what was sent to me by support FYI.

The first doc is an example from the i.MX233 for UBI setup

The second is the ucl.xml doc that the MFG tool FS Support keeps pointing me to for assistance.

Neither of these are magic bullets however, but contain some useful info.

 

I have just started reading up on this, so I have very little to recommend at the time being, but hopefully within the next day or so more info.

 

One of the things that I am struggling with is the ltib config page for UBI regarding LEB, PEB, I/O unit size etc and what those need to be for a given NAND device ( i.e. how these parameters relate to NAND Flash parameters ).

 

Regards, and thanks for joining in on this. The more, the better!

Robert



Jon Szymaniak said:

Hi guys,

 

I've been following your discussion, as I'm trying to boot a MT29F2G08 (2 Gb NAND flash, 128KB Block Size, 2KB page size) with JFFS2 as well.  Although I can get it to boot and run, I'm also seeing ECC errors getting dumped to the console.

 

When erasing /dev/mtd0 and /dev/mtd1, I noted the existence of the -j option to format the device for jffs2...I thought this might clear up some issues, but receive *a lot* of error output when attempting to use this flag. Below are just a few message I received:

 

flash_eraseall: /dev/mtd0: MTD wgpmi-nfc gpmi-nfc.0: This driver doesn't support writing the OOB

flash_eraseall: /dev/mtd0: MTD writeoob failure: Input/output error

 

Please let me know if you end up getting jffs2 or ubifs running...I'll post back any success stories as well. Thanks!

 

0 Kudos

2,595 Views
JonSzymaniak
Contributor II

Hi guys,

 

I've been following your discussion, as I'm trying to boot a MT29F2G08 (2 Gb NAND flash, 128KB Block Size, 2KB page size) with JFFS2 as well.  Although I can get it to boot and run, I'm also seeing ECC errors getting dumped to the console.

 

When erasing /dev/mtd0 and /dev/mtd1, I noted the existence of the -j option to format the device for jffs2...I thought this might clear up some issues, but receive *a lot* of error output when attempting to use this flag. Below are just a few message I received:

 

flash_eraseall: /dev/mtd0: MTD wgpmi-nfc gpmi-nfc.0: This driver doesn't support writing the OOB

flash_eraseall: /dev/mtd0: MTD writeoob failure: Input/output error

 

Please let me know if you end up getting jffs2 or ubifs running...I'll post back any success stories as well. Thanks!

0 Kudos

2,595 Views
RobertMGirard
Contributor I

Mehmet,

Yes I did try Ubifs with no success several days ago, but I didnt know what I was doing then, so I may try it again with all the gained knowledge. For my application, large partitions are not needed, so not an advantage for my design. I really do think that pursuing JFFS2 eventually is the best solution.

For now, in order to be able to continue, I will use ext3 since it appears to work predictibly. Unlike you however, I dont have time pressure, so I can follow up on the JFFS2 issue as I am sure it will be resolved in a future patch, since this is likely the most used filesystem format for an embedded design. I'm sure if there is a problem with this release, it will get addressed soon enough.

 

Regarding QT -

best of luck in getting all that working. I assume you are using the Qt Creator IDE to create your GUI, and then porting the project to the native ARM compiler? This is how I will be doing Qt apps, as I did this kind of design for a past project for embedded PPC with a 4.3" color graphics touchscreen.

 

Regards

Robert

0 Kudos

2,595 Views
mehmet
Contributor I

Robert,

 

Did you try ubifs? I tried but couldn't success. Maybe we can get help about ubifs. I have browsed about ubifs, it looks like better than jffs2 for bigger( > 16m)  partitions.

By the way  I have built qt but couldn't try. ltip supports it, but at first ltib couldn't find qt-everywhere-opensource-src-4.6.0.tar.gz. I downloaded it and copied to /opt/freescale/pkgs. Today I got lcd board. I will try tomorrow.

 

Thanks.

Mehmet

0 Kudos

2,595 Views
RobertMGirard
Contributor I

Mehmet,

Thanks for the clarification on the Freescale support,. Speaking of :

I got a response back from Freescale support last night regarding JFFS2 support for the i.MX28.

Here is what was said ( not much, but somewhat disturbing ):

 

"t may be recommended to try 10.08 release or ubifs (seems jffs2 was not good tested with i.MX28)."

 

Obviously, this needs more investigation. I am using the latest BSP release version 10.12.01, not 10.08. I may try the recommendation of support to use 10.08 to see if this makes any difference, but I dont like the idea of going to older versions, as they are most likely not as good as the newer ones.

 

Regards

Robert

0 Kudos

2,595 Views
mehmet
Contributor I

Robert,

 

It was only a gripe by  "How does Freescale support". My nand is 2k mlc. I expect, I can use these flash without any problem.

 

I have read imx_new_nand_support.pdf doc.

I have looked for nand_flash_ids[] and  nand_device_info_table_large_mlc[] structs. I found my flash in both of them.

I thought maybe your nand is not defined, it can help you. 

 

I will check ext3 for nand. I think sd card is not only nand,  it has controller and it works for this issues. 

If I get any progress I will pass you. 

Note: Sorry for my English, Sometimes I cannot mean correctly.

 

Thanks.

Mehmet

0 Kudos

2,595 Views
RobertMGirard
Contributor I

The zip file shows what files need to be modified in the Linux source in order to add a new NAND Flash type to the "list".

Look at these files to see that the Flash you are using is explcitly defined in the nand_device_info.c file.

I saw that the MT29F2G08 major category type you may be using is in the list already.

If your Flash is not in the list, you need to add it according the the document and rebuild the kernel.

Hope that helps

Robert



Mehmet Kurnaz said:

Robert,

Are you sure we don't work for same project? :)

That is good, we will work together. And we have to overcome these problems.

 

I have used erase size 128K, page size 2K for mt29f2. I got a mail from freescale. It doesn't help me or I couldn't understand. It's 01:00 o'clock in my country. I need sleeping. 

I sent file to you may be you can understand. If it helps, inform me please.

Good luck

Mehmet

0 Kudos

2,595 Views
RobertMGirard
Contributor I

Mehmet,

Glad to know we are working on the same project! Should make things easier.

 

I have very little experience with .ext3 filesystem usage. It is considered as a Linux filesystem, but not targeted for NAND or NOR Flash. Yet, it still worked for me. Not sure what the major differences are, and .ext3 is a journaling filesystem as well.

However,

I will still end up using JFFS2 for the real design, but I was just curious to see what would happen or if .ext3 worked at all.

FYI: The SD card example for this BSP uses .ext2 or .ext3. SD is NAND, so I suppose its usable.

I see the use of the ext3 format as a way to narrow down the ECC error issue, but I suggest using JFFS2 in the product design.

 

I'm not sure what you meant by "How does Freescale support". If you meant what they support for NAND -

The BSP officially supports 4k SLC for sure, and the i.MX28 can go to 8k or maybe higher, but the BSP is not capable.

I think your 8 Gbit part should be less than 4k or less page size.

I think I will be using SLC due to costing, but be aware, SLC has a much lower write cycle max than MLC.

 

If this doesnt address your question, please excuse and clarify further what you need to know.

 

Regards

Robert

0 Kudos

2,595 Views
mehmet
Contributor I

Robert,

Is ext3 fs suitable for nand? I have tried ubi fs today but I couldn't success it. 

I have selected  GPMI NAND Flash driver.

I have realized that mt29f2 is slc, K9.. is mlc. I have found mt29f8... that is 8Gb and slc. Maybe I can try it but it comes after a week.

How does freescale support? We don't use sata disk, it is nand flash it is base of embedded world.

 

Mehmet

0 Kudos

2,597 Views
RobertMGirard
Contributor I

I will look at this attached file later today and comment.

Get some sleep already!!!

Regards

Robert

0 Kudos

2,597 Views
mehmet
Contributor I

Robert,

Are you sure we don't work for same project? :)

That is good, we will work together. And we have to overcome these problems.

 

I have used erase size 128K, page size 2K for mt29f2. I got a mail from freescale. It doesn't help me or I couldn't understand. It's 01:00 o'clock in my country. I need sleeping. 

I sent file to you may be you can understand. If it helps, inform me please.

Good luck

Mehmet

0 Kudos

2,597 Views
RobertMGirard
Contributor I

Mehmet,

As an experiment, I tried switching to a .ext3 formatted root filesystem instead of JFFS2.

There were no ECC errors at all even after doing a successful edit of the etc/rc.conf file to modify my IP address.

After rebooting, no errors were printed out and the file change was correct.

Additional reboots confirmed all was working correctly.

 

I'm not sure what this all means other than the settings within the JFFS2 must be the problem.

 

Robert

0 Kudos

2,597 Views
RobertMGirard
Contributor I

Mehmet,

 

Interesting how close our goals are -

I also am going to be tackling getting Qt to run on the touchscreen,

and figuring out new mtd partitions as well.

 

I wish you the best of luck in getting all that going in a few days!

Regarding Qt, you will need to have a compiler for building native QT applications on ARM-9. Not sure if that is easy to do or included with the ltib BSP.

 

Regarding your mt29f2... NAND success - great!

What did you specify for the page size and erase block size?

Do you have the GPMI NAND Flash driver selected in the kernel config? ( This is in drivers/mtd/NAND device support )

 

Regards

Robert

0 Kudos

2,597 Views
mehmet
Contributor I

Robert,

It is interesting, there is no problem with 2Gb nand(mt29f2g08aad). I don't understand. There issues are basic steps. How can we confront these problems on any evk. Whereas I have to do a lot of work about project.

mtd partitions

building qt

working with lcd and touchscreen

....

I don't know how I overcome these problems for a few days. :(

 

I will ask to freescale too. If I get any answer I will write you.

so thanks for your helps.

 

Mehmet

0 Kudos