2010-04-12 03:21:51     Flash uImage to Nand Flash on BF526

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2010-04-12 03:21:51     Flash uImage to Nand Flash on BF526

Hank Lee (TAIWAN)

Message: 88316   

 

Hi,

 

I want to boot uClinux from Nand Flash on BF526ezbrd. And I refer http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:nand-flash to write uImage to nand flash.

 

If I used u-boot-bf527-ezkit-nand-2009R1.1-rc1.ldr on snaps to boot into U-boot on BF527ezkit.  I can write uImage and boot into uClinux normally.

 

But now I change board to bf526ezbrd .  I download u-boot-trunk-svn.src.tar.bz2 sourcecode and build a U-boot.ldr for BF526 with u-boot-2010.03 version. When I boot into U-boot , I can write uImage to nand flash . But if I want to boot into uClinux , it will show this error message as below.

 

TFTP from server 172.18.121.119; our IP address is 172.18.121.97

Filename 'uImage'.

Load address: 0x1000000

Loading: #################################################################

         #################################################################

         #################################################################

         #################################################################

         ############################################################

done

Bytes transferred = 4693330 (479d52 hex)

 

bfin> nand scrub

 

NAND scrub: device 0 whole chip

Warning: scrub option will erase all factory set bad blocks!

         There is no reliable way to recover them.

         Use this command only for testing purposes if you

         are sure of what you are doing!

 

Really scrub this NAND flash? <y/N>

Erasing at 0xffe0000 -- 100% complete.

OK

bfin> nand erase clean

 

NAND erase: device 0 whole chip

Erasing at 0xffe0000 -- 100% complete. Cleanmarker written at 0xffe0000.

OK

bfin> nand write.jffs2 0x1000000 0x0 0x480000

 

NAND write: device 0 offset 0x0, size 0x480000

4718592 bytes written: OK

bfin> nboot 0x2000000 0x0

 

Loading from NAND 256MiB 1,8V 8-bit, offset 0x0

   Image Name:   Linux-2.6.28.10-ADI-2009R1.1

   Created:      2010-04-09   6:17:06 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    4693266 Bytes =  4.5 MB

   Load Address: 00001000

   Entry Point:  001d3940

bfin> bootm 0x2000000

## Booting kernel from Legacy Image at 02000000 ...

   Image Name:   Linux-2.6.28.10-ADI-2009R1.1

   Created:      2010-04-09   6:17:06 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    4693266 Bytes =  4.5 MB

   Load Address: 00001000

   Entry Point:  001d3940

   Verifying Checksum ... Bad Data CRC

ERROR: can't get kernel image!

bfin>

 

Please tell me how to fix this problem?

 

Hank

TranslateQuoteReplyEditDelete

 

 

2010-04-12 08:20:35     Re: Flash uImage to Nand Flash on BF526

Andrew Seddon (UNITED KINGDOM)

Message: 88327   

 

Hank, we are having the same issue, see

 

https://blackfin.uclinux.org/gf/project/u-boot/forum/?_forum_action=ForumMessageBrowse&thread_id=40352&action=ForumBrowse&forum_id=51

 

no solution as yet.

QuoteReplyEditDelete

 

 

2010-04-12 11:49:21     Re: Flash uImage to Nand Flash on BF526

Andrew Rook (UNITED KINGDOM)

Message: 88337   

 

You might try using 'nand erase' without the 'clean' option. See my reply to :

 

https://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=ForumMessageBrowse&thread_id=40340&action=ForumBrowse&forum_id=39

 

If 'nand erase clean' has actually resulted in marking all the NAND IC's blocks as bad, then you will have to use 'nand scrub' to erase all the bad block marker OOB bytes first, but that may give unreliable operation if the NAND IC has any blocks which are really bad.

 

I don't think the '.jffs2' option for 'nand write' actually has any effect in the 2009R1 or 2009R1.1 release of U-Boot.

 

Andrew Rook

QuoteReplyEditDelete

 

 

2010-04-12 23:44:37     Re: Flash uImage to Nand Flash on BF526

Hank Lee (TAIWAN)

Message: 88350   

 

Hi Rook,

 

I try to use 'nand erase' but result is the same.

 

Why BF527ezkit can work but BF526 can't?  Is BF526's U-boot not ready?

 

Hank

TranslateQuoteReplyEditDelete

 

 

2010-04-13 09:06:03     Re: Flash uImage to Nand Flash on BF526

Andrew Rook (UNITED KINGDOM)

Message: 88374   

 

