Dahua XVR5116HS-X stuck on logo

XGX

n3wb
Jan 6, 2020
3
0
Ukraine
Hi there.
I have Dahua XVR5116HS-X that doesn't boot after powerloss.
It doesn't show anything on VGA or HDMI port. Network was down, but LED's on network card blinked. I check with tcpdump - no traffic send when I powered up DVR. I've tried to ping at last known address, and default 192.168.1.10, 192.168.1.108 with no success.
I connected to UART and can get in bootloader. After 3 minutes DVR reboots. This is full log from UART with no image on VGA or HDMI:
Code:
System startup

U-Boot 2010.06-svn3262 (May 27 2018 - 09:19:37)

Check Flash Memory Controller v100 ... Found
SPI Nand total size: 128MB
*** Warning - bad CRC or NAND, using default environment



NAND read: device 0 offset 0x100000, size 0x100000
1048576 bytes read: OK

NAND read: device 0 offset 0x200000, size 0x100000
1048576 bytes read: OK

NAND read: device 0 offset 0x200000, size 0x100000
1048576 bytes read: OK
Header CRC Checking ... OK
Data CRC Checking ... OK

System startup

U-Boot 2010.06-svn3244 (May 27 2018 - 05:21:51)

Check Flash Memory Controller v100 ... Found
SPI Nand total size: 128MB
===============================================
DPLL:466Mhz DDR:1864Mhz
APLL:1400Mhz VPLL0:297Mhz
===============================================
Read PhyId Faild
ETH0: PHY(phyaddr=1, rgmii) not link!
higmac init fail!
nice find PHY TRL8211 on higmac
mem= 572

After first boot I've seen this message:
Code:
crc failed,start backup!
backup1 crc check failed,now check backup2 crc...
that message dissapears after several reboots and back again on cold boot.


There was no tftp commands, no run up or another RUN command.
This is full list of commands that were available :
Code:
base
crc32 cmp cp
ddr
go getinfo
loady loadb loop
mtest mw mm md
nm nand nboot
printenv
setenv
saveenv
reset
I thought that I need to flash new boot via loadb loady

One kind man linked me on new full firmware DH_XVR5x16-X_MultiLang_PN_V4.000.0000002.11.R.190829
After some unsuccessful tries of loading new u-boot I find out, that after loadb new u-boot.img at 0x41000000 I need to execute go command with offset 0x000000c0 of u-boot.img.
This offset I find when I compare output of md command ( I've printed what memory contains at 0x0 to 0x1000) with hexdump -C u-boot.img and saw that code is very similar after c0 offset.
So I've
Code:
loadb (at standart 0x41000000 address with c-kermit ) 
go 0x410000c0
and I've booted in new bootloader. Then I can run tftp up, tftp da, and all other d*. After this update I saw that VGA shows LOGO of XVR. but still it autoreboot after 3 minutes.
I've executed
run up - update.img
run dr - romfs-x.cramfs.img
run du - userfs-x.cramfs.img
run dw - web-x.cramfs.img
run dc - custom-x.cramfs.img
run db - imgbak-x.cramfs.imgg
run dh - hwid-x.cramfs.img
run dl - logo-x.cramfs.img
run da - u-boot.img
run dm - miniboot.bin.img
but no luck, still only logo and autoreboot

I've change dh_keyboard and appauto to 1 and saveenv. No luck.
All I can see in onrdinary boot is :

Code:
System startup

U-Boot 2010.06-svn4140 (Aug 08 2019 - 01:51:58)

Check Flash Memory Controller v100 ... Found
SPI Nand total size: 128MB
*** Warning - bad CRC or NAND, using default environment


OK
OK

System startup

U-Boot 2010.06-svn4140 (Aug 08 2019 - 01:54:19)

Check Flash Memory Controller v100 ... Found
SPI Nand total size: 128MB
===============================================
DPLL:466Mhz DDR:1864Mhz
APLL:1400Mhz VPLL0:297Mhz
===============================================
Dectected gmac0 phyaddr set to 0, is it right?
nice find PHY TRL8211 on higmac
ETH0: PHY(phyaddr=0, rgmii) not link!
higmac init fail!
mem= 482
Config/hwidconfig not found!
Hit any key to stop autoboot: 0
0 Storage Device(s) found
stMaxRect.u32Width:1024, stMaxRect.u32Height:768.
HDMI_INFO:Hdmi_PixelFreqSearch[127] ,u32Fmt6.
Dectected gmac0 phyaddr set to 0, is it right?
nice find PHY TRL8211 on higmac
ETH0: PHY(phyaddr=0, rgmii) not link!
higmac init fail!
Loading Kernel Image ... OK
OK

Starting kernel ...

I've tried with tftp run da dr du dh dw dc
DH_XVR5x16-X_MultiLang_PN_V4.000.0000002.3.R.190322 flashed, logo only
DH_XVR5x16-X_MultiLang_PN_V4.000.0000002.4.R.190402 flashed, logo only
DH_XVR5x16-X_MultiLang_PN_V4.000.0000002.11.R.190829 flashed, logo only
DH_XVR5x16-X_MultiLang_PN_V4.000.0000002.17.R.191206 flashed, logo only
DH_XVR5x16_Eng_P_V3.218.0000001.2.R.170808 writes an error that CPU should be 3531A, but finds only 3531D, so not flashed at all
DH_XVR5x16-X_MultiLang_PN_V4.000.0000002.11.R.190829 flashed, logo only
DH_XVR5x16-X_Internal_NP_V4.000.0000001.4.R.180317 writes an error that CPU should be 3531A, but finds only 3531D, so not flashed at all

After update to new firmware I can flash firmware from flash drive and tftp.
If i flash ROM from flash drive I can see all kernel messages. Full log of flash process are in attach.

Power supply 12V 2A, and changes to 100% worked power supply. 12V, 5V 3.3V present on board.
dh_keyboard and appauto are 1

In old bootloader I can press tab to see list of commands, in new bootloader I can't do that. This is full list of commands that I can use:
autoup - load update file from server
boot - boot kernel from uboot
bootm - boot application image from memory
devid - devid - set hardware id and save to flash
eracfg - eracfg - erase config sectors
mac - mac - set mac address and save to flash
nand - NAND sub-system
reset - Perform RESET of the CPU
run - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv - set environment variables

NO PRINTENV are availiable.

I've erace config with eracfg and pressed button on circutboard with same result

Current situation :
DVR reboots after 3 minutes. Shows logo, answers to ping. Config tool see nothing. After flashing with flash drive prints a log of errors
Code:
[m[0;32;31m[[LIBADDA VER:35606]] ERROR  (av_i2c_write_common|899): av_i2c_write error iRet:-1, chipaddr:0x60, regaddr:0x505, data:0, busId:0
[m[0;32;31m[[LIBADDA VER:35606]] ERROR  (LibAvadda_I2C_Write_Common|925): I2C write err!
[m[0;32;31m[[LIBADDA VER:35606]] ERROR  (Dh9931_I2c_Write|77): dh9931 I2C write err!abnoraml:0
[m[1;33m[[LIBADDA VER:35606]] WARN  (Dh9931_I2c_Write|79): dh9931_adda HwReset.......

I have no clue what I need to do to get it working again. Maybe I've missed something?