AX6 stuck on bootloop - uart connected

So, after i brick the redmi-AX6 and try all options here

i have connected uart to device. attached is the log file


Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.3.1-00147
S - IMAGE_VARIANT_STRING=HAACANAAA
S - OEM_IMAGE_VERSION_STRING=xiaoyang-gv
S - Boot Config, 0x000002e5
B -       203 - PBL, Start
B -      2740 - bootable_media_detect_entry, Start
B -      3446 - bootable_media_detect_success, Start
B -      3450 - elf_loader_entry, Start
B -      6111 - auth_hash_seg_entry, Start
B -      6354 - auth_hash_seg_exit, Start
B -     68438 - elf_segs_hash_verify_entry, Start
B -    131138 - PBL, End
B -    141398 - SBL1, Start
B -    193522 - GCC [RstStat:0x10, RstDbg:0x600000] WDog Stat : 0x4
B -    199927 - pm_device_init, Start
B -    320402 - PM_SET_VAL:Skip
D -    119804 - pm_device_init, Delta
B -    322690 - pm_driver_init, Start
D -      5307 - pm_driver_init, Delta
B -    329064 - clock_init, Start
D -      2135 - clock_init, Delta
B -    333212 - boot_flash_init, Start
D -     11895 - boot_flash_init, Delta
B -    348798 - boot_config_data_table_init, Start
D -      3202 - boot_config_data_table_init, Delta - (575 Bytes)
B -    356331 - Boot Setting :  0x00000600
B -    360266 - CDT version:2,Platform ID:8,Major ID:1,Minor ID:0,Subtype:16
B -    367189 - sbl1_ddr_set_params, Start
B -    371002 - CPR configuration: 0x300
B -    374479 - cpr_init, Start
B -    377285 - Rail:0 Mode: 5 Voltage: 824000
B -    382439 - CL CPR settled at 776000mV
B -    385245 - Rail:1 Mode: 5 Voltage: 880000
B -    389424 - Rail:1 Mode: 7 Voltage: 920000
D -     16470 - cpr_init, Delta
B -    396317 - Pre_DDR_clock_init, Start
B -    400343 - Pre_DDR_clock_init, End
B -    403728 - DDR Type : PCDDR3
B -    409371 - do ddr sanity test, Start
D -      1067 - do ddr sanity test, Delta
B -    414190 - DDR: Start of HAL DDR Boot Training
B -    418856 - DDR: End of HAL DDR Boot Training
B -    424621 - DDR: Checksum to be stored on flash is 638310662
B -    434838 - Image Load, Start
D -    224053 - QSEE Image Loaded, Delta - (1373936 Bytes)
B -    658983 - Image Load, Start
D -        61 - SEC Image Loaded, Delta - (0 Bytes)
B -    666669 - Image Load, Start
D -     10736 - DEVCFG Image Loaded, Delta - (26004 Bytes)
B -    677466 - Image Load, Start
D -     25223 - RPM Image Loaded, Delta - (105964 Bytes)
B -    702781 - Image Load, Start
D -     96563 - APPSBL Image Loaded, Delta - (590228 Bytes)
B -    799496 - QSEE Execution, Start
D -        61 - QSEE Execution, Delta
B -    805291 - USB D+ check, Start
D -         0 - USB D+ check, Delta
B -    811696 - SBL1, End
D -    672586 - SBL1, Delta
S - Flash Throughput, 6747 KB/s  (2096707 Bytes,  310728 us)
S - DDR Frequency, 466 MHz
S - Core 0 Frequency, 800 MHz


U-Boot 2016.01 (Aug 18 2020 - 13:50:52 +0000), Build: jenkins-common_router_openwrt_ota_publish-193

DRAM:  smem ram ptable found: ver: 1 len: 4
512 MiB
NAND:  ONFI device found
ID = 158061c8
Vendor = c8
Device = 61
SF: Unsupported flash IDs: manuf ff, jedec ffff, ext_jedec ffff
ipq_spi: SPI Flash not found (bus/cs/speed/mode) = (0/0/48000000/0)
128 MiB
MMC:   sdhci: Node Not found, skipping initialization

PCI1 is not defined in the device tree
In:    serial@78B3000
Out:   serial@78B3000
Err:   serial@78B3000
machid: 8010010
MMC Device 0 not found
write phy_id=1, reg(0x8074):0x0670
write phy_id=2, reg(0x8074):0x0670
write phy_id=3, reg(0x8074):0x0670
write phy_id=4, reg(0x8074):0x0670
bootwait is on, bootdelay=5
Hit any key to stop autoboot:  0

From here its just looping with the same output.
How can i continue from here ?

tried [TUTO] OpenWrt UNOFFICIAL Redmi AX6 ?

this is not the situation, i am in boot/uboot not in linux, so i need different approach

who said anything about linux ?

the command in the tuto should be run under the OS not uboot

tried reading the whole post ?

ahhh you talk about the unbrick process, done it already, it it didnot helped

bummer.

in that case, can you stop the uboot countdown, and get a prompt ?

I have prompt

then post the output of the help command.

help:

Net:   MAC0 addr:5c:2:14:db:5a:d0
PHY ID1: 0x4d
PHY ID2: 0xd0b1
EDMA ver 1 hw init
Num rings - TxDesc:1 (0-0) TxCmpl:1 (7-7)
RxDesc:1 (15-15) RxFill:1 (7-7)
ipq807x_edma_alloc_rings: successfull
ipq807x_edma_setup_ring_resources: successfull
ipq807x_edma_configure_rings: successfull
ipq807x_edma_hw_init: successfull
board_eth_init: ipq807x_edma_init successed
eth0
IPQ807x# help
?       - alias for 'help'
aq_load_fw- LOAD aq-fw-binary
aq_phy_restart- Restart Aquantia phy
base    - print or set address offset
bdinfo  - print Board Info structure
bootm   - boot application image from memory
bootmiwifi- bootmiwifi from flash device
bootp   - boot image via network using BOOTP/TFTP protocol
bootz   - boot Linux zImage image from memory
btnc    -  check reset button if pressed to 5s  - if so ret 1

btni    -  init gpios for button

chpart  - change active partition
cmp     - memory compare
cp      - memory copy
crc32   - checksum calculation
dcache  - enable or disable data cache
dhcp    - boot image via network using DHCP/TFTP protocol
dm      - Driver model low level access
echo    - echo args to console
env     - environment handling commands
erase   - erase FLASH memory
exectzt - execute TZT

exit    - exit script
false   - do nothing, unsuccessfully
fdt     - flattened device tree utility commands
flash   - flash part_name
        flash part_name load_addr file_size

flasherase- flerase part_name

flinfo  - print FLASH memory information
fuseipq - fuse QFPROM registers from memory

go      - start application at address 'addr'
help    - print command description/usage
i2c     - I2C sub-system
icache  - enable or disable instruction cache
imxtract- extract a part of a multi-image
ipq_mdio- IPQ mdio utility commands
is_sec_boot_enabled- check secure boot fuse is enabled or not

itest   - return true/false on integer compare
loop    - infinite loop on address range
md      - memory display
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mtdparts- define flash/nand partitions
mtest   - simple RAM read/write test
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nm      - memory modify (constant address)
pci     - list and access PCI Configuration Space
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
reset   - Perform RESET of the CPU
rmemcrash-  miwifi check and save crash buff to mtd
run     - run commands in an environment variable
runmulticore- Enable and schedule secondary cores
saveenv - save environment variables to persistent storage
secure_authenticate- authenticate the signed image

printenv

IPQ807x# printenv
CountryCode=CN
Router_unconfigured=0
SN=xxxxxxxxxxx
boot_wait=on
bootargs=ubi.mtd=rootfs_1 root=mtd:ubi_rootfs rootfstype=squashfs rootwait
bootcmd=bootmiwifi
bootdelay=5
bootfile=miwifi_ra69_firmware_45a77_1.0.18.bin
color=100
eth1addr=3c:cd:57:3c:e6:e8
eth2addr=5c:2:14:db:5a:d0
eth3addr=5c:2:14:db:5a:d0
eth4addr=5c:2:14:db:5a:d0
eth5addr=64:64:4a:f2:bd:4c
ethact=eth0
ethaddr=5c:2:14:db:5a:d0
fdt_high=0x4A400000
fdtcontroladdr=4a979e90
fileaddr=44000000
filesize=1c003bc
flag_boot_recovery=0
flag_boot_rootfs=1
flag_boot_success=1
flag_boot_type=2
flag_last_success=1
flag_ota_reboot=0
flag_try_sys1_failed=1
flag_try_sys2_failed=0
flash_type=2
fsbootargs=ubi.mtd=rootfs_1 root=mtd:ubi_rootfs rootfstype=squashfs
gatewayip=192.168.31.1
ipaddr=192.168.31.101
machid=8010010
miot_did=488248146
miot_key=OBF0Zl4VgtGXeNJE
mode=Router
model=RA69
mtddevname=fs
mtddevnum=0
mtdids=nand0=nand0
mtdparts=mtdparts=nand0:0x4280000@0x2dc0000(fs),
netmask=255.255.255.0
no_wifi_dev_times=0
nv_sys_pwd=08ee91c0c13e2c453f1dd0562e2083745ca5762f
nv_wan_type=dhcp
nv_wifi_enc=mixed-psk
nv_wifi_enc1=mixed-psk
nv_wifi_pwd=ko286659
nv_wifi_pwd1=ko286659
nv_wifi_ssid=Redmi_E6E8
nv_wifi_ssid1=Redmi_E6E8_5G
partition=nand0,0
restore_defaults=1
serverip=192.168.31.102
soc_version_major=2
soc_version_minor=0
ssh_en=1
stderr=serial@78B3000
stdin=serial@78B3000
stdout=serial@78B3000
telnet_en=1
uart_en=1
wl0_radio=1
wl0_ssid=Redmi_E6E8_1917_5G
wl1_radio=1
wl1_ssid=Redmi_E6E8_1917

Environment size: 1602/65532 bytes
IPQ807x#

ok, since you seem to have full access, you can transfer the image and write it to the flash,
but this is where I'm on thin ice, you need to know where to write the image, so you don't
overwrite crucial data or the boot loader.

if you watch the serial, while your run the recovery tool from Redmi, does it say anything, even though it fails ?

i need to try

restore_defaults is set, enlarge xqup detect time
 detect button press, continue check 15 secs
 detect button pressed 15 secs !
 confirm to launch xq_upgrade !
 cmd=dhcp

Net:   MAC0 addr:5c:2:14:db:5a:d0
PHY ID1: 0x4d
PHY ID2: 0xd0b1
EDMA ver 1 hw init
Num rings - TxDesc:1 (0-0) TxCmpl:1 (7-7)
RxDesc:1 (15-15) RxFill:1 (7-7)
ipq807x_edma_alloc_rings: successfull
ipq807x_edma_setup_ring_resources: successfull
ipq807x_edma_configure_rings: successfull
ipq807x_edma_hw_init: successfull
board_eth_init: ipq807x_edma_init successed
eth0
ipq807x_eth_halt: done
eth0 PHY0 Down Speed :10 Half duplex
eth0 PHY1 up Speed :10 Full duplex
eth0 PHY2 up Speed :1000 Full duplex
eth0 PHY3 Down Speed :10 Half duplex
eth0 PHY4 Down Speed :10 Half duplex
eth0 PHY5 Down Speed :10 Half duplex
ipq807x_eth_init: done
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
*** Unhandled DHCP Option in OFFER/ACK: 7
*** Unhandled DHCP Option in OFFER/ACK: 7
DHCP client bound to address 192.168.31.101 (21402 ms)
Using eth0 device
TFTP from server 192.168.31.100; our IP address is 192.168.31.101
Filename 'miwifi_ra69_firmware_45a77_1.0.18.bin'.
Load address: 0x44000000
Loading: *
Got TFTP_OACK: TFTP remote port: changes from 69 to 51260
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###############
         1.7 MiB/s
done
Bytes transferred = 29361084 (1c003bc hex)
ipq807x_eth_halt: done
LoadAddr=44000000 NetBootFileXferSize= 1c003bc
CRC verify success!
RSA signature verify success!
Erasing NAND...
Erasing at 0x6e0000 -- 100% complete.
Writing to NAND... OK
Upgrade xiaoqiang_version...
Upgrade root.ubi...
 --- xq_flash_erase Erasing Nand...0x00a00000~+0x023c0000
Erasing at 0x2da0000 -- 100% complete.
 --- xq_flash_erase Erasing Nand...0x02dc0000~+0x023c0000
Erasing at 0x5160000 -- 100% complete.
common/proc_xqimage.c xqimage_upgrade 541 start:0x440002ac,subh->flash_addr:0xffffffff,len:0x1c00000
Erasing NAND...
Erasing at 0x6e0000 -- 100% complete.
Writing to NAND... OK
========Upgrade success!========
Erasing NAND...
Erasing at 0x6e0000 -- 100% complete.
Writing to NAND... OK

Well, it looks OK, but I guess you're still in a boot loop?

Yes, still in boot loop

I have also tried the 1.1.4 image

why its not loading to the original firmware ?

ipq807x_eth_halt: done
eth0 PHY0 Down Speed :10 Half duplex
eth0 PHY1 up Speed :10 Full duplex
eth0 PHY2 up Speed :1000 Full duplex
eth0 PHY3 Down Speed :10 Half duplex
eth0 PHY4 Down Speed :10 Half duplex
eth0 PHY5 Down Speed :10 Half duplex
ipq807x_eth_init: done
BOOTP broadcast 1
*** Unhandled DHCP Option in OFFER/ACK: 7
*** Unhandled DHCP Option in OFFER/ACK: 7
DHCP client bound to address 192.168.31.101 (35 ms)
Using eth0 device
TFTP from server 192.168.31.100; our IP address is 192.168.31.101
Filename 'miwifi_ra69_firmware_1a7bd_1.1.4.bin'.
Load address: 0x44000000
Loading: *
Got TFTP_OACK: TFTP remote port: changes from 69 to 51110
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #
         1.9 MiB/s
done
Bytes transferred = 29623224 (1c403b8 hex)
ipq807x_eth_halt: done
LoadAddr=44000000 NetBootFileXferSize= 1c403b8
CRC verify success!
RSA signature verify success!
Erasing NAND...
Erasing at 0x6e0000 -- 100% complete.
Writing to NAND... OK
Upgrade xiaoqiang_version...
Upgrade root.ubi...
 --- xq_flash_erase Erasing Nand...0x00a00000~+0x023c0000
Erasing at 0x2da0000 -- 100% complete.
 --- xq_flash_erase Erasing Nand...0x02dc0000~+0x023c0000
Erasing at 0x5160000 -- 100% complete.
common/proc_xqimage.c xqimage_upgrade 541 start:0x440002a8,subh->flash_addr:0xf                                                                                                                                                                  fffffff,len:0x1c40000
Erasing NAND...
Erasing at 0x6e0000 -- 100% complete.
Writing to NAND... OK
========Upgrade success!========
Erasing NAND...
Erasing at 0x6e0000 -- 100% complete.
Writing to NAND... OK

IPQ807x# smeminfo
flash_type:             0x2
flash_index:            0x0
flash_chip_select:      0x0
flash_block_size:       0x20000
flash_density:          0x100000
partition table offset  0x0
No.: Name             Attributes            Start             Size
  0: 0:SBL1           0x0000ffff              0x0         0x100000
  1: 0:MIBIB          0x0000ffff         0x100000         0x100000
  2: 0:QSEE           0x0000ffff         0x200000         0x300000
  3: 0:DEVCFG         0x0000ffff         0x500000          0x80000
  4: 0:RPM            0x0000ffff         0x580000          0x80000
  5: 0:CDT            0x0000ffff         0x600000          0x80000
  6: 0:APPSBLENV      0x0000ffff         0x680000          0x80000
  7: 0:APPSBL         0x0000ffff         0x700000         0x100000
  8: 0:ART            0x0000ffff         0x800000          0x80000
  9: bdata            0x0000ffff         0x880000          0x80000
 10: crash            0x0000ffff         0x900000          0x80000
 11: crash_syslog     0x0000ffff         0x980000          0x80000
 12: rootfs           0x0000ffff         0xa00000        0x23c0000
 13: rootfs_1         0x0000ffff        0x2dc0000        0x4280000
 14: rsvd0            0x0000ffff        0x7040000          0x80000

no idea, it's annoying there doesn't appear to be any error message(s) at all ... :confused:

in the first time i done this procedure :

Link to original guide

maybe i flashed to the wrong partition
this is what i have run after getting ssh

0) nvram get flag_boot_rootfs вернула "1"
1)
nvram set flag_last_success=0
nvram set flag_boot_rootfs=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram set boot_wait=on
nvram set uart_en=1
nvram set telnet_en=1
nvram set ssh_en=1
nvram commit

2) scp ./xiaomimtd12.bin root@192.168.31.1:/tmp
3) mtd write /tmp/xiaomimtd12.bin rootfs
4) reboot -> 192.168.1.1
5) scp ./a6minbib.bin root@192.168.1.1:/tmp
6)
. /lib/upgrade/platform.sh
switch_layout boot; do_flash_failsafe_partition a6minbib "0:MIBIB"
7) reboot
8) scp ./openwrt-ipq807x-generic-redmi_ax6-squashfs-nand-factory.ubi root@192.168.1.1:/tmp
9) ubiformat /dev/mtd13 -f /tmp/openwrt-ipq807x-generic-xiaomi_ax6-squashfs-nand-factory.ubi
10)
fw_setenv flag_last_success 1
fw_setenv flag_boot_rootfs 1
11) reboot

Can you successfully tftpboot/ bootm an OpenWrt initramfs from robimarko's ipq807x branches?

actually i don't know how, can you guide me ?