Welcome! Log In Create A New Profile

Advanced

I done messed up! Lost uboot partition.

Posted by aaronouthier 
Re: I done messed up! Lost uboot partition.
January 25, 2021 04:25PM
Hmmm. Ok, is there a separate log file somewhere, or do you mean the console output from the command?
Re: I done messed up! Lost uboot partition.
January 25, 2021 04:43PM
> do you mean the console output from the
> command?

Yes, copy and paste the entire log that appear on your terminal (from kwboot command to the last line on the screen).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: I done messed up! Lost uboot partition.
January 25, 2021 04:46PM
Copy 'n' paste requires a GUi. There is none installed on my Pi.
Additionally, I'm trying to capture the output with tee, but both the console window and the log file remain empty..

Give me a moment to ssh in from my laptop...
Re: I done messed up! Lost uboot partition.
January 25, 2021 04:52PM
aaron@pi4: ~ file kwboot
kwboot: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=6932d3fc63db2525185c35e112a2c64ac9b25dba, not stripped
aaron@pi4: ~ sudo ./kwboot -t -B 115200 -p -b uboot.2017.07-tld-1.goflexnet.mtd0.kwb /dev/ttyUSB0
Sending boot message. Please reboot the target...\
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  6 % [......................................................................]
  8 % [......................................................................]
 10 % [......................................................................]
 11 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 23 % [......................................................................]
 25 % [......................................................................]
 27 % [......................................................................]
 29 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 34 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 44 % [......................................................................]
 46 % [......................................................................]
 47 % [......................................................................]
 49 % [......................................................................]
 51 % [......................................................................]
 53 % [......................................................................]
 54 % [......................................................................]
 56 % [......................................................................]
 58 % [......................................................................]
 59 % [......................................................................]
 61 % [......................................................................]
 63 % [......................................................................]
 64 % [......................................................................]
 66 % [......................................................................]
 68 % [......................................................................]
 70 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 75 % [......................................................................]
 76 % [......................................................................]
 78 % [......................................................................]
 80 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 85 % [......................................................................]
 87 % [......................................................................]
 88 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 95 % [......................................................................]
 97 % [......................................................................]
 99 % [....................................]
[Type Ctrl-\ + c to quit]
aaron@pi4: ~ 
Re: I done messed up! Lost uboot partition.
January 25, 2021 05:04PM
Re: I done messed up! Lost uboot partition.
January 25, 2021 05:16PM
Is there an easy way way to setup a JTAG from my Pi? I have an old JTAG USB device, called an NAND-X. Would that help? I just dug it out of a drawer.
Re: I done messed up! Lost uboot partition.
January 25, 2021 07:23PM
You have kwboot already, no jtag is needed.

I grabbed a used Goflex home online sometime ago, first removed the HD, then inserted a usb root file system, kwboot it with a raspberry pi zero (added usb hub, wireless network adapter), I used Rpi 0's /dev/ttyAMA0 (saved one usb-serial adapter). In debian, I flashed the uboot of goflex home.

BTW, I used Raspbian Stretch, and kwboot was from debian package u-boot-tools
Re: I done messed up! Lost uboot partition.
January 25, 2021 09:45PM
aaronouthier,

Quote

Copy 'n' paste requires a GUi.

No, just any terminal where you kwboot. That terminal command and output are what you need to capture.


Quote

> [......................................................................]
> 99 % [....................................]
> [Type Ctrl-\ + c to quit]

So what happen after this? is there any more output from the GF Net?

Since you can kwboot, no need to connect JTAG.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: I done messed up! Lost uboot partition.
January 26, 2021 07:46AM
> [......................................................................]
> > 99 % [....................................]
> > [Type Ctrl-\ + c to quit][/quote]
>
> So what happen after this? is there any more
> output from the GF Net?
>
> Since you can kwboot, no need to connect JTAG.

No, I waited about 5 minutes. No additional output. That was using a USB to TTL adapter. I've tried using the Pi's built-in RX, TX and Ground cables, but kwboot doesn't seem to recognize when the goflex reboots. It just sits there at the "reset power" prompt. I made sure that I switched TX and RX at one end. Just to be sure, I reversed RX and TX again when it didn't work the first time, but no change in behavior.
Re: I done messed up! Lost uboot partition.
January 26, 2021 11:42AM
bodhi Wrote:
-------------------------------------------------------
> aaronouthier,
>
>
Quote

