* [U-Boot] Can't read kernel if bad blocks are present in partition
@ 2012-04-26 11:27 Alexandre Gambier
2012-04-26 17:11 ` Peter Barada
0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Gambier @ 2012-04-26 11:27 UTC (permalink / raw)
To: u-boot
Hi,
I'm working on a STM chip under linux and U-Boot 1.3.1.
Here's my problem.
To boot linux up I load the kernel stored in a NAND device. If a bad
block is present in the nand I can't load the kernel.
To store the kernel I first erase the partition and write the kernel image.
During the erase stage, U-Boottells that a bad block has been skipped
but everything's fine.
NAND erase: device 0 offset 0x520000, size 0x400000
Skipping bad block at 0x005c0000
Erasing at 0x900000 -- 100% complete.
OK
When I write the kernel image, U-Boottells that everything's fine.
NAND write: device 0 offset 0x520000, size 0x400000
4194304 bytes written: OK
But when I try to read the kernel, it fails.
NAND read: device 0 offset 0x520000, size 0x1a4bff
1723391 bytes read: ERROR
I though U-Boot was able to handle bad block when reading back data..
Did I forget to initialize something ?
BEst regards.
--
Best regards.
Alexandre Gambier
Fte Maximal France SAS
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] Can't read kernel if bad blocks are present in partition
2012-04-26 11:27 [U-Boot] Can't read kernel if bad blocks are present in partition Alexandre Gambier
@ 2012-04-26 17:11 ` Peter Barada
2012-04-26 19:28 ` Scott Wood
0 siblings, 1 reply; 8+ messages in thread
From: Peter Barada @ 2012-04-26 17:11 UTC (permalink / raw)
To: u-boot
On 04/26/2012 07:27 AM, Alexandre Gambier wrote:
> Hi,
>
> I'm working on a STM chip under linux and U-Boot 1.3.1.
>
> Here's my problem.
> To boot linux up I load the kernel stored in a NAND device. If a bad
> block is present in the nand I can't load the kernel.
>
> To store the kernel I first erase the partition and write the kernel image.
> During the erase stage, U-Boottells that a bad block has been skipped
> but everything's fine.
>
> NAND erase: device 0 offset 0x520000, size 0x400000
> Skipping bad block at 0x005c0000
> Erasing at 0x900000 -- 100% complete.
> OK
>
> When I write the kernel image, U-Boottells that everything's fine.
>
> NAND write: device 0 offset 0x520000, size 0x400000
> 4194304 bytes written: OK
>
> But when I try to read the kernel, it fails.
>
> NAND read: device 0 offset 0x520000, size 0x1a4bff
> 1723391 bytes read: ERROR
>
>
> I though U-Boot was able to handle bad block when reading back data..
>
> Did I forget to initialize something ?
>
Did you use "nand write.i" to write the kernel and "nand read.i" to
read the kernel? the ".i" tells u-boot to skip bad blocks...
--
Peter Barada
peter.barada at logicpd.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] Can't read kernel if bad blocks are present in partition
2012-04-26 17:11 ` Peter Barada
@ 2012-04-26 19:28 ` Scott Wood
2012-04-27 7:16 ` Alexandre Gambier
0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2012-04-26 19:28 UTC (permalink / raw)
To: u-boot
On 04/26/2012 12:11 PM, Peter Barada wrote:
> On 04/26/2012 07:27 AM, Alexandre Gambier wrote:
>> Hi,
>>
>> I'm working on a STM chip under linux and U-Boot 1.3.1.
>>
>> Here's my problem.
>> To boot linux up I load the kernel stored in a NAND device. If a bad
>> block is present in the nand I can't load the kernel.
>>
>> To store the kernel I first erase the partition and write the kernel image.
>> During the erase stage, U-Boottells that a bad block has been skipped
>> but everything's fine.
>>
>> NAND erase: device 0 offset 0x520000, size 0x400000
>> Skipping bad block at 0x005c0000
>> Erasing at 0x900000 -- 100% complete.
>> OK
>>
>> When I write the kernel image, U-Boottells that everything's fine.
>>
>> NAND write: device 0 offset 0x520000, size 0x400000
>> 4194304 bytes written: OK
>>
>> But when I try to read the kernel, it fails.
>>
>> NAND read: device 0 offset 0x520000, size 0x1a4bff
>> 1723391 bytes read: ERROR
>>
>>
>> I though U-Boot was able to handle bad block when reading back data..
>>
>> Did I forget to initialize something ?
>>
> Did you use "nand write.i" to write the kernel and "nand read.i" to
> read the kernel? the ".i" tells u-boot to skip bad blocks...
That has been the default for a while now. Why use something as ancient
as 1.3.1?
-Scott
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] Can't read kernel if bad blocks are present in partition
2012-04-26 19:28 ` Scott Wood
@ 2012-04-27 7:16 ` Alexandre Gambier
2012-04-27 14:29 ` Peter Barada
2012-04-27 17:43 ` Scott Wood
0 siblings, 2 replies; 8+ messages in thread
From: Alexandre Gambier @ 2012-04-27 7:16 UTC (permalink / raw)
To: u-boot
Hi,
>> Did you use "nand write.i" to write the kernel and "nand read.i" to
>> read the kernel? the ".i" tells u-boot to skip bad blocks...
No I use "nand read $load_addr AppKernel" cause I didn't know we can use
"nand read.i" - "help nand" doesn't display this information.
I tried "nand read.i" and now it works fine but I still can't boot the
kernel cause its crc is wrong I will flash the kernel again with "nand
write.i" and check if it works.
> That has been the default for a while now. Why use something as ancient
> as 1.3.1?
Because my embedded linux distribution is STLinux which includes support
for STM chips with this version of u-boot.
Alex.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] Can't read kernel if bad blocks are present in partition
2012-04-27 7:16 ` Alexandre Gambier
@ 2012-04-27 14:29 ` Peter Barada
2012-04-27 17:39 ` Scott Wood
2012-04-27 17:43 ` Scott Wood
1 sibling, 1 reply; 8+ messages in thread
From: Peter Barada @ 2012-04-27 14:29 UTC (permalink / raw)
To: u-boot
On 04/27/2012 03:16 AM, Alexandre Gambier wrote:
> Hi,
>
>
>>> Did you use "nand write.i" to write the kernel and "nand read.i" to
>>> read the kernel? the ".i" tells u-boot to skip bad blocks...
> No I use "nand read $load_addr AppKernel" cause I didn't know we can use
> "nand read.i" - "help nand" doesn't display this information.
> I tried "nand read.i" and now it works fine but I still can't boot the
> kernel cause its crc is wrong I will flash the kernel again with "nand
> write.i" and check if it works.
Assuming you load the kernel to ram with tftp (and that "AppKernel" is
an mtdparts partition in NAND), then you could do:
nand erase.part AppKernel
tftp $load_addr uImage
crc32 $load_addr $filesize
nand write.i $load_addr AppKernel $filesize
nand read.i $load_addr AppKernel $filesize
crc32 $load_addr $filesize
To verify the CRCs match between what you load off tftp and what you
read back from NAND.
--
Peter Barada
peter.barada at logicpd.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] Can't read kernel if bad blocks are present in partition
2012-04-27 14:29 ` Peter Barada
@ 2012-04-27 17:39 ` Scott Wood
2012-05-02 6:55 ` Alexandre Gambier
0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2012-04-27 17:39 UTC (permalink / raw)
To: u-boot
On 04/27/2012 09:29 AM, Peter Barada wrote:
> On 04/27/2012 03:16 AM, Alexandre Gambier wrote:
>> Hi,
>>
>>
>>>> Did you use "nand write.i" to write the kernel and "nand read.i" to
>>>> read the kernel? the ".i" tells u-boot to skip bad blocks...
>> No I use "nand read $load_addr AppKernel" cause I didn't know we can use
>> "nand read.i" - "help nand" doesn't display this information.
>> I tried "nand read.i" and now it works fine but I still can't boot the
>> kernel cause its crc is wrong I will flash the kernel again with "nand
>> write.i" and check if it works.
> Assuming you load the kernel to ram with tftp (and that "AppKernel" is
> an mtdparts partition in NAND), then you could do:
>
> nand erase.part AppKernel
> tftp $load_addr uImage
> crc32 $load_addr $filesize
> nand write.i $load_addr AppKernel $filesize
> nand read.i $load_addr AppKernel $filesize
> crc32 $load_addr $filesize
>
> To verify the CRCs match between what you load off tftp and what you
> read back from NAND.
There is no U-Boot version that both has "nand erase.part" and requires
a .i suffix on nand read/write.
-Scott
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] Can't read kernel if bad blocks are present in partition
2012-04-27 7:16 ` Alexandre Gambier
2012-04-27 14:29 ` Peter Barada
@ 2012-04-27 17:43 ` Scott Wood
1 sibling, 0 replies; 8+ messages in thread
From: Scott Wood @ 2012-04-27 17:43 UTC (permalink / raw)
To: u-boot
On 04/27/2012 02:16 AM, Alexandre Gambier wrote:
> Hi,
>
>
>>> Did you use "nand write.i" to write the kernel and "nand read.i" to
>>> read the kernel? the ".i" tells u-boot to skip bad blocks...
> No I use "nand read $load_addr AppKernel" cause I didn't know we can use
> "nand read.i" - "help nand" doesn't display this information.
> I tried "nand read.i" and now it works fine but I still can't boot the
> kernel cause its crc is wrong I will flash the kernel again with "nand
> write.i" and check if it works.
>
>> That has been the default for a while now. Why use something as ancient
>> as 1.3.1?
> Because my embedded linux distribution is STLinux which includes support
> for STM chips with this version of u-boot.
Does STLinux have a support contact?
This list is for mainline U-Boot. Have you checked whether these chips
are supported in current mainline U-Boot?
-Scott
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] Can't read kernel if bad blocks are present in partition
2012-04-27 17:39 ` Scott Wood
@ 2012-05-02 6:55 ` Alexandre Gambier
0 siblings, 0 replies; 8+ messages in thread
From: Alexandre Gambier @ 2012-05-02 6:55 UTC (permalink / raw)
To: u-boot
>> Assuming you load the kernel to ram with tftp (and that "AppKernel" is
>> an mtdparts partition in NAND), then you could do:
>>
>> nand erase.part AppKernel
>> tftp $load_addr uImage
>> crc32 $load_addr $filesize
>> nand write.i $load_addr AppKernel $filesize
>> nand read.i $load_addr AppKernel $filesize
>> crc32 $load_addr $filesize
>>
>> To verify the CRCs match between what you load off tftp and what you
>> read back from NAND.
Everything works fine now.
I now use "nand write.i" and "nand read.i" instead of "nand write" and
"nand.read".
>> Does STLinux have a support contact?
>>
>> This list is for mainline U-Boot. Have you checked whether these chips
>> are supported in current mainline U-Boot?
It was just a misunderstanding of u-boot commands.
Thank you guys for your help.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-05-02 6:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26 11:27 [U-Boot] Can't read kernel if bad blocks are present in partition Alexandre Gambier
2012-04-26 17:11 ` Peter Barada
2012-04-26 19:28 ` Scott Wood
2012-04-27 7:16 ` Alexandre Gambier
2012-04-27 14:29 ` Peter Barada
2012-04-27 17:39 ` Scott Wood
2012-05-02 6:55 ` Alexandre Gambier
2012-04-27 17:43 ` Scott Wood
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.