[U-Boot] Warning Bad CRC

Rahanesh rahanesh at tataelxsi.co.in
Tue Sep 22 07:48:49 CEST 2009


Wolfgang Denk wrote:
> Dear Rahanesh,
>
> In message <4AB786B9.4080000 at tataelxsi.co.in> you wrote:
>   
>> U-Boot 1.1.2 (Sep 19 2009 - 10:26:28)
>>
>> Board: IAD CPU Speed 200 MHz
>> DRAM:  32 MB
>> sflash.c:266:DF_F_DataflashProbe: Entered
>> sflash.c:269:DF_F_DataflashProbe: flash type is 0x1
>> sflash.c:270:DF_F_DataflashProbe: num pages 32768
>> DataFlash:Nb pages:  32768
>> Page Size:    256
>> Size=3D 8388608 bytes
>> Logical address: 0xAD000000
>> Nb Erase Blocks:    128
>> Erase Block Size:  65536
>> Area 0: AD000000 to AD003FFF
>> Area 1: AD004000 to AD03FFFF
>> Area 2: AD040000 to AD30BFFF
>> Area 3: AD30C000 to AD7FFFFF
>> got bad crc. got:0x603b0489, expected:0x0
>> *** Warning - bad CRC, using default environment
>>     
>
> Ah! Here you can see that the CRC is incorrect in U-Boot already, so
> why do you expect to see a different result when using fw_printenv?
>
> WHen the CRC _is_ incorrect, both U-Boot and fw_printenv will report
> this fact in the same way.
>   
 The message is printed because the flash sector or ERPROM containing 
the environment variables has never been initialized yet. The message 
will go away as soon as you save the envrionment variables using the 
|*saveenv*| command.
>   
>> *Print message after execution of saveenv command from uboot :
>>
>> *Saving Environment to dataflash...
>> copy 0xad030000-0xad040000 to saveenv-buf 0x80100000.
>> erasing 0xad030000 - 0xad03ffff
>> Erasing sectors 0x3 to 0x3
>> sflash.c:69:DF_F_PageErase: erasing page: 0x3
>> done erasingsflash.c:164:DF_F_DataFlashWrite: write: src 0x80100000, dst=20
>> 0x30000, size 0x10000
>>     
>
> I have no idea what sort of code you might be using there, there is no
> such file as 'sflash.c' in the mainline U-Boot code.
>   
     sflash.c is flash driver code . I  showed you the print message of 
savenev to note that it is erasing 0xad030000 - 0xad03ffff. That means
     environment variables are placed in the mentioned sector(0xad030000 
- 0xad03ffff). Actual address of environment variables is 0xad03f000, 
which is last 4Kb
     of  64KB sector. If this is the case what should be the 
DEVICE_OFFSET? ENV_SIZE?

Using the latest u-boot will be quite time consuming. Please help!!!

Thanks
Rahanesh






More information about the U-Boot mailing list