Sorry, I can't help if your problem is specific to the BF526 or BF527. I have only run U-Boot on the BF533.

 

Andrew Rook

QuoteReplyEditDelete

 

 

2010-04-14 06:12:07     Re: Flash uImage to Nand Flash on BF526

Andrew Seddon (UNITED KINGDOM)

Message: 88419   

 

I'm actually wondering if the 'nand scrub' command is erasing the bad block info stored by the manufactuer and this does not get recovered. It might be worth trying to setup a jffs2 file system in linux to re-create the bad block info.

QuoteReplyEditDelete

 

 

2010-04-14 13:05:53     Re: Flash uImage to Nand Flash on BF526

Andrew Rook (UNITED KINGDOM)

Message: 88423   

 

I think that the U-Boot 'nand scrub' command will always erase the manufacturer-set bad block markers in the NAND IC. That is why the command gives the warning message that it is going to do so. It has certainly erased all bad block markers on NAND ICs the few times that I have tested it. I have only ever tested it on a Blackfin BF533 where the NAND Flash IC is connected to the normal external bus as an asynchronous memory device, but the code in drivers/mtd/nand/nand_util.c nand_erase_opts() which handles the scrub option does not seem to be processor or NAND controller specific.

 

Once the bad block markers have been erased, 'nand write' will try to write to blocks which are actually bad, and hence that will fail. If you know which blocks are actually bad, you should be able to restore the bad block markers for them using the U-Boot 'nand markbad' command.

 

You can probably assume that any block which fails to write is actually bad and mark it with 'nand markbad', to see if that fixes the problem. Also, if you dump an erased block, it should be all 0xFF but bad blocks seem to often have a few bits which are not 1 after erasing.

 

Creating a JFFS2 file system image will not help, as the JFFS2 file system should avoid using the bad blocks and hence it will not include any bad block markers. The U-Boot 'nand write' command skips over the blocks which are already marked as bad.

QuoteReplyEditDelete

 

 

2010-04-15 04:11:03     Re: Flash uImage to Nand Flash on BF526

Hank Lee (TAIWAN)

Message: 88442   

 

I loaded uClinux image to (RAM 0x1000000) first.  bootm 0x1000000 can boot into uClinux. And then,

 

bfin> nand erase

 

NAND erase: device 0 whole chip

Erasing at 0xffe0000 -- 100% complete.

OK

bfin> nand write.jffs2 0x1000000 0x0 0x410000

 

NAND write: device 0 offset 0x0, size 0x410000

4259840 bytes written: OK

bfin> nand read 0x2000000 0x0 0x410000

 

NAND read: device 0 offset 0x0, size 0x410000

4259840 bytes read: OK

bfin> cmp 0x1000000 0x2000000 0x410000

word at 0x010000fc (0x55527b59) != word at 0x020000fc (0x555a7b59)

Total of 63 words were the same

 

bfin> nand dump 0x0

Page 00000000 dump:

        27 05 19 56 81 1b 58 33  4b c5 85 58 00 40 c3 6d

        00 00 10 00 00 20 a8 d4  ab 98 32 f5 05 10 02 01

        62 66 35 32 37 2d 32 2e  36 2e 33 33 2e 31 2d 41

        44 49 2d 32 30 31 30 52  31 2d 70 72 65 00 00 00

        1f 8b 08 00 56 85 c5 4b  02 03 ac bd 09 7c 14 45

        f6 38 5e 33 99 a3 67 e8  24 9d 30 30 1d 12 c9 24

        5c 93 00 99 a6 45 0d 1e  98 04 d0 31 90 64 12 42

        c4 78 6c 87 04 12 dd 60  00 51 d1 f5 08 01 31 ba

        ea 66 88 08 1e bb 9b 43  d9 e8 22 4e 40 57 58 41

        d1 d5 88 2e 2b 78 ec 57  74 dd 95 4e 27 11 ef 70

        87 73 fe ef 55 75 67 12  8e fd ee 7e 7f 7f 3e 9f

        21 dd f5 ea bd 7a 75 f4  ab f7 aa 5e bd d2 ac 64

        bf 95 84 36 5f 23 d5 75  ac 8b ba b5 c0 21 cf 54

        2f 22 43 54 de 23 06 09  1f fb f2 73 c2 a6 57 66

        41 0a af fa 53 e6 11 4f  4f 26 c1 f4 9b 84 3c 48

        8b 56 47 7b 88 92 da 95  49 cc bc f7 59 7b 52 55

        b9 99 b3 88 08 5f 23 50  7a b1 35 05 b1 72 81 c4

        35 9b b8 58 31 0b 30 b2  d5 04 42 00 cb a4 4e bf

        26 55 cd 22 16 ed c0 92  58 39 76 7b ae ba 2f ec

        54 2d 29 42 d0 34 8f 2b  26 7c 82 48 e8 bf aa a7

        09 cf 27 65 01 56 0e 60  13 75 e9 35 ed ad 66 2c

        55 fb ed 43 eb ab ef 6e  f0 40 d9 e3 4c ad 56 81

        18 d4 4d ea 4d 94 32 96  62 d1 de 59 92 ab 8e 24

        4e d5 7f bf 10 cc 22 5f  f8 4c da ad 17 4b d2 14

        69 fd 6c 3e ea e7 d9 66  31 5c b9 8a bf 56 34 2b

        75 1f d9 df 39 18 22 50  ca 33 57 d8 25 b3 4a 3e

        3c 9e b7 47 ab 37 8d 94  86 4b 27 f3 84 00 1f 65

        37 df 10 b8 27 50 d7 d1  be 32 90 6f 2e 29 cc f7

        f4 4c 21 bd 21 e4 2c a5  e7 72 32 a9 1d 5b a1 bd

        95 a8 dc 35 44 2b 78 68  b1 2f 37 88 30 4c 39 3c

        23 be eb 2a 92 0b fc 39  d5 0a 4f 7c 23 d1 ae 7e

        c8 a4 8d b9 d8 23 a5 49  45 3e e4 79 86 64 52 27

        5f 63 d1 16 2f 9f ef cb  02 0e 08 94 bf aa f0 35

        1f e3 bd 61 49 0e fc cd  05 ae 2c 4b 84 c6 dd 9d

        eb 4f bc 67 a9 34 ad af  31 69 53 c6 38 b5 f9 6b

        91 32 a7 38 55 e2 11 1a  b3 68 fb 8a d7 c6 29 66

        c5 ac bd c7 d7 f2 05 22  81 a7 45 95 f8 ff c2 ca

        6b a4 aa bc aa 02 4e 66  bd 27 7a 72 83 f1 dd 8f

        90 40 ab 94 1b d8 ec 85  7e 73 8a 61 ad 23 cc a8

        cc bd 36 2d 48 b4 6f 57  b2 bc 2e 8f 01 ff 93 0e

        5f 4a e1 5f ac 64 6f 6d  d7 86 b5 17 75 c8 ab f0

        dc aa 3f ef 80 e7 df ea  cf bb e0 79 ad fe fc d9

        b5 44 7b fc 01 f6 ec 85  e7 d7 56 6e f0 9d b2 7a

        e5 4a 93 57 c9 85 d4 b1  b7 3b d5 b6 dc 3c 59 90

        86 ac 8b 5b 37 84 e3 84  21 66 bb 70 a2 d2 cc f7

        0d 8d 52 cc 9e bf 16 45  f1 7f 14 26 56 63 5e a7

        1a 82 9c 1c e4 e3 38 8b  c0 99 4f 26 9b 3d 5c 11

        e1 df 14 73 d5 11 00 ed  7b f1 7c 50 4e 70 2a 2d

        05 3d 0b c7 99 cc d2 36  18 41 33 24 8b 96 be e8

        b8 c2 39 9f 13 16 c8 2b  ab 67 c9 de 75 dc 33 9c

        f9 74 72 a8 5b 20 84 7f  f5 2d 97 58 2c 3b ca ee

        2d b3 7b 08 69 e8 36 41  9a b3 da 21 0a dc 71 37

        7b 8b 7b d6 59 7d dc bd  e9 ad e9 92 49 b1 68 fb

        af 21 bc 20 ed 19 da fe  ca 2e c7 08 20 90 ad 0e

        83 d1 59 7c a2 be 2b 1c  e6 02 82 2c 3c 2d f8 9d

        ae 68 a0 35 30 c5 22 1e  af d9 e5 38 9a dc fe d6

        2c 6e 53 22 fb 0a fc f0  15 6c 48 5c 51 26 72 2f

        26 66 4b 45 0a 52 7f 6d  89 57 de f4 8a 5d 99 2e

        b9 9f cd 03 ce db 69 69  4f 43 69 25 f2 ea ea 5c

        e7 93 43 09 8c b9 61 50  7b 2c f1 4c 98 c8 0d a5

        48 bf 9e d2 4c 51 17 91  fa 6e 28 95 ab 75 ff a6

        27 1c 9e 2e 21 8d df 5c  23 48 cb 7c d7 48 b5 f3

        b3 a1 dd 4a a4 de 90 49  ad ee 9a 21 b5 cc b7 68

        c9 77 09 7c 82 6b 51 6b  5d 47 53 dd c5 ad 4f 97

        d4 75 cc 5b c1 71 76 57  5f 79 96 1a 4b cc c5 51

        dc 8d 89 3d 0b 61 d4 49  e3 4c d8 9a a9 6a 98 14

        f9 f2 a5 19 d2 db f3 eb  80 df 9b 97 6c 7a 45 94

        02 50 93 1f 87 a6 a8 e1  d8 ba 8e d6 e5 d9 05 5c

        71 e9 b4 3a a0 55 5e db  94 df 54 50 57 32 c5 07

        e3 5a 2a 23 44 8b 5e 43  fa ff 41 e3 91 f7 2c d2

        cb 8b 9a c9 e4 74 75 74  72 f6 86 c2 d2 5b e5 4d

        b7 92 e7 36 ed 33 7b a2  76 12 d1 bb 9a 3c 07 3f

        85 eb b9 18 24 41 53 18  be 20 42 7a 56 12 53 cf

        72 62 fa a6 96 10 e5 21  8b 40 04 a9 af 3c 41 da

        5f 70 bc dc 1c c8 06 ae  39 e7 7c 57 ae ba 03 24

        0f 71 0a 6b 16 2b 5c 31  17 53 2a a6 56 0b 41 e2

        2f 71 79 54 93 b9 34 d0  54 60 72 d6 88 1e 35 7c

        ba a9 20 15 52 de 0e b4  14 0c c6 11 63 b2 28 4e

        ad ff 4a 01 70 4c b3 03  6d 80 33 07 71 ce b4 21

        8e e9 ed c0 4b 67 e1 78  63 c6 26 e5 d0 72 52 a1

        9c 28 f3 6c 5a ce 15 80  73 9a 96 13 75 9e 72 32

        63 ac 14 a7 d6 cf 89 29  ea 72 32 34 d0 5e c0 39

        89 19 5a 47 11 08 e3 30  52 b3 8d c9 ac fc 48 ca

        5b 89 8c 7a 24 65 4f b2  00 98 9c 82 ed 5b 65 ad

        34 ad aa 91 36 4d 92 d2  25 b3 b6 77 66 a6 e4 51

        49 af dd 99 00 92 7c c7  fc ba 8f 6c ef f4 82 7c

        1c 26 81 74 d4 7e 9e c2  a4 d9 7d 5f 49 92 10 8c

        85 94 e7 cd ab aa c7 99  6c 92 17 7a fe 32 e9 84

        0f fa 0c be e4 6b 6a 84  2e 19 be 8b f8 ae 8b 49

        b4 6b e7 24 a2 f4 86 a4  f6 45 ed 66 a9 48 22 9a

        ed ee 0e c0 81 f2 a5 e6  ca 43 be 1f a1 fc 34 95

        0f 3f 71 63 9a 7a 98 40  2f 87 17 97 16 de 88 b2

        3a 1d c6 90 49 49 55 bf  82 d9 e2 ab da 2c ec 59

        b5 c1 25 6d ee 2b 97 7a  ae 20 b5 aa b9 f6 32 98

        95 2e ed 91 48 6f fb 3b  93 a4 9e 2b 21 cd 54 9b

        55 60 52 ac 25 73 a4 03  a1 49 ed 8b db 89 b6 fb

        2e a4 fb c4 8d e3 4c 2f  5b b1 be 94 3b 29 c2 93

        47 8d cb 26 da b6 bb 18  4f 84 70 32 9d c1 ec bf

        2c 18 2a 73 4a a0 fd 91  f6 40 d0 dc 7d 09 c9 e1

        ed a2 d0 35 92 40 6a cf  58 c2 d2 b2 37 08 5d 45

        a4 7e 73 ce 86 eb d4 50  d8 01 1c 7e 02 cf 0d ad

        5c e3 9e 56 7f c8 3c 95  d1 3b 64 45 a9 9d cd 8f

        17 99 14 26 72 4e b0 90  1b ad cf 74 1c 48 d7 91

        62 3a cc 5c 1f 97 a6 ab  7d c9 d1 dd cb 89 4d 89

        bb d1 ec 89 a9 f8 a7 23  4e ec 76 c4 0a 2c 67 4d

        93 1d 5a 6f 62 2e 01 4e  08 a9 55 6c dc c2 e0 4f

        6e bb b2 00 38 b7 4b 9b  a1 76 8b ac 99 d2 ce 69

        95 a6 2d 8e f5 35 93 a4  e9 22 f6 16 8c 86 28 a7

        fa 5c aa dd 19 17 8c a3  5f ed ef c3 76 a7 2b 29

        45 5d 71 66 6a 60 31 8c  a4 18 c1 43 69 48 40 61

        6a 60 b9 e3 a7 64 d2 ff  7e bc 3c 5b 7d 25 1c eb

        1c 45 31 1f 04 4c c9 85  69 bf 81 b4 8b 05 bb 14

        23 85 b5 a2 33 84 8f 49  e2 f8 ee 44 cc 13 fe c9

        ee b4 c3 38 35 fd 6b 6a  e0 1e a0 fe 65 32 d2 6a

        28 47 6a 90 7a 72 6a a0  0c 52 87 40 f9 d9 67 b0

        f4 0f 93 11 eb 2d a0 fc  45 22 a7 6c f3 41 1e 9d

        af 5d 43 09 bc 4f 0d 7c  4f e7 87 74 f5 a7 93 d8

        8e 2f be 3c a1 7b 3c 29  84 b6 9a 47 0a 9d 23 5c

        4c d6 75 d5 3c 7a 4b 51  b0 88 a4 c1 88 f3 c2 d8

        33 71 4e d7 74 29 45 f1  75 4d 22 bb b5 cb 0e 13

        de 9c 34 ae 91 90 fd cd  6d ed c8 0f 4a 2a 9f 9e

        f7 fd 42 1f 48 0f cc bd  5b 4b 85 9c 3f 26 8f 6b

        fc de 87 d0 a3 3e 23 4f  df ec 48 1e 01 f2 fc 03

        f2 7c 71 56 9e f7 af 8f  e4 39 73 88 f0 1f 40 9e

        f7 cf ce 33 27 92 e7 07  c8 f3 3a e4 79 ed ec 3c

        37 44 f2 7c 09 79 5e 80  3c ad 7a 1e 56 27 19 ea

        f4 37 80 ac 03 c8 53 3e  1c 63 71 32 91 85 75 84

        ce 5a d9 12 0e 18 33 4f  64 87 2c 88 02 cc 80 02

OOB:

        30 7e 0e ff ff ff ff ff

        ce 74 26 ff ff ff ff ff

        d0 84 26 ff ff ff ff ff

        41 c9 35 ff ff ff ff ff

        2d 68 01 ff ff ff ff ff

        aa ac 1a ff ff ff ff ff

        30 81 09 ff ff ff ff ff

        45 2c 22 ff ff ff ff ff

 

The values in nand flash is the same uImage I load to 0x1000000.  But If I read to ram 0x2000000 , the values are changed.

 

So when I bootm 0x2000000 , it will show "Verifying Checksum ... Bad Data CRC". 

 

Why are the values changed?

 

Hank

TranslateQuoteReplyEditDelete

 

 

2010-04-16 06:22:36     Re: Flash uImage to Nand Flash on BF526

Vivi Li (CHINA)

Message: 88518   

 

I've report a bug about this, please follow the link bellow:

 

https://blackfin.uclinux.org/gf/project/toolchain/tracker/?action=TrackerItemEdit&tracker_id=145&tracker_item_id=6008

 

-Vivi

QuoteReplyEditDelete

 

 

2010-05-06 13:35:24     Re: Flash uImage to Nand Flash on BF526

Mike Frysinger (UNITED STATES)

Message: 89192   

 

this patch should fix things:

http://blackfin.uclinux.org/gf/project/u-boot/scmsvn/?action=browse&path=/&view=rev

QuoteReplyEditDelete

 

 

2010-05-07 02:00:32     Re: Flash uImage to Nand Flash on BF526

Hank Lee (TAIWAN)

Message: 89209   

 

Hi Mike,

 

I copy this file "bfin_nand.c" you modify to SVN 2010.03 and rebuild U-boot. ( only modify define CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND on include/configs/bf526-ezbrd.h)

 

But still have this issue , I can't fix this issue.  Why?

 

Hank

TranslateQuoteReplyEditDelete

 

 

2010-05-07 15:17:45     Re: Flash uImage to Nand Flash on BF526

Mike Frysinger (UNITED STATES)

Message: 89238   

 

use the latest trunk version

QuoteReplyEditDelete

 

 

2010-05-09 22:53:54     Re: Flash uImage to Nand Flash on BF526

Hank Lee (TAIWAN)

Message: 89269   

 

I tested pass with svn-2269 version.

 

Thank you.

Attachments

    Outcomes