Copy 'n' paste requires a GUi.
>
> No, just any terminal where you kwboot. That
> terminal command and output are what you need to
> capture.
>
Well, the raw terminal where I was working doesn't have xwindows/x11/xfree86/whatever installed, and doesn't support a mouse. I used the minimal image, to keep RAM usage low on my Pi. This is why I needed to SSH in from another device that could access an xterm.
Re: I done messed up! Lost uboot partition.
January 26, 2021 03:29PM
Quote

aaron@pi4: ~ sudo ./kwboot -t -B 115200 -p -b uboot.2017.07-tld-1.goflexnet.mtd0.kwb /dev/ttyUSB0

When in doubt, run it as root

./kwboot -t -B 115200 -p -b uboot.2017.07-tld-1.goflexnet.mtd0.kwb /dev/ttyUSB0

Remember, everything you do to setup the box from A to Z (kwboot, flashing, including install initial packages,...), you must do it as root. Don't use sudo.

Use sudo for when you log in to the box as a regular user, and so don't want to mess up the system.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: I done messed up! Lost uboot partition.
January 26, 2021 03:35PM
Root account is disabled on my system. I do know how to enable it, but I don't want to mess with the system. Then again, I do want the goflex to work, so perhaps I'll try it. I suppose I could backup the /etc/passwd and /etc/shadow files before enabling root, and then restore them after I'm done messing with the goflex. Worst case scenario, I just wipe the SD card and reload.
Re: I done messed up! Lost uboot partition.
January 26, 2021 04:13PM
Ok, I enabled the root account with "sudo passwd root" and set a root password. I then logged in completely as the root user with "su - root" and again entered my root password. I copied the kwboot executable and the uboot file from my user's home folder to /root, and ran the same command as before. No change in behavior. At this point, I am going to ask what pins I need to use to do a JTAG. I have a USB JTAG device, and the correct cables. Is it the same pin header as used for the serial console? And what software do I need?
Re: I done messed up! Lost uboot partition.
January 26, 2021 11:45PM
aaronouthier,

> At this
> point, I am going to ask what pins I need to use
> to do a JTAG. I have a USB JTAG device, and the
> correct cables. Is it the same pin header as used
> for the serial console? And what software do I
> need?

I don't think it is necessary. But if you insist, see the Wiki thread

Quote
https://forum.doozan.com/read.php?2,23630

Unbricking with Serial Console & JTAG console

Repair Pogo E02 with Raspberry PI (JTAG) and OpenOCD
Serial Port connector - what are people using to make it work
Serial Console hookup - GoFlex Net (external link)
Serial Console hookup - Pogoplug E02 and Pogoplug Pro V3 (external link)
OSX Serial/Net Console
Use Phone Jack - Phone Jack Serial Console Pics
Adding serial connector to Pogoplug Mobile (external link)
WD Mycloud EX2100/4100 Serial Console pic1, also pic2, pic3
Dreamplug Serial Console
How to unbrick your box using serial console with kwboot
kwboot on Mac OSX 10
Unbrick a Pogoplug Pro v3 OXNAS by flashing u-boot in serial console
Unbricking Synology Diskstation DS414 - See also the working thread for this unbricking session

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: I done messed up! Lost uboot partition.
January 31, 2021 08:35PM
Wow! How long ago did you post that response? I'm just now seeing it.

1. I already checked the WiKi, nothing about JTAG for a GoFlex is mentioned.
2. I got frustrated with all of the dead ends before. Seeing as you have more experience in this matter, I'm getting the notion you know something I haven't yet realized.

Is JTAGing more difficult than I realize, or am I closer to fixing this via serial than I know? Or something else?

I am under the impression that with JTAG, I can just write the image directly to flash roughly similar to connecting a hard drive to a USB SATA adapter. On the one hand, I need to know which wires go where. If you are convinced that it can still be salvaged via Serial connection, then I'm open to those ideas also.

On the one hand, I done brokked it already, what more could I do to it.
On the other hand, I've seen too many Saturday morning cartoons - famous last words on the line above,
Re: I done messed up! Lost uboot partition.
January 31, 2021 08:42PM
Bodhi, et al.,

I've been unable to get the internal TTL serial port on my Pi to work. My USB to TTL adapter gives me the problems above. It seems to have transmission errors. I am using the kwboot for ARM downloaded from this site. I have also tried the one from u-boot-tools.

I think I am going to fire up a SD card with Raspberry Pi OS lite, and try from scratch.
Re: I done messed up! Lost uboot partition.
January 31, 2021 11:31PM
aaronouthier,

> Is JTAGing more difficult than I realize, or am I
> closer to fixing this via serial than I know? Or
> something else?

I think most likey is either your serial connection is not good, or your GoFlex Home/Net RAM has some problem. JTAG will not help in the later cases.

The process of using JTAG for the Pogo E02 (in the Wiki thread), is almost identical to the GoFlex Home/Net. The difference is the config that you define.


> I am under the impression that with JTAG, I can
> just write the image directly to flash roughly
> similar to connecting a hard drive to a USB SATA
> adapter.

No. JTAG is much like serial console connection, but using a different interface protocol. You will load u-boot image over JTAG before writing to flash, analogous to loading u-boot image over UART connection using kwboot, and executing it in RAM.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: I done messed up! Lost uboot partition.
February 01, 2021 12:18AM
Well, unless I ESD zapped something, or knocked a chip loose with a screwdriver when I opened the lid, I doubt it is bad RAM. It definitely booted stock OS before I messed with it.

Ok, I downloaded the uboot image onto an 8 GB MicroSD card running Raspberry Pi OS, and installed u-boot-tools. I have the wires going from the Internal serial port on the Pi to the serial pins on the GoFlex Net. Gunna try again in a moment. I would cross my fingers for luck, but It's kind of difficult to type that way.



Edited 1 time(s). Last edit at 02/01/2021 01:37AM by aaronouthier.
Re: I done messed up! Lost uboot partition.
February 01, 2021 01:45AM
Allrighty then,
kwboot from package u-boot-tools gets stuck at the "reboot target" prompt. It is now almost midnight. I'll mess with it again after the sun wakes up. I'll probably re-download kwboot from these forums and go from there. Yes, I ran as root directly. Yes, I tried switching TX & RX at one end. Yes, I verified that no other process was using the TTY pins (there was originally, but I disabled and stopped the service daemon).
Re: I done messed up! Lost uboot partition.
February 25, 2021 10:03PM
Aha!! Got it. :0)

Now then, it seems the whole flash got hosed. I know I saw info on writing the correct info to the environment partition, but I don't recall where? I just did a few forum searches, and I'm still clueless.

As an aside, are there any decent rescue systems that'll fit in my 256 mb flash AND are still available for download? Preferably something based on Debian or openwrt. I need to setup USB booting for now. I can take care of the flash drive setup. I just need to setup the uboot environment for now.
Re: I done messed up! Lost uboot partition.
February 25, 2021 10:34PM
aaronouthier,

If you have successfully kwboot and at serial console prompt.

See this post:

https://forum.doozan.com/read.php?2,71289,77104#msg-77104

Do Step 1 and then Step 6 in that post

Quote

1. Create a new rootfs using the tarball Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 from the release thread.

You can use the latest rootfs Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2

Quote

6. After you can boot into the new Debian rootfs, you can install new u-boot from there to make it permanent.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: I done messed up! Lost uboot partition.
February 25, 2021 10:47PM
Yeah, so I already managed to write the latest uboot to flash. The only problem I'm having is the environment partition is hosed, and probably the MTD partition structure. (ie, when I hosed uboot, I seem to have hosed the entire flash).

So I need to write the environment data first and foremost, I'm pretty sure. (Although I could still be wrong on that). I can't boot without it.
Re: I done messed up! Lost uboot partition.
February 25, 2021 10:56PM
First, boot into the Debian rootfs using uEnv.txt

https://forum.doozan.com/read.php?3,116134,116139#msg-116139

and then

Do do step 8 in the u-boot installation instruction:

Quote

8. Flashing default u-boot envs image (if you are upgrading from 2016.05-tld-1 u-boot, you can skip this step 8).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: