duhow / wibox

Fermax Wi-Box managed locally
GNU General Public License v3.0
36 stars 6 forks source link

Bricked :( #6

Closed segator closed 2 years ago

segator commented 2 years ago

Tried to build your image and push it to the device. after reboot the device is not getting IP. Tried to connect via Serial and Got stuck at this point with

console init done
[2022-01-10 19:34:05.860] DRAM:  64 MiB
[2022-01-10 19:34:05.877] Flash: [XM25QH128A] USE 4X mode read and 4X mode write
[2022-01-10 19:34:05.887] 16 MiB
[2022-01-10 19:34:05.887] NAND:  [No SPI nand]
[2022-01-10 19:34:05.887] SF:    16 MiB [page:256 Bytes] [sector:64 KiB] [count:256] (XM25QH128A)
[2022-01-10 19:34:05.918] In:    serial
[2022-01-10 19:34:05.918] Out:   serial
[2022-01-10 19:34:05.918] Err:   serial
[2022-01-10 19:34:05.920] Net:   Int PHY
[2022-01-10 19:34:05.924] Hit Enter key to stop autoboot:  0
[2022-01-10 19:34:06.929] [PROCESS_SEPARATORS] run normalboot
[2022-01-10 19:34:06.955] [PROCESS_SEPARATORS] setenv bootargs console=$(consoledev),115200 mem=52M init=/linuxrc root=/dev/mtdblock3 rootfstype=squashfs mtdparts=gk_f
lash:256K(uboot),64K(env),1920K(kernel),2240K(rootfs),11328K(usr),512K(mnt),64K(cfg);sf probe;sf read 0xc1000000 0x50000 0x1E0000;bootm 0xc1000000
[2022-01-10 19:34:06.965] SF:    16 MiB [page:256 Bytes] [sector:64 KiB] [count:256] (XM25QH128A)
[2022-01-10 19:34:07.154] put param to memory
[2022-01-10 19:34:07.154] mem size (52)
[2022-01-10 19:34:07.154] total mem size (64)
[2022-01-10 19:34:07.154] bsb size (1)
[2022-01-10 19:34:07.154] usr size (0)
[2022-01-10 19:34:07.154]
[2022-01-10 19:34:07.154] the kernel image is zImage or Image
[2022-01-10 19:34:07.154] entry = 0xc1000000
[2022-01-10 19:34:07.155] ## Transferring control to Linux (at address c1000000)...
[2022-01-10 19:34:07.155]
[2022-01-10 19:34:07.155] Starting kernel ...
[2022-01-10 19:34:07.155]
[2022-01-10 19:34:07.155] machid = 3988 r2 = 0xc0000100
[2022-01-10 19:34:07.157] Uncompressing Linux... done, booting the kernel.

So I were not able to arrive to the file and replace it by the backup I did previous flash. Any Idea? I'm doing something wrong on the serial or is just fully bricked?

duhow commented 2 years ago

You are still able to use u-boot to attempt recover this (Hit Enter key to stop autoboot) , although I don't have the commands to fully do it... What firmware version do you have?

segator commented 2 years ago

I tried to use inside bootu yload(ymodem) at the address where Mtd4 starts to upload the backup but after reboot same issue, not sure if i need to do something else to persist

duhow commented 2 years ago

Can you try flashing the original CRAMFS file? Also you can try to update bootargs and change init=/bin/sh (just be sure to not saveenv to not persist the changes, or undo them when finishing tests)

segator commented 2 years ago

Yes in fact after the bricking I were trying to put the original CRAMFS file (the backup I did following your instructions) So what you mention of replacing init then full command should be

setenv bootargs console=ttySGK2,115200 mem=52M init=/bin/sh root=/dev/mtdblock3 rootfstype=squashfs mtdparts=gk_flash:256K(uboot),64K(env),1920K(kernel),2240K(rootfs),11328K(usr),512K(mnt),64K(cfg);sf probe;sf read 0xc1000000 0x50000 0x1E0000;bootm 0xc1000000

seems same result on running /bin/sh could be that the console=ttySGK2 is not printing linux console on the serial port? in this case how I could identify which is the console?

thats the output

console init done
DRAM:  64 MiB
Flash: [XM25QH128A] USE 4X mode read and 4X mode write
16 MiB
NAND:  [No SPI nand]
SF:    16 MiB [page:256 Bytes] [sector:64 KiB] [count:256] (XM25QH128A)
In:    serial
Out:   serial
Err:   serial
Net:   Int PHY
Hit Enter key to stop autoboot:  0
GK7102S # setenv bootargs console=ttySGK2,115200 mem=52M init=/bin/sh root=/dev/mtdblock3 rootfstype=squashfs mtdparts=gk_flash:256K(uboot),64K(env),1920K(kernel),2240
[PROCESS_SEPARATORS] setenv bootargs console=ttySGK2,115200 mem=52M init=/bin/sh root=/dev/mtdblock3 rootfstype=squashfs mtdparts=gk_flash:256K(uboot),64K(env),1920K(0
SF:    16 MiB [page:256 Bytes] [sector:64 KiB] [count:256] (XM25QH128A)
put param to memory
mem size (52)
total mem size (64)
bsb size (1)
usr size (0)

the kernel image is zImage or Image
entry = 0xc1000000
## Transferring control to Linux (at address c1000000)...

Starting kernel ...

machid = 3988 r2 = 0xc0000100
Uncompressing Linux... done, booting the kernel.
segator commented 2 years ago

In case helps if you had same problem as me after flashing following duhow instructions device is not booting and in serial console you get just Uncompressing Linux... done, booting the kernel.

you can unbrick the device with minicom. after connect to power you need to instant press enter to stop the kernel booting (you only have 1second!!, be ready!) and boot on uboot shell.

then run:

sf probe
loady 0xC1000000 # after execute this Ctrl+A Z then upload file using "YMODEM protocol" choose your backup of mdt4
#the upload will take arround 15minutes (you will see a progress dialog)
#after finish at this point the backup is loaded at ram
#we need to erase first the sector of the flash we are going to rewrite.
sf erase 0x00460000 00b10000
sf write 0xC1000000 0x00460000 00b10000
#then reboot device