Welcome! Log In Create A New Profile

Advanced

LaCie NS2 - *** Warning - bad CRC, using default

Posted by dm7000s 
LaCie NS2 - *** Warning - bad CRC, using default
January 10, 2025 01:55PM
Hi!

Updated u-boot, environment variables are lost.
Connected via UART.
After rebooting, the CRC error appears again and the variables are not saved.
Tried commands "env default -a", "saveenv", "env save" - no result.
Ask for advice.

ns2> env default -a
## Resetting to default environment
ns2> saveenv
Saving Environment to SPI Flash... SF: Detected mx25l4005a with page size 256 Bytes, erase size 4 KiB, total 512 KiB
Erasing SPI flash...Writing to SPI flash...done
OK
ns2> env save
Saving Environment to SPI Flash... Erasing SPI flash...Writing to SPI flash...done
OK
ns2> reset

U-Boot 2020.07-rc5-00057-gfce0bb3e2bd8 (Jul 09 2020 - 11:11:59 +0200) NS v2

SoC:   Kirkwood 88F6281_A1
I2C:   ready
DRAM:  256 MiB
Loading Environment from SPI Flash... SF: Detected mx25l4005a with page size 256 Bytes, erase size 4 KiB, total 512 KiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet-controller@72000
88E1116 Initialized on ethernet-controller@72000
Hit any key to stop autoboot:  0
ns2> version
U-Boot 2020.07-rc5-00057-gfce0bb3e2bd8 (Jul 09 2020 - 11:11:59 +0200) NS v2

arm-buildroot-linux-gnueabi-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 8.4.0
GNU ld (GNU Binutils) 2.32
ns2>
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 10, 2025 05:27PM
dm7000s,

> U-Boot 2020.07-rc5-00057-gfce0bb3e2bd8 (Jul 09
> 2020 - 11:11:59 +0200) NS v2

Did you get this u-boot image from somewhere? If you built it, how was this u-boot built? from a clone of u-boot mainline?

And why the commit is at 00057-gfce0bb3e2bd8? If u-boot version is exactly as U-Boot 2020.07-rc5 then the commit is 868fb9969c85ce5a1b33c6bb713c8158c04acee9.

If you can, post the u-boot images: the image you used to flash it, and the current image you can dump after you've logged into Linux.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 11, 2025 09:45AM
Thanks for advise!

u-boot from LaCie project
https://lacie-nas.org/
https://downloads.lacie-nas.org/u-boot/
Attachments:
open | download - u-boot-netspace_v2-2020.07-rc5-00057-gfce0bb3e2bd8.kwb (331.1 KB)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 11, 2025 03:22PM
OK I think it must be a bug in this u-boot version (probably inherited from mainline).

I don't know what changed this u-boot has on top of mainline u-boot. And you're installing using the Debian mainline installer, which we don't use here.

======

You could try my installation using my rootfs.

Boot Kirkwood rootfs with stock u-boot
https://forum.doozan.com/read.php?2,102054,105374#msg-105374

After successful booting into Debian on USB rootfs, we'll save the envs in Debian.

If the problem is what I think it is, there is a work around to get it working.

======

