General NAS-Central Forums

Welcome to the NAS community
It is currently Fri Jul 21, 2017 10:45 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Mar 29, 2016 3:10 pm 
Offline

Joined: Thu May 24, 2012 11:14 pm
Posts: 14
hello. maybe some of you will remember me from posts (both here and on the lacie-nas mailing list) about how i bricked my internet space V2 by flashing the wrong uboot (the one for ns2). i spent many weeks trying to figure out a method to ubnbrick it; unfortunately i'm not an IT expert nor an engineer (but rather a MD) so after a while i abandoned my attempts.
recently however i saw my old box gathering dust on the shelf i put it, and decided to try a little stunt devised a while ago. surprisingly, it worked and now the thingy boots nicely (it's just missing a hd lol).
i decided to write this to document my attempt, hoping it will be useful to others as i found zero documentation about this (not for the casual user anyway).

WHAT YOU'RE GONNA DO
basically, you're going to boot the pcb from a second serial chip, bypassing the one soldered on the pcb. you'll then remove this second chip and flash the correct uboot on your onboard chip; i've seen this technique mentioned as "reverse-socket" on some boards, whough as i said before i'm no IT expert, less so about correct terminology. anyway, this method requires some hardware (which can be bought from china on ebay for significantly less than a new nas, i got mine for under €20) and some basic soldering skill.

WHAT YOU'LL NEED
1) a new serial chip, model MX25L4005A: specifically, you'll need the DIP version (MX25L4005APC-12G). this is the model installed on the ns2/is2 pcb's, but in its "through-hole" version.
2) a socket for it; look for "dip8 socket".
3) a spi usb programmer; the cheap chinese ones on ebay will do, just check the compatibility with MX25L4005A beforehand (ask the seller, or better yet look for insertions with a compatibility list).
4) a soic8/sop8 test clip: basically a "pincer" which you clamp on the onboard serial chip to interface with it.
5) a soldering iron + solder.
6) a piece of perforated general-purpose pcb (like this one).
7) a basic schottky diode (like this one).
8) 8 basic pcb male connectors.
9) thin wire to make the connections on your pcb (i got mine from an old IDE cable).
10) everything to connect to your ns2/is2 serial console: an adapter based on the max232/max3232 chip, a serial cable and eventually a serial-to-usb adapter.
11) a usb stick, fat-formatted, to flash the new uboot.

here are pictures of the chip and the socket, the programmer, the test clip, the piece of pcb.
Image
Image
Image
Image
Image

HOW DO YOU DO IT
0) listen to some charging-up tune (hey, that's how i did it).

1) build the reverse-socket: this is the long and tedious part in which you are required to solder stuff.
first of all, get a hold of the MX25L4005A datasheet (link from macronix official site). it's filled with lots of info which i cannot make sense of, but you should write down the pinout of the chip on page 2. notice pin 7, called HOLD#: when this pin is shorted to VCC, the chip is active; when you ground this pin, the chip gets on hold (at least, this is how my simple uneducated brain got it).
so, what you need to do, is to ground pin 7 from the onboard chip, so as to exclude it, and bridge in a new chip with pin 7 shorted to vcc. this is what your reverse-socket circuit will do. here's a pic of mine.
Image
Image
i wrapped mine in kapton tape because ocd.
as you can see, there's a male header on the left and a socket on the right. the header is where we'll plug the female header from our test clip, while the socket is where we'll plug our second chip. pin 1 is marked with a purple dot.
the circuit itself is pretty simple: pin 1, 2, 3, 4, 5, 6 and 8 on the header are to be connected directly with the same pins on the socket. pin 7 from the header is connected to the "input" of our schottky diode, and through it to pin 4 (ground) on the socket. pin 7 from the socket is to be shorted with pin 8 (vcc) on the socket itself. here's a poorly hand-drawn diagram.
Image
to be honest, i don't really know if the diode is necessary, my knowledge of electronics is shamanic at best and i always thought of a diode as a kind of "one way sliding door" for electricity, so it seemed like a reasonable precaution to ensure that pin 7 from the header is effectively grounded.
after you solder everything, you can cut out your circuit from the rest of the pcb (i used a dremel for that).
now that your circuit is ready, you can disassemble your nas and proceed to the next section.

2) prepare the serial console access: locate the 8-pin header just next to the power button and connect them to your serial adapter as shown here (pic from the wiki). connect the adapter to your computer, using a usb-to-serial adapter if needed. however, if you screwed up your uboot, you should already have done this in the past.

3) prepare the second chip: use your spi programmer to flash your new DIP chip with the correct uboot version; most of them come with their flashing software included on cd. you can find some binaries on the lacie-nas ftp (i don't know if i'm allowed to link it). anyway, here are links to the ns2 (click me) and is2 (click me) binaries from my dropbox.
after you're done, plug your chip on your reverse-socket circuit.

4) clip the onboard chip: here's its location on ns2, ns2lite and is2 boards, with pin one noted (bottom-left corner on the pic). most test clips have a red wire to match with pin 1, so that you'll plug your header correctly: a wrong pin match could result in burning one or both of your chips. here are some pics of what you should have.
Image
Image
Image
be careful to make sure that the contacts on the clip are actually touching the chip pins, since the size of this thing is actually small.

5) access the serial console: there are many programs to do it out there, i use putty on windows and minicom on linux. launch your program of choice, then power up the nas. if all of your steps were correct and everything worked, you should see uboot running on your serial console. hit any key to stop the autoboot and get a command prompt. now unclip your test clip: uboot is up and running, so you don't need your second chip anymore. after unclipping, verify that your onboard chip is detected and functioning.
Image
Code:
ns2> sf probe 0
SF: Detected MX25L4005 with page size 64 KiB, total 512 KiB


6) now it's time to actually flash uboot on the onboard chip. prepare the binaries on a fat-formatted or ext2-formatted usb stick and plug it in your nas usb port. make sure your test clip is unclipped!! the only thing attached to your nas, aside from the power cord, should be the serial adapter.
now, run the following commands. replace u-boot-binaries-filename.kwb with the actual name of the binaries you put on the usb stick; also, use ext2load instead of fatload if using an ext2-formatted stick.
Code:
ns2> usb reset
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
ns2>fatload usb 0:1 0x800000 u-boot-binaries-filename.kwb
reading u-boot-binaries-filename.kwb

237972 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> reset
resetting ...


7) if everything worked, uboot should be booting again, this time from your onbiard chip and not from your backup as you unclipped it a moment ago. congratulations, your nas works again! not it's time to configure the new uboot environment variables, install a new os, etc etc. there are some guides on how to do it out there; not plenty, but some. also, uboot commands might seem difficult but they're actually pretty simple, even i managed to learn them. as long as you have a serial access and you don't mess with the sf command to flash stuff on your serial chip, you should be fine (and even if you mess up, you still have all the required hardware to reverse-socket-flash everything again).

so that's how i managed to bring back to life an otherwise dead piece of tech. i hope this mess i wrote in 20 minutes helps someone to do the same. :)

(link to the full imgur album for this thread.)


Last edited by zerosum on Thu Apr 07, 2016 8:41 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Mar 31, 2016 8:30 pm 
Offline

Joined: Wed Mar 18, 2009 11:13 pm
Posts: 771
:shock: impressive, and you wrote all this in only 20 minutes ;)

Thanks for sharing this guide, a great help to get a bricked nas to live again.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group