NAS 540 won't boot

Options
BjoWis
BjoWis Posts: 33  Freshman Member
10 Comments Friend Collector
Hi,

My NAS540 won't boot properly and I have hooked up the serial port and exported the bootlog. Can someone please help me fixing the problem?

Any help would be greatly appreciated, since I am quite new to this. 


booting kernel of type uimage from /dev/nand0.kernel1.bb
Bad Header Checksum
 Failed.
booting kernel of type uimage from /dev/nand0.kernel2.bb

Bad Header Checksum

All Replies

  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    As that box is fairly old, I suppose you have upgraded the box at least once, I guess? That means both 'slots' with kernels are filled, and apparently both are damaged. Don't know what that means.
    You can try to tftp a kernel, boot that, and then upgrade the firmware, if the webinterface comes up. If the webinterface doesn't come up, you can use a 'flash stick'
    To tftp a kernel you need a tftp server. Google for that, to find one for your platform. It's a small piece of software.
    In this post you can find the command to pull the kernel from the server, and boot it. Elsewhere in that thread you can find a download link for that kernel.

    BTW, seeing your log, it seems to me barebox is trying to fetch a kernel by tftp:

    warning: No MAC address set. Using random address 3E:25:A4:02:6E:3F

    T T DHCP client bound to address 192.168.1.83
    DHCP client bound to address 192.168.1.83
    T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T

    Those T's are typically timeout messages from a tftp client. So if your dhcp server supports tftp (for instance a router running OpenWrt), you can simply provide the kernel with the right name (which could be found in the tftp server log) and the NAS will automagically fetch a kernel when it can't find one in flash. Network boot!

  • BjoWis
    BjoWis Posts: 33  Freshman Member
    10 Comments Friend Collector
    Options
    Hmm... I've now made some progress, kernel was fetched via tftp. But it runs into some problems when flashing.

    I used the kernel provided by you - renamed it to uImage.520.bin from uImage.520ABAG1C0.bin

    See attached log.

    [033mMount system partition...[0m
    crw-rw----    1 root     root       10,  58 Jul 12  2012 /dev/ubi_ctrl

    ubiattach: error!: cannot attach mtd7
               error 19 (No such device)
    mount: unknown filesystem type 'ubifs'
    NAND Flash Corrupt... 
    the sys-root image /dev/mtdblock7 is currupt !!
    Open /dev/mtd2 void
    Open /dev/mtd2 void
    change boot image and reboot !!
  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    Hmm, there is more wrong than 'just' the kernels in flash. The commandline should specify the flash partitions, which it doesn't. Yours is
    console=ttyS0,115200n8, init=/etc/preinit pcie_gen1_only=yes  mac_addr=,,
    it should be
    console=ttyS0,115200n8, init=/etc/preinit pcie_gen1_only=yes  mac_addr=,, ip=dhcp root=ubi0:rootfs ubi.mtd=2,2048 rootfstype=ubifs rw noinitrd mtdparts=spi0.0:256k(uloader)ro,512k(barebox)ro,256k(env);comcertonand:10M(config),10M(kernel1),110M(rootfs1),10M(kernel2),110M(rootfs2),-(reserved) usb3_internal_clk=yes
    (Both are single lines). Here you can find a serial bootlog of a healthy 540.

    The commandline is build by barebox using it's environment variables. So I *think* you've got a damaged environment. And possibly your kernels aren't damaged at all. Their addresses are also stored in that environment.

    In this thread repairing the environment is discussed. I remember there was also a thread in which tftp was used to transfer a binary dump of a healthy environment partition, and flash is using the bootloader. But I can't find that now. This forum is at the moment painfully slow for me.

  • BjoWis
    BjoWis Posts: 33  Freshman Member
    10 Comments Friend Collector
    Options
    Hmm... now my barebox don't have any LAN?
    Unknown command 'export' - try 'help'
    Disabling eee function of phy 4 ...
    Disabling eee function of phy 6 ...

    Hit any key to stop autoboot:  1
    booting kernel of type uimage from /dev/nand0.kernel1.bb
    Bad Header Checksum
     Failed.
    booting kernel of type uimage from /dev/nand0.kernel2.bb
    Bad Header Checksum
    warning: No MAC address set. Using random address 6A:D6:AC:D9:E7:F7
    phy0: Autonegotiation timeout
    PHY auto-negotiation error
    I've tried the LAN cable on other devices and it's working properly. And the phy command within Barebox  is a bit confusing for a noob like me.
    Barebox-C2K >/ phy
    Usage:
     phy stat                       show all the phy status
     phy init phyno         init the PHYs. For WAN, the PHY no is 4
                                    for LAN, the PHY no to be 0 to set PHY0-3
     phy read phyno reg             read the PHY register
     phy write phyno reg data               write the PHY register
    Any idea?
  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    Have you tried both ports? It is possible that a simple power recycle isn't enough to fully reset the phy. Unplug the powersupply for at least 10 seconds. If that doesn't work I don't know.
    When I remember well the heatsink of the SoC has to be removed to be able to connect the serial port. Did you feel if it's not getting too hot?

  • BjoWis
    BjoWis Posts: 33  Freshman Member
    10 Comments Friend Collector
    Options
    Ok, it might have been some strange yesterday - because when I tried now it works again

    So I tried copy the uImage to a specific address, but that resulted in the following
    Barebox-C2K >/ eth0.ipaddr=192.168.1.191
    Barebox-C2K >/ eth0.serverip=192.168.1.20
    Barebox-C2K >/ tftp -f uImage.520.bin -a 30010000
    tftp: invalid option -- f
    tftp: invalid option -- a
    warning: No MAC address set. Using random address C6:DC:65:89:74:E4
    TFTP from server 192.168.1.20 ('uImage.520.bin' -> '30010000')
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #################################################################
            #
    Barebox-C2K >/ bootm 30010000
    ERROR: out of memory

    TFTP didn't like the options -f and -a
    And I ran out of memory, trying multiple random addresses (80010000, 70010000, 60010000, 50010000) all with the same result "out of memory"
  • Mijzelf
    Mijzelf Posts: 2,645  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    faierbol found them to work, and where I pointed to.
  • BjoWis
    BjoWis Posts: 33  Freshman Member
    10 Comments Friend Collector
    Options
    So @faierbol did you manage to repair environment and the faulty commandline? I have run into the same issue. Any help/guildline would be appreciated.

    Mine is
    console=ttyS0,115200n8, init=/etc/preinit pcie_gen1_only=yes  mac_addr=,,

    While it should be

    console=ttyS0,115200n8, init=/etc/preinit pcie_gen1_only=yes  mac_addr=,, ip=dhcp root=ubi0:rootfs ubi.mtd=2,2048 rootfstype=ubifs rw noinitrd mtdparts=spi0.0:256k(uloader)ro,512k(barebox)ro,256k(env);comcertonand:10M(config),10M(kernel1),110M(rootfs1),10M(kernel2),110M(rootfs2),-(reserved) usb3_internal_clk=yes


Consumer Product Help Center