Results 1 to 8 of 8

Thread: Bricked Javelin....

  1. #1
    Join Date
    Dec 2009
    Posts
    17

    Default Bricked Javelin....

    I have a Javelin bricked. :/
    I made the TTL serial cable and verified the Flash is corrupt, I cant recover using Safe Mode, after I upload the firmware, I see some kernel errors.
    Now I trying to recover using uboot command.
    Using information on http://scratchpad.wikia.com/wiki/NS4600.
    I installed Unbuntu in a Virtual machine to decode the Firwmare package:

    $ sudo apt-get -y install bcrypt zip unzip

    $ unzip S4_06272011.zip

    $ mv S4_06272011.upg s4.bfe

    $ bcrypt s4.bfe
    Encryption key: 30570000

    $ dd if=s4 of=test bs=1K skip=46
    54854+1 records in
    54854+1 records out
    56170864 bytes (56 MB) copied, 0.115223 s, 487 MB/s

    $ file teste
    teste: POSIX tar archive (GNU)

    $ tar -tvf teste
    -rwxr-xr-x root/root 142 2011-06-21 23:50 rev
    -rwxr-xr-x root/root 5645 2011-01-20 06:02 fix_script
    -rw-r--r-- root/root 12288 2011-06-21 23:50 dtb-p
    -rw-r--r-- root/root 2339608 2011-06-21 23:50 kernel-p
    -rw-r--r-- root/root 3709049 2011-06-21 23:50 rootfs-p
    -rw-r--r-- root/root 10713004 2011-06-21 23:50 usr_jffs2-p
    -rw-r--r-- root/root 40025064 2011-06-21 23:50 app_jffs2-p

    Now I will try to copy this files to an USB pendrive and boot from uboot.

  2. #2
    Join Date
    Mar 2012
    Location
    NYC, NY
    Posts
    90

    Default

    hi Senomoto,

    You should create your own thread for this.

    The info you provide here can be valuable to someone else in the future (who knows, maybe even me), and it would just get lost in the tail end of this thread

  3. #3
    Join Date
    Dec 2009
    Posts
    17

    Default

    Hi ruben00,

    I thinked created a reply from a post...

    Well, using the info from post http://www.patriotmemory.com/forums/...velin-hacking& I made a serial cable using a (very) old serial mouse, the cable conector is the same of Javelin board, I cuted the end of the cable and attached in my Nokia CA-42 USB adapter.

    I used Ubuntu and minicom, a terminal over serial, I used this configuration: 115200 bauds, 8 bits, None parity. I plugged Javelin and sent a CTRL C to go into U-boot menu:

    Code:
    ENET Speed is 10 Mbps - HALF duplex connection (EMAC0)                         
    Wake on POWER_BUTTON / LAN                                                     
    Press Ctrl + C to leave...                                                     
                                                                                   
    Wake on POWER_BUTTON / LAN                                                     
    Press Ctrl + C to leave...                                                     
                                                                                   
    Leave clock generator PD mode... OK                                            
    Leave net PHY PD mode... OK                                                    
    Turn on all activity LED power... OK                                           
    FAN_SET mode... OK                                                             
    Turn off all status LED... OK                                                  
    Turn on disk power... OK  
    =>
    printenv command show me some interesting variables:

    Code:
    bootcmd=standby
    bootdelay=0
    baudrate=115200
    loads_echo=
    ipaddr=192.168.207.168
    serverip=192.168.207.229
    preboot=echo
    gatewayip=192.168.207.1
    netmask=255.255.255.0
    hostname=canyonlands
    netdev=eth0
    nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
    ramargs=setenv bootargs root=/dev/ram rw
    addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1
    addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}
    addmisc=setenv bootargs ${bootargs}
    initrd_high=30000000
    kernel_addr_r=1000000
    fdt_addr_r=1800000
    ramdisk_addr_r=1900000
    hostname=canyonlands
    bootfile=canyonlands/uImage
    ramdisk_file=canyonlands/uRamdisk
    rootpath=/opt/PADP
    nload=tftp 200000 canyonlands/u-boot-nand.bin
    nupdate=nand erase 0 100000;nand write 200000 0 100000;setenv filesize;saveenv
    nupd=run nload nupdate
    pciconfighost=1
    pcie_mode=RP:RP
    mtdids=nand0=nand0
    mtdargs=setenv bootargs ${bootargs} ${mtdparts}
    addramdisk=setenv bootargs ${bootargs} ramdisk_size=131072
    nfsboot=run nfsargs addip addtty;nand read.e 1200000 kernel 300000;nand read.e 1a00000 dtb 3000;bootm 1200000 - 1a00000
    safeboot=run ramargs addramdisk addtty mtdargs;nand read.e 1200000 safe-k 300000;nand read.e 1b00000 safe-r 800000;nand read.e 1a00000 dtb 3000;bootm 1200000 1b00000 1a00000
    nandboot=run ramargs addtty mtdargs;nand read.e 1200000 kernel 300000;nand read.e 1b00000 rootfs 800000;nand read.e 1a00000 dtb 3000;bootm 1200000 1b00000 1a00000
    burnin=done
    ext_storage=usb
    ext_ready_time=25
    enable_usb=echo ext_storage is $ext_storage;echo Wait $ext_ready_time seconds for device ready;sleep $ext_ready_time;usb start
    enable_sata=echo ext_storage is $ext_storage;sata info
    enable_ext=run enable_$ext_storage
    load_ext_kernel=echo Load kernel from external storage...;ext2load $ext_storage 0:1 1200000 images/kernel
    load_ext_rootfs=echo Load rootfs from external storage...;ext2load $ext_storage 0:1 1b00000 images/rootfs;
    load_ext_dtb=echo Load dtb from external storage...;ext2load $ext_storage 0:1 1a00000 images/dtb
    extboot=run enable_ext;run ramargs addtty;nand read.e 1200000 kernel 300000;run load_ext_rootfs;nand read.e 1a00000 dtb 3000;bootm 1200000 1b00000 1a00000
    real_bootcmd=run nandboot
    ethact=ppc_4xx_eth0
    mtdparts=mtdparts=nand0:1024K(u-boot),512K(dtb),3072K(safe-k),8192K(safe-r),3072K(kernel),8192K(rootfs),16512K(usr),2048K(data),1024K(oem),87040K(app)
    partition=nand0,0
    mtddevnum=0
    mtddevname=u-boot
    dynparts=done
    ethaddr=00:01:55:1K:XX:YY
    eth1addr=00:00:00:00:00:00
    stdin=serial
    stdout=serial
    stderr=serial
    ver=U-Boot 1.3.4 (NS4600p - 015 - 800MHz) (Jan 27 2011 - 10:21:32)
    
    Environment size: 2622/131068 bytes
    =>

  4. #4
    Join Date
    Dec 2009
    Posts
    17

    Default

    ALERT: Any wrong command in u-boot mode may brick your device forever !!

    I recovered my bricked Javelin! But it's a very hard job, I have a good expertize in Linux, so some tasks are easier for me. My Javelin have a little part nand flash corrupted. If you have a bricked Javelin, its possible do you have an another part of corrupted flash memory and this method maybe doesn't work.

    1) You will need a Ubuntu with NFS server package, fix the Ubuntu IP address like 192.168.0.51 and run in a terminal or console:
    Code:
    sudo bash
    apt-get -y install  nfs-server
    ifconfig eth0 192.168.0.51
    echo "/tmp	*(rw,sync,fsid=0,crossmnt,no_subtree_check,insecure)" >>/etc/exports
    /etc/init.d/nfs-kernel-server restart
    2) Attach serial adapter into Javelin, and using u-boot, boot Javelin in safemode:
    Code:
    => run ramargs addramdisk addtty mtdargs; setenv bootargs ${bootargs} ${mtdparts} init=/bin/sh
    => nand read.e 1200000 safe-k 300000;nand read.e 1b00000 safe-r 800000;nand read.e 1a00000 dtb 3000;bootm 1200000 1b00000 1a00000
    3) You will see the Javelin Linux Terminal, and need edit a file using vi editor program. (some tips here: http://www.eng.hawaii.edu/Tutor/vi.html
    Code:
    # configure the network and start nfs client and http daemon:
    mount -a
    ifconfig eth0 192.168.0.52
    /etc/init.d/loopback start
    /etc/init.d/netbase restart
    /etc/init.d/httpd start
    # create a temporary dir via NFS to upgrade Javelin:
    mkdir /safetmp
    mount -t nfs 192.168.0.51:/tmp /safetmp
    # Edit the upgrade program:
    vi /promise/util/upgrade.pl
    Do you need to find the theses lines:
    Code:
    system("/bin/mkdir $safetmp");
    system("/bin/mount /dev/ram1 $safetmp");
    And delete both.

    Access http://192.168.0.52 with your browser and upload the upgrade file. Wait a some minutes and cross your fingers.

    It's possible to boot Javelin use the rootfs or kernel from a USB flash drive, but you will need to know a little of Linux commands to do made this. Create a primary partition in your flash drive and format then as EXT2 filesystem, mount the partition and create a directory named images, copy rootfs-p file as uImage and kernel-p as kernel inside this directory:

    -rw-r--r-- 1 root root 3709049 Mar 22 22:47 ./images/rootfs
    -rw-r--r-- 1 root root 2339608 Mar 23 01:03 ./images/kernel

    Boot Javelin in the u-boot 'mode', and type "run extboot" to start a boot using external rootfs. To start in shell mode, use this:

    Code:
    run enable_ext;run ramargs addtty;setenv bootargs ${bootargs} init=/bin/sh ;nand read.e 1200000 kernel 300000;run load_ext_rootfs;nand read.e 1a00000 dtb 3000;bootm 1200000 1b00000 1a00000
    Run the following command to boot using a external kernel and rootfs:
    Code:
    run enable_ext;run ramargs addtty;echo Load kernel from external storage...;ext2load $ext_storage 0:1 1200000 images/kernel;run load_ext_rootfs;nand read.e 1a00000 dtb 3000;bootm 1200000 1b00000 1a00000
    I used this command in u-boot mode, to see the "bad blocks" of Nand flash, type "=> nand bad", I saw some bad blocks:

    Device 0 bad blocks:
    01a00000
    038c0000
    048c0000
    04d20000

    U-boot Manual: http://www.denx.de/wiki/DULG/Manual

    Remember: Any wrong command in u-boot mode may brick your device forever !!
    Reedited: I revised some steps.
    Last edited by senomoto; 04-09-2012 at 02:02 AM.

  5. #5
    Join Date
    Mar 2012
    Location
    NYC, NY
    Posts
    90

    Default

    wow, this is some good stuff, good job senomoto. I've unbriked routers before after a bad alternate firmware install, but never thought about unbricking a nas

  6. #6
    Join Date
    Dec 2009
    Posts
    17

    Default

    I created this post after another brick.
    This procedure write the firmware files, its very dangerous for a Javelin not bricked or working well.
    You will need:

    1) A serial TLL adapter, see this post.;

    2) A USB pendrive, previous formated with FAT32

    3) Choose one of this files and unziped on pendrive;
    Original Version
    V.2 Version

    4) Computer with a Serial Terminal program minicom for Linux, Putty or Hyperterminal for Windows


    Let's go:
    ======
    1) Unplug the power cord and remove any harddisk;

    2) Open the lateral case of Javelin and attach que TTL serial USB adapter, see this post.

    3) Configure the Terminal Emulator with the correct serial port, using Baud Rate: 115200, 8 Bits, None Parity;

    4) Plug the power cord, and wait the U-BOOT prompt:

    Hit Ctrl + C to stop autoboot: 0
    Waiting for PHY auto negotiation to complete...... TIMEOUT !
    done
    ENET Speed is 10 Mbps - HALF duplex connection (EMAC0)
    Wake on POWER_BUTTON / LAN
    Press Ctrl + C to leave...


    Press CTRL C to obtain the prompt command.
    Type the commands in bold:

    => usb start
    (Re)start USB...
    USB: scanning bus for devices... 2 USB Device(s) found
    scanning bus for storage devices... 1 Storage Device(s) found
    => echo Load kernel from external storage...;fatload usb 0:1 1200000 kernel;
    Load kernel from external storage...
    reading kernel
    .................................................. .................................................. .................................................. ..................

    2339608 bytes read
    :1 1200000 kernel;

    => echo Load rootfs from external storage...;fatload usb 0:1 1b00000 rootfs;
    Load rootfs from external storage...
    reading rootfs
    .................................................. .................................................. .................................................. ..................

    3817167 bytes read

    => echo Load dtb from external storage...;fatload usb 0:1 1a00000 dtb;
    Load dtb from external storage...
    reading dtb

    12288 bytes read

    => run ramargs addramdisk addtty mtdargs; setenv bootargs ${bootargs} ${mtdparts} init=/bin/sh

    => nand read.e 1200000 kernel 300000;nand read.e 1b00000 rootfs 800000;nand read.e 1a00000 dtb 3000;bootm 1200000 1b00000 1a00000

    NAND read: device 0 offset 0xc80000, size 0x300000
    3145728 bytes read: OK

    NAND read: device 0 offset 0xf80000, size 0x800000
    8388608 bytes read: OK

    NAND read: device 0 offset 0x100000, size 0x3000
    12288 bytes read: OK
    ## Booting kernel from Legacy Image at 01200000 ...
    Image Name: Linux-2.6.32.14

    .....

    BusyBox v1.00-rc2 (2006.11.07-01:55+0000) Built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    /bin/sh: can't access tty; job control turned off
    $ /etc/init.d/modutils
    Loading modules:
    t3sas - t3sas 0000:81:00.0: enabling device (0006 -> 0007)
    t3sas 0000:81:00.0: Found PDC42819 Controller 105a:3f20 with IRQ: 18
    t3sas 0000:81:00.0: Driver version of PDC42819 : 1.3.0.14-NAS-15
    scsi0 : t3sas
    scsi 0:0:8:0: Processor Promise RAID Console 1.00 PQ: 0 ANSI: 3
    scsi 0:0:8:0: Attached scsi generic sg0 type 3
    usb-storage - Initializing USB Mass Storage driver...
    scsi1 : SCSI emulation for USB Mass Storage devices
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    sata_dwc - sata-dwc sata-dwc.0: id 0, controller version 1.82
    sata-dwc sata-dwc.0: DMA initialized
    sata-dwc sata-dwc.0: **** No neg speed (nothing attached?)
    scsi2 : sata-dwc
    ata1: SATA max UDMA/133 irq 22
    iscsi_trgt - iSCSI Enterprise Target Software - version 1.4.20.2
    iscsi_trgt: Registered io type fileio
    iscsi_trgt: Registered io type blockio
    iscsi_trgt: Registered io type nullio

    $ mkdir /mnt/usb
    $ mount -t vfat /dev/sda1 /mnt/usb
    $ cd /mnt/usb

    # The follow command list all the files in pendrive, IF YOU DIDNT SEE ANY FILE LISTED, STOP HERE!!
    $ ls -l

    # The follow procedure ERASE NAND !!!! BE SURE THE FILES dtb, kernel, rootfs, usr_jffs2-p AND app_jff2-p ARE LISTED
    $ /sbin/flash_eraseall -q /dev/mtd1; sleep 1;/sbin/nandwrite -a -p -q /dev/mtd1 dtb
    $ /sbin/flash_eraseall -q /dev/mtd4; sleep 1;/sbin/nandwrite -a -p -q /dev/mtd4 kernel
    $ /sbin/flash_eraseall -q /dev/mtd5; sleep 1;/sbin/nandwrite -a -p -q /dev/mtd5 rootfs
    $ /sbin/flash_eraseall -q /dev/mtd6; sleep 1;/sbin/nandwrite -a -p -q /dev/mtd6 usr_jffs2-p
    $ /sbin/flash_eraseall -q /dev/mtd9; sleep 1;/sbin/nandwrite -a -p -q /dev/mtd9 app_jffs2-p

    $ sync
    $ shutdown -h -n now
    Last edited by senomoto; 02-20-2014 at 01:08 AM.

  7. #7
    Join Date
    Dec 2009
    Posts
    17

    Default

    The internal Flash memory of my Javelin was corrupt (maybe a lot of bad blocks).
    So, I'm booting from a USB flash drive.

    1) A serial TLL adapter, see this post.;

    2) A USB flash drive, previous formated with FAT32;

    3) Choose one of this firmware, download and unzip on USB Flash drive:

    Original Version
    V.2 Version

    4) Use a computer with a Serial Terminal program: minicom for Linux, Putty or Hyperterminal for Windows

    5) Unplug the power cord and remove any harddisk;

    6) Open the lateral case of Javelin and attach que TTL serial USB adapter, see this post.

    7) Configure the Terminal Emulator with the correct serial port, using this configuration: Baud Rate: 115200, 8 Bits, None Parity;

    8) Plug the power cord, and wait the U-BOOT prompt and press CTRL C to stop the booting process:

    Hit Ctrl + C to stop autoboot: 0
    Waiting for PHY auto negotiation to complete...... TIMEOUT !
    done
    ENET Speed is 10 Mbps - HALF duplex connection (EMAC0)
    Wake on POWER_BUTTON / LAN
    Press Ctrl + C to leave...


    9) Create new boot script to your USB drive:

    setenv load_ext_usb "run ramargs addtty mtdargs;usb start;fatload usb 0:1 1200000 kernel;fatload usb 0:1 1b00000 rootfs;fatload usb 0:1 1a00000 dtb; bootm 1200000 1b00000 1a00000"

    setenv real_bootcmd "run load_ext_usb"

    saveenv


    10) Plug your USB Flash drive on Javelin USB port and unplug and plug the power cord.

    To return to nand boot, reconfigure U-BOOT with this parameters:

    setenv real_bootcmd "run nandboot"
    saveenv

  8. #8
    Join Date
    Jan 2012
    Posts
    21

    Question Almost there...

    Hi, I am hoping you are still around and have a few mins...

    I followed your isntructions to boot from a USB key and it all worked well.

    My Javelin reboots fine but I am still having the same problem with most pages in the web interface displaying:

    "The file system contains errors"
    "Please check file system status"

    Does your instructions also takes care of loading the content of these two files from the usb key? :

    usr_jffs2-p
    app_jffs2-p

    There is also a script called "fix_script" in the firmware archive that appears to have to be ran after the firmware installation.
    Wondering what to do with this one, it seems to contain a bunch of fix for various bugs but it requires perl to run and from the "cp" commands inside it it appears to have to be ran from within a specific working directory.

    Any insight?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •