NAS542: How do I establish serial connection?

24

All Replies

  • bugblatterbeast
    bugblatterbeast Posts: 30  Freshman Member
    edited December 2021
    I've noticed that I haven't given a proper description of what exactly is happening at the moment. So just to be sure not to leave out any vital information:
    1. I press power button and the power LED goes on
    2. After a little more then 5 sec all 4 disk LEDs go on
    3. After a little more then 15 sec (from 1. power button) the fan stops shortly and then the cycle restarts
    4. At around 6 or 7 seconds after the 12th cycle has started, the fan and all LEDs go off for aprox 5 sec (then it all starts again)
  • bugblatterbeast
    bugblatterbeast Posts: 30  Freshman Member
    Mijzelf Thank you very much for your help so far.

    I have to wait until the new usb2serial I've ordered arrives (the one I have is 5V only). I'd highly appreciate if you could help me with further investigations then.
  • bugblatterbeast
    bugblatterbeast Posts: 30  Freshman Member
    Mijzelf said:
    Did you flash another kernel before? As 3.2.102-1 shouldn't try to load from /lib/modules/3.2.0-6, so it seems it switched kernel, and the rootfs doesn't provide the right modules. You could try to extract the 3.2.0-6 modules from an older rootfs, and put them in the right place.

    What your saying sounds absolutely reasonable but strange as it may seems, it looks as though the 3.2.102-1 kernel does indeed load from /lib/modules/3.2.0-6



    What I found out so far is that comcerto_wdt used to be a build-in-module but that particular kernel doesn't seem to have it listed anymore.

    At this ftp directory http://seafile.servator.de/nas/zyxel/kernel/ there are three kernels available for nas5xx (not regarding HISTORY):

    linux-image-3.2.96-3-nas5xx-armhf.zip2018-03-10 20:0214M
    linux-image-3.2.102-1-20210307-nas5xx-armhf.zip2019-03-07 01:5814M
    linux-image-3.2.102-1-nas5xx-armhf.zip2021-08-05 23:3714M

    Two of them have "kernel/drivers/watchdog/comcerto_wdt.ko" listed as a build in module, but the newest one of them (the one with the timestamp 2021-08-05 23:37 14M) doesn't.
  • Mijzelf
    Mijzelf Posts: 2,768  Guru Member
    250 Answers 2500 Comments Friend Collector Seventh Anniversary
    Ah right. I opened that linux-image-3.2.102-1-20210307-nas5xx-armhf.zip, and it contains a /boot/vmlinuz-3.2.0-6-nas5xx, and a /lib/modules/3.2.0-6-nas5xx/ . In which the watchdog driver is indeed marked build-in.
    So that '102' is not a kernel version, it is just a 'general confuser'.
    Two of them have "kernel/drivers/watchdog/comcerto_wdt.ko" listed as a build in module, but the newest one of them (the one with the timestamp 2021-08-05 23:37 14M) doesn't.
    I don't see that. In the 2021-08-05 I see still kernel/drivers/watchdog/comcerto_wdt.ko listed, in a modules.builtin stamped 2021-08-05.

    Yet the lack of the watchdog driver can cause serious problems, when you flashed the kernel. The box has 'double flash', and the bootloader switches flash when boot doesn't succeed. Don't know how it detects that, but a forced reboot by watchdog could certainly be a trigger. In that case the bootloader will try to boot the kernel in 'the other half', which might be problematic either.

    BTW, I just checked the stock kernel has also the watchdog driver builtin.

  • bugblatterbeast
    bugblatterbeast Posts: 30  Freshman Member


    Mijzelf said:
    Did you flash another kernel before? As 3.2.102-1 shouldn't try to load from /lib/modules/3.2.0-6, so it seems it switched kernel, and the rootfs doesn't provide the right modules. You could try to extract the 3.2.0-6 modules from an older rootfs, and put them in the right place.

    What your saying sounds absolutely reasonable but strange as it may seems, it looks as though the 3.2.102-1 kernel does indeed load from /lib/modules/3.2.0-6



    PS: I am having trouble posting this comment... I've just scaled down the image. Hope it helps.

    EDIT: I removed some stuff from this post because I was totally wrong, thinking that the module was missing in the newest kernel.

    That watchdog timer is listed as a buildin module.
    3.2.0-6-nas5xx/modules.builtin:150:kernel/drivers/watchdog/comcerto_wdt.ko



  • bugblatterbeast
    bugblatterbeast Posts: 30  Freshman Member
    This is strange:
    Mijzelf said:
    Two of them have "kernel/drivers/watchdog/comcerto_wdt.ko" listed as a build in module, but the newest one of them (the one with the timestamp 2021-08-05 23:37 14M) doesn't.
    I don't see that. In the 2021-08-05 I see still kernel/drivers/watchdog/comcerto_wdt.ko listed, in a modules.builtin stamped 2021-08-05.

    I don't know why that's in the forum again. I've edited that right after posting it, because I've realised I was wrong.

    EDIT: I removed some stuff from this post because I was totally wrong, thinking that the module was missing in the newest kernel.

     But that was Friday last week. Why does the post re-appear with today's timestamp at 1:01 ??? I didn't even log in at that time.

    Right now the edited version of this post reappeared again????

    This is most definately the 12th post I'm writing but the forum says it's the 14th. I'm better not editing posts anymore. I hope that this problem won't continue.
  • bugblatterbeast
    bugblatterbeast Posts: 30  Freshman Member
    I did not post at 12:01 AM and I did not post at 10:27 AM. Also it is very challenging that this forum is pre-filling this text-area with cached content that's already posted (well, maybe it's just an issue with my browser).

    On more important matters: I am still waiting for the new usb2serial cable. I hope it will arrive soon.
  • bugblatterbeast
    bugblatterbeast Posts: 30  Freshman Member
    The usb2serial finally arrived!



    This seems to be the most interesting information that I've got so far:
    booting kernel of type uimage from /dev/nand0.kernel2.bb
    
       Verifying Checksum ... Bad Data CRC
     Failed.
    
    booting kernel of type uimage from /dev/nand0.kernel1.bb
    
    ERROR: out of memory
    



    Here is the complete log:
    =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2021.12.14 16:52:40 =~=~=~=~=~=~=~=~=~=~=~=
       
    
    uloader 2011.06.0 (May 20 2014 - 16:36:41)
    
    Board: Mindspeed C2000
    c2k_spi_probe
    
    Copying Barebox from SPI Flash(bootopt=0)
    BB Copying Done
    ## Starting Barebox at 0x01000000 ...
    
    
    barebox 2011.06.0-svn44305-dirty6 (Aug 28 2014 - 22:25:22)
    
    Board: Mindspeed C2000
    c2k_spi_probe
    c2k_otp_probe.
    cbus_baseaddr: 9c000000, ddr_baseaddr: 03800000, ddr_phys_baseaddr: 03800000
    class init complete
    tmu init complete
    bmu1 init: done
    bmu2 init: done
    util init complete
    GPI1 init complete
    GPI2 init complete
    HGPI init complete
    HIF rx desc: base_va: 03e80000, base_pa: 03e80000
    HIF tx desc: base_va: 03e80400, base_pa: 03e80400
    HIF init complete
    bmu1 enabled
    bmu2 enabled
    pfe_hw_init: done
    pfe_firmware_init
    pfe_load_elf
    pfe_load_elf no of sections: 10
    pfe_firmware_init: class firmware loaded
    pfe_load_elf
    pfe_load_elf no of sections: 10
    pfe_firmware_init: tmu firmware loaded
    pfe_load_elf
    pfe_load_elf no of sections: 14
    pfe_firmware_init: util firmware loaded
    eth_port: 0
    NAS540_phy_reg_setting[eth_port].phyaddr: 0x4
    miidev_restart_aneg for PHY4
    eth_port: 1
    NAS540_phy_reg_setting[eth_port].phyaddr: 0x6
    miidev_restart_aneg for PHY6
    cfi_probe: cfi_flash base: 0xc0000000 size: 0x04000000
    ## Unknown FLASH on Bank at 0xc0000000 - Size = 0x00000000 = 0 MB
    bootopt = 0x0
    Using ENV from SPI Flash.
    nand_probe: comcerto_nand base: 0xc8300000 size: 0x256 MB
    NAND device: Manufacturer ID: 0x98, Chip ID: 0xda (Toshiba NAND 256MiB 3,3V 8-bit), page size: 2048, OOB size: 64
    Using default values 
    Bad block table not found for chip 0
    Bad block table not found for chip 0
    Scanning device for bad blocks
    Bad eraseblock 1536 at 0x0c000000
    Bad eraseblock 1537 at 0x0c020000
    Bad block table written to 0x0ffe0000, version 0x01
    Bad block table written to 0x0ffc0000, version 0x01
    Malloc space: 0x00600000 -> 0x01000000 (size 10 MB)
    Stack space : 0x005f8000 -> 0x00600000 (size 32 kB)
    running /env/bin/init...
    Unknown command 'export' - try 'help'
    Disabling eee function of phy 4 ...
    
    Disabling eee function of phy 6 ...
    
    Hit any key to stop autoboot:  3   2   1   0
    booting kernel of type uimage from /dev/nand0.kernel2.bb
    
       Verifying Checksum ... Bad Data CRC
     Failed.
    
    booting kernel of type uimage from /dev/nand0.kernel1.bb
    
    ERROR: out of memory
    
    
    
    
    uloader 2011.06.0 (May 20 2014 - 16:36:41)
    
    Board: Mindspeed C2000
    c2k_spi_probe
    
    Copying Barebox from SPI Flash(bootopt=0)
    BB Copying Done
    ## Starting Barebox at 0x01000000 ...
    
    
    barebox 2011.06.0-svn44305-dirty6 (Aug 28 2014 - 22:25:22)
    
    Board: Mindspeed C2000
    c2k_spi_probe
    c2k_otp_probe.
    cbus_baseaddr: 9c000000, ddr_baseaddr: 03800000, ddr_phys_baseaddr: 03800000
    class init complete
    tmu init complete
    bmu1 init: done
    bmu2 init: done
    util init complete
    GPI1 init complete
    GPI2 init complete
    HGPI init complete
    HIF rx desc: base_va: 03e80000, base_pa: 03e80000
    HIF tx desc: base_va: 03e80400, base_pa: 03e80400
    HIF init complete
    bmu1 enabled
    bmu2 enabled
    pfe_hw_init: done
    pfe_firmware_init
    pfe_load_elf
    pfe_load_elf no of sections: 10
    pfe_firmware_init: class firmware loaded
    pfe_load_elf
    pfe_load_elf no of sections: 10
    pfe_firmware_init: tmu firmware loaded
    pfe_load_elf
    pfe_load_elf no of sections: 14
    pfe_firmware_init: util firmware loaded
    eth_port: 0
    NAS540_phy_reg_setting[eth_port].phyaddr: 0x4
    miidev_restart_aneg for PHY4
    eth_port: 1
    NAS540_phy_reg_setting[eth_port].phyaddr: 0x6
    miidev_restart_aneg for PHY6
    cfi_probe: cfi_flash base: 0xc0000000 size: 0x04000000
    ## Unknown FLASH on Bank at 0xc0000000 - Size = 0x00000000 = 0 MB
    bootopt = 0x0
    Using ENV from SPI Flash.
    nand_probe: comcerto_nand base: 0xc8300000 size: 0x256 MB
    NAND device: Manufacturer ID: 0x98, Chip ID: 0xda (Toshiba NAND 256MiB 3,3V 8-bit), page size: 2048, OOB size: 64
    Using default values 
    Bad block table not found for chip 0
    Bad block table not found for chip 0
    Scanning device for bad blocks
    Bad eraseblock 1536 at 0x0c000000
    Bad eraseblock 1537 at 0x0c020000
    Bad block table written to 0x0ffe0000, version 0x01
    Bad block table written to 0x0ffc0000, version 0x01
    Malloc space: 0x00600000 -> 0x01000000 (size 10 MB)
    Stack space : 0x005f8000 -> 0x00600000 (size 32 kB)
    running /env/bin/init...
    Unknown command 'export' - try 'help'
    Disabling eee function of phy 4 ...
    
    Disabling eee function of phy 6 ...
    
    Hit any key to stop autoboot:  3   2   1
    booting kernel of type uimage from /dev/nand0.kernel2.bb
    
       Verifying Checksum ... Bad Data CRC
     Failed.
    
    booting kernel of type uimage from /dev/nand0.kernel1.bb
    
    ERROR: out of memory
    
    
    
    
    uloader 2011.06.0 (May 20 2014 - 16:36:41)
    
    Board: Mindspeed C2000
    c2k_spi_probe
    
    Copying Barebox from SPI Flash(bootopt=0)
    BB Copying Done
    ## Starting Barebox at 0x01000000 ...
    
    
    barebox 2011.06.0-svn44305-dirty6 (Aug 28 2014 - 22:25:22)
    
    Board: Mindspeed C2000
    c2k_spi_probe
    c2k_otp_probe.
    cbus_baseaddr: 9c000000, ddr_baseaddr: 03800000, ddr_phys_baseaddr: 03800000
    class init complete
    tmu init complete
    bmu1 init: done
    bmu2 init: done
    util init complete
    GPI1 init complete
    GPI2 init complete
    HGPI init complete
    HIF rx desc: base_va: 03e80000, base_pa: 03e80000
    HIF tx desc: base_va: 03e80400, base_pa: 03e80400
    HIF init complete
    bmu1 enabled
    bmu2 enabled
    pfe_hw_init: done
    pfe_firmware_init
    pfe_load_elf
    pfe_load_elf no of sections: 10
    pfe_firmware_init: class firmware loaded
    pfe_load_elf
    pfe_load_elf no of sections: 10
    pfe_firmware_init: tmu firmware loaded
    pfe_load_elf
    pfe_load_elf no of sections: 14
    pfe_firmware_init: util firmware loaded
    eth_port: 0
    NAS540_phy_reg_setting[eth_port].phyaddr: 0x4
    miidev_restart_aneg for PHY4
    eth_port: 1
    NAS540_phy_reg_setting[eth_port].phyaddr: 0x6
    miidev_restart_aneg for PHY6
    cfi_probe: cfi_flash base: 0xc0000000 size: 0x04000000
    ## Unknown FLASH on Bank at 0xc0000000 - Size = 0x00000000 = 0 MB
    bootopt = 0x0
    Using ENV from SPI Flash.
    nand_probe: comcerto_nand base: 0xc8300000 size: 0x256 MB
    NAND device: Manufacturer ID: 0x98, Chip ID: 0xda (Toshiba NAND 256MiB 3,3V 8-bit), page size: 2048, OOB size: 64
    Using default values 
    Bad block table not found for chip 0
    Bad block table not found for chip 0
    Scanning device for bad blocks
    Bad eraseblock 1536 at 0x0c000000
    Bad eraseblock 1537 at 0x0c020000
    Bad block table written to 0x0ffe0000, version 0x01
    Bad block table written to 0x0ffc0000, version 0x01
    Malloc space: 0x00600000 -> 0x01000000 (size 10 MB)
    Stack space : 0x005f8000 -> 0x00600000 (size 32 kB)
    running /env/bin/init...
    Unknown command 'export' - try 'help'
    Disabling eee function of phy 4 ...
    
    Disabling eee function of phy 6 ...
    
    Hit any key to stop autoboot:  3   2   1
    usage: update -t <kernel|rootfs|barebox|bareboxenv> -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] -c
    
    update tools.
    
    options
    
     -c     to check the crc32 for the image and flashed one
    
    default mode is tftp
    
    type update -t uloader -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update uloader into flash
    
    type update -t barebox -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update barebox into flash
    
    type update -t kernel -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update kernel into flash
    
    type update -t rootfs -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update rootfs into flash
    
    type update -t bareboxenv -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] to update bareboxenv into flash
    
    Barebox-C2K >/  


    Now I'm a bit afraid to make things even worse. I am considering to try what chrismxnr did here https://community.zyxel.com/en/discussion/7134/debian-omv-on-nas540-gone-wrong#Comment_21535, but I'd like to understand the situation a little better before I do.

    Best regards
  • bugblatterbeast
    bugblatterbeast Posts: 30  Freshman Member
    Now I've switched the firmware doing
    Barebox-C2K >/ env/bin/b1
    And then after the boot
    # /firmware/sbin/info_setenv next_bootfrom 1
    like chrismxnr wrote in his post.

    After that my device is booting again. It's still not functional though... When I start it up with no disks attached, it keeps beeping and even though ethernet seems to be up, I can't connect.

    When I boot the debian-installer I can connect via http and ssl. Openmediavault is running but I can't log in (error 500) - same as last time. I had to update the kernel before I was able to log in.


    I've still got a few questions before I try to flash the kernel again.

    Like, what did I do wrong the last time? If something goes wrong again, will I always have a chance to make the system bootable with the serial connection?

    Btw: I've logged everything but it's way too much to post here.

    Best regards
  • Mijzelf
    Mijzelf Posts: 2,768  Guru Member
    250 Answers 2500 Comments Friend Collector Seventh Anniversary
    I don't know what you did wrong. When you search the forum you'll find a handful of people having the same (or similar) issue. As I have no idea how many people are actually running Debian on their 5xx, I don't know if that is much.
    It's clear that when you have flashed a custom kernel the firmware can no longer boot. So if the Debian rootfs gets damaged, and you have flashed a kernel, the box won't boot any longer. Maybe it is possible to create a new rootfs from the provided .deb files, but I don't know.

    As long as the bootloader itself isn't damaged, you should be able to connect using serial. If you can make it bootable again depends on the damage which prevents booting, and your skills, of course. It's a good idea to create backups of all your flash partitions (using nand_read, not dd), to be able to put them back, if needed.

Consumer Product Help Center