To fix this problem for good, I need to patch the latest u-boot for Lacie boxes. But this requires a tester to test my builds (it's a bit tedious and repetitive), since I don't have the hardware.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 12, 2025 09:46PM
dm7000s,

Try this test.

Power up, interrupt serial console and,
sf probe 0 20000000
and then
env default -a
saveenv
reset

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 09:47AM
ns2> sf probe 0 20000000
SF: Detected mx25l4005a with page size 256 Bytes, erase size 4 KiB, total 512 KiB
ns2> env default -a
## Resetting to default environment
ns2> saveenv
Saving Environment to SPI Flash... Erasing SPI flash...Writing to SPI flash...done
OK
ns2> reset
resetting ...


U-Boot 2020.07-rc5-00057-gfce0bb3e2bd8 (Jul 09 2020 - 11:11:59 +0200) NS v2

SoC:   Kirkwood 88F6281_A1
I2C:   ready
DRAM:  256 MiB
Loading Environment from SPI Flash... SF: Detected mx25l4005a with page size 256 Bytes, erase size 4 KiB, total 512 KiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet-controller@72000
88E1116 Initialized on ethernet-controller@72000
Hit any key to stop autoboot:  0
ns2>



Edited 1 time(s). Last edit at 01/13/2025 10:55AM by dm7000s.
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 11:15AM
Thanks for support!

root@debian:/media/tools# ls
.   busybox  flash_erase    fw_printenv  nandump
..  e2fsck   fw_env.config  nanddump     nandwrite
root@debian:/media/tools# cd ..
root@debian:/media# ls
.       kwboot_2024.04-rc3                     tools
..      kwboot_static_2024.04-rc3              u-boot-netspace_v2-2011.kwb
kwboot  linux-tools-installation-bodhi.tar.gz  u-boot-netspace_v2-2020.07.kwb
root@debian:/media#

rootfs installed and files (stock and new u-boot) copied to /media

fw_env.config
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd0		0xc0000		0x20000		0x20000
Connected via uart

It's correct?
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 11:50AM
Save
root@debian:/media# nanddump  -l 0x80000 -f mtd0 /dev/mtd0
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 4096, page size 1, OOB size 0
Dumping data starting at 0x00000000 and ending at 0x00080000...

root@debian:/media# flash_erase /dev/mtd0 0 4
Erasing 4 Kibyte @ 3000 -- 100 % complete
root@debian:/media# nandwrite /dev/mtd0 u-boot-netspace_v2-2011.kwb
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x1000
...
Written 5049 blocks containing only 0xff bytes
Those block may be incorrectly treated as empty!

Save one more time after fashing...
root@debian:/media# nanddump  -l 0x80000 -f mtd00 /dev/mtd0
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 4096, page size 1, OOB size 0
Dumping data starting at 0x00000000 and ending at 0x00080000...

Both backup files (mtd0 and mtd00, before flashing and after) identical.
Same situation at
https://plugout.net/viewtopic.php?f=11&t=3148&view=previous



Edited 2 time(s). Last edit at 01/13/2025 12:50PM by dm7000s.
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 12:34PM
One more...
u-boot plaxed in chip "mx25l4005a" ?
Flash u-boot by programmer directly?
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 02:01PM
> One more...
> u-boot plaxed in chip "mx25l4005a" ?
> Flash u-boot by programmer directly?

We are not out of option yet! let me build a new u-boot for you to try.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 03:43PM
Attached here is the new u-boot.

uboot.2025.01-tld-1.netspace_v2.kwb
md5sum 
ddd15a49fbd8e83782b9376a483bcf64  uboot.2025.01-tld-1.netspace_v2.kwb

sha256sum 
2bb3f3e7dfbd5d229c04e14a39acca26827ec72d6a82294619a3ce19f1de4c47  uboot.2025.01-tld-1.netspace_v2.kwb

Please try kwboot this image over UART. See here for kwboot example:

https://forum.doozan.com/read.php?3,51739,51919#msg-51919

After it was loaded and run, interrupt serial console countdown and repeat the test. Also good to see what's in the internal envs.

env default -a
saveenv
printenv
reset

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - uboot.2025.01-tld-1.netspace_v2.kwb (361.5 KB)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 05:05PM
Strange situation. Good beginning...

root@user-VirtualBox:/home/user# kwboot  -B 115200 /dev/ttyUSB0 -b u-boot-netspace_v2-2011.12-00260-ga24d58e.kwb -t
kwboot version 2024.01
Detected kwbimage v0 with SPI boot signature
Patching image boot signature to UART
Sending boot message. Please reboot the target.../
Sending boot image header (512 bytes)...
 25 % [....                                                                  ]
Done
Sending boot image data (237468 bytes)...
  0 % [......................................................................]
 98 % [....................................                                  ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]


U-Boot 2011.12-00260-ga24d58e (Feb 17 2012 - 15:48:09) NS v2

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
WARNING: Caches not enabled
SF: Detected MX25L4005 with page size 64 KiB, total 512 KiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0 

ns2> env print
autoload=no
baudrate=115200
bootargs=console=ttyS0,115200
bootcmd=dhcp && run netconsole; if run usbload || run diskload; then bootm; fi
bootdelay=3
bootfile=uImage
diskload=ide reset && ext2load ide 0:1 $loadaddr /boot/$bootfile
ethact=egiga0
ethaddr=00:d0:4b:8f:b1:3f
loadaddr=0x800000
netconsole=set stdin $stdin,nc; set stdout $stdout,nc; set stderr $stderr,nc;
stderr=serial
stdin=serial
stdout=serial
usbload=usb start && fatload usb 0:1 $loadaddr /boot/$bootfile

Environment size: 501/4092 bytes

ns2> env default -f
## Resetting to default environment
ns2> saveenv
Saving Environment to SPI Flash...
SF: Detected MX25L4005 with page size 64 KiB, total 512 KiB
Erasing SPI flash...Writing to SPI flash...done

ns2> version

U-Boot 2011.12-00260-ga24d58e (Feb 17 2012 - 15:48:09) NS v2
arm-marvell-linux-uclibcgnueabi-gcc (crosstool-NG 1.13.2) 4.6.2 20111004 (prerelease)
GNU ld (crosstool-NG 1.13.2) 2.21.53.20110922

ns2> ide reset

Reset IDE: Bus 0: OK 
  Device 0: Model: 240GB SSD  Firm: V3.22  Ser#: H47704J001783 
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 228936.5 MB = 223.5 GB (468862128 x 512)

ns2> ext2load ide 0:1 0x800000 /boot/u-boot-netspace_v2-2011.kwb    
Loading file "/boot/u-boot-netspace_v2-2011.kwb" from ide device 0:1 (hda1)
237814 bytes read

ns2> sf probe 0
SF: Detected MX25L4005 with page size 64 KiB, total 512 KiB

ns2> sf erase 0 0x50000
ns2> sf write 0x800000 0 0x50000
ns2> sf probe 0 20000000
SF: Detected MX25L4005 with page size 64 KiB, total 512 KiB

ns2> sf probe 0 20000000
SF: Detected MX25L4005 with page size 64 KiB, total 512 KiB

ns2> env default -f
## Resetting to default environment

ns2> saveenv
Saving Environment to SPI Flash...
Erasing SPI flash...Writing to SPI flash...done

Enviroment is saved..... and lost uart access from windows and linux termilal. But now I can access via kwboot from linux desktop.
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 05:09PM
That worked for the old 2011u-boot.

Quote

root@user-VirtualBox:/home/user# kwboot -B 115200 /dev/ttyUSB0 -b u-boot-netspace_v2-2011.12-00260-ga24d58e.kwb -t
Done
Finishing transfer
[Type Ctrl-\ + c to quit]

U-Boot 2011.12-00260-ga24d58e (Feb 17 2012 - 15:48:09) NS v2

You did not run the new u-boot. Pease see above for the new u-boot uboot.2025.01-tld-1.netspace_v2.kwb. But still, whatever works is good!

Is the Virtual Box running on a x86 PC?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 01/13/2025 05:15PM by bodhi.
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 05:18PM
dm7000s,

> Save
>
> root@debian:/media# nanddump  -l 0x80000 -f mtd0
> /dev/mtd0
> ECC failed: 0
> ECC corrected: 0
> Number of bad blocks: 0
> Number of bbt blocks: 0
> Block size 4096, page size 1, OOB size 0
> Dumping data starting at 0x00000000 and ending at
> 0x00080000...
>
>
>
> root@debian:/media# flash_erase /dev/mtd0 0 4
> Erasing 4 Kibyte @ 3000 -- 100 % complete
> root@debian:/media# nandwrite /dev/mtd0
> u-boot-netspace_v2-2011.kwb
> Writing data to block 0 at offset 0x0
> Writing data to block 1 at offset 0x1000
> ...
> Written 5049 blocks containing only 0xff bytes
> Those block may be incorrectly treated as empty!
>
>
> Save one more time after fashing...
>
> root@debian:/media# nanddump  -l 0x80000 -f mtd00
> /dev/mtd0
> ECC failed: 0
> ECC corrected: 0
> Number of bad blocks: 0
> Number of bbt blocks: 0
> Block size 4096, page size 1, OOB size 0
> Dumping data starting at 0x00000000 and ending at
> 0x00080000...
>
>
> Both backup files (mtd0 and mtd00, before flashing
> and after) identical.
> Same situation at
> https://plugout.net/viewtopic.php?f=11&t=3148&view=previous

This u-boot has SPI flash, not NAND flash. So the above is not correct.

See the Dreamplug u-boot for example:

https://forum.doozan.com/read.php?3,42359

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 13, 2025 05:22PM
Quote

Enviroment is saved..... and lost uart access from windows and linux termilal. But now I can access via kwboot from linux desktop.

I'll be back for this problem.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 14, 2025 02:06PM
dm7000s,

You lost serial console because it tried to start netconsole.

bootcmd=dhcp && run netconsole; if run usbload || run diskload; then bootm; fi

> root@user-VirtualBox:/home/user# kwboot -B 115200
> /dev/ttyUSB0 -b
> u-boot-netspace_v2-2011.12-00260-ga24d58e.kwb -t
> kwboot version 2024.01

> Enviroment is saved..... and lost uart access from
> windows and linux termilal. But now I can access
> via kwboot from linux desktop.

Rerun kwboot like you did above. And at serial console prompt, before booting to Debian, adjust the bootcmd
setenv bootcmd 'if run usbload || run diskload; then bootm; fi'
saveenv
Or just do a reset, and it will boot the u-boot on flash, since you have flashed it.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 14, 2025 02:22PM
99 % [.................                                                     ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]

U-Boot 2025.01-tld-1-g6311f29e56b9-dirty (Jan 13 2025 - 13:28:18 -0800) NS v2

SoC:   Kirkwood 88F6281_A1
I2C:   Could not initialize timer (err -11)

resetting ...

Quote

Is the Virtual Box running on a x86 PC?
Yes. With transparent clipboad with windows and file transfer.



Edited 2 time(s). Last edit at 01/14/2025 02:27PM by dm7000s.
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 14, 2025 02:50PM
> U-Boot 2025.01-tld-1-g6311f29e56b9-dirty (Jan 13
> 2025 - 13:28:18 -0800) NS v2
>
> SoC: Kirkwood 88F6281_A1
> I2C: Could not initialize timer (err -11)

Ah, this u-boot current config is too old for 2025.01. Let me reconfigure and rebuild it.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 14, 2025 04:24PM
dm7000s,

This u-boot has been neglected for so long. It will take more time than I have to modernize it.

So I'd suggest you stay with the version "U-Boot 2011.12-00260-ga24d58e (Feb 17 2012 - 15:48:09) NS v2".

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 15, 2025 01:55PM
bodhi Wrote:
> So I'd suggest you stay with the version "U-Boot
> 2011.12-00260-ga24d58e (Feb 17 2012 - 15:48:09) NS v2".

Agreed.
For me is faster to extract the eeprom from the board, flash it and return it back. Access via uart is back.
Thanks for the assistance, I will wait for the new version. It is not urgent. It was an interesting experience.
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 16, 2025 08:10AM
I won)))
Read mx25l4005 eeprom via programmer. Make backup.
Load into programmer u-boot-netspace_v2-2020.07-rc5-00057-gfce0bb3e2bd8.kwb
Copy from backup range 0x70000-0x70FFF (environment range) buffer.
Flash eeprom.

In uart terminal change 'ide' to 'sata' load images from tftp and install debian.

ns2> ver
U-Boot 2020.07-rc5-00057-gfce0bb3e2bd8 (Jul 09 2020 - 11:11:59 +0200) NS v2

arm-buildroot-linux-gnueabi-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 8.4.0
GNU ld (GNU Binutils) 2.32
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 17, 2025 12:23AM
> Read mx25l4005 eeprom via programmer. Make
> backup.
> Load into programmer
> u-boot-netspace_v2-2020.07-rc5-00057-gfce0bb3e2bd8.kwb
> Copy from backup range 0x70000-0x70FFF
> (environment range) buffer.

> Flash eeprom.

Nice! Which frequency the flashing was done?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: LaCie NS2 - *** Warning - bad CRC, using default
January 17, 2025 06:20AM
bodhi Wrote:
-------------------------------------------------------
>frequency the flashing was done?

Default 16MHz
Programmer TL866II Prus with stock software Xgpro v12.67
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: