Guide unbricking G0 cam nand

JAFO

n3wb
Joined
Feb 23, 2017
Messages
19
Reaction score
18
There is one big problem made by hik, for purpose, hisilicon hi3516D soc's BOOTROM boot pin is disabled by hik omitting 1k-4k7 pullup resistor.
There is a place for resistor but omitting it makes impossible to recover if nand and bld partition is broken.

Maybe this is a new way to care about customers.
Maybe it is easier to put money to a marketing than think about poor customer.

So to recover bricked G0 cam, this small resistor must be there. I include pics. where it might be found.
Resistor is near hi3516D pin number H19, BOOTROM_SEL.

Status of pin is read only during power-on and if no special char is received from uart0, boot continues.
If special char is received, internal bootrom code is started.
So this resistor can be there in any case but leaving it out makes impossible to unbrick nand.

To start recovery and send this special chars you have to find hisilicon's FastBoot3.1(BVT) sw.
(It comes with hi3516 sdk kit, search with baidu. There is also new java based tool.)

Using this tool's "burn fastboot" and serial port it is possible to transfer a new u-boot to nand.
Copy of G0 mtd0-bld is not ok ! It contains hik's own special way to burn.

So you need u-boot bin with std fastboot feature. u-boot must contains G0 soc's register-setup data's too.

Using FastBoot3.1, std u-boot.bin is copied first to ddr and there it is burn to nand.
Sw has an option "ddr" only but you need to use THIS u-boot to erase and burn real G0 mtd0 copy to nand.
You can download backup of mtd0 using std u-boot's "loady" cmd for serial ymodem transfer or "tftp" cmd via net.

After working mtd0-bld you must have copy of mtd2-enc data's too. Without it "update" cmd fails.

So take a backup of mtd0 and mtd2 beforehand. mtd3 can be made by hand but take a backup of it too. It contains sw revision info only but is needed also.

Hik cam's nands will fail eventually. Every boot,config changes and log writes wear out nand.
mtd0-bld, mtd2-enc, mtd3-sysflag partition are "show stoppers", one error and your are done!

btw, please remember to yumount after yaffs2 mount!


Br, JAFO
 

Attachments

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,952
Reaction score
6,786
Location
Scotland
Interesting.
I have a turret sitting on a shelf from a year or 2 back where I did a full flash erase and forgot to do a flash write before rebooting.
I assumed it was truly bricked as there wouldn't be any hidden code, and not sure why I kept it. Now I know!
 
Joined
Aug 7, 2017
Messages
3
Reaction score
0
I have a camera from China and trying to erase flash on it. Documentation of Hi3516 says that to erase or write to flash memory of camera, you need to connect UART and Ethernet cable to programming PC and program using FastBoot without powering on the camera . For UART I have connected RX, TX, GND from camera to a UART to USB converter. If I just connect UART and Ethernet, camera will not draw any power to write to flash. I feel I need to connect VCC of UART on the board. Any suggestions ?
 

JAFO

n3wb
Joined
Feb 23, 2017
Messages
19
Reaction score
18
Camera need just normal power. Do not use vcc of uart, need of power is more than you can have from usb uart adapter (max 500mA).
 

EgiszZ

n3wb
Joined
Dec 10, 2017
Messages
1
Reaction score
0
Hi!
Did you manage to unbrick your camera? I'm on the same boat - bricked HI3516D during update....
 

Gul-Dukat

Young grasshopper
Joined
Sep 25, 2017
Messages
41
Reaction score
11
Location
Australia
hisilicon's FastBoot3.1(BVT) sw.
(It comes with hi3516 sdk kit, search with baidu.
For those who need this....Hisi - Browse /SDK/Hi3516 at SourceForge.net
See the Hi3516A V100R001C01SPC030.7z.001 734MB and Hi3516A V100R001C01SPC030.7z.002 392MB file...
As I definitely do after a serious mishap with my camera

Code:
Download to address: 0x800000
Downloading: #  [ Connected ]
################################        [ 1.000 MB]

done
Bytes transferred = 1048576 (100000 hex)
hisilicon # nand write.e 0x800000 0x0 0x100000

NAND write: device 0 offset 0x0, size 0x100000
 1048576 bytes written: OK
hisilicon #
result = dead....

Copy of G0 mtd0-bld is not ok !
so putting the original mtd0 back as JAFO says above - definitely isnt enough.....

I had many hits when searching baidu, all resulting in multipart 49MB rar files on links which seemed to go no-where or be pay to access links. So when i found the above I was pleased.

Now to try and see if I have all i need to get it back and running again. I have a bad feeling that

So you need u-boot bin with std fastboot feature. u-boot must contains G0 soc's register-setup data's too.
the sec.bin found in this forum Watchdata EMV chips in R6, G0 and other cameraswont be the ones i need.
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,952
Reaction score
6,786
Location
Scotland
so putting the original mtd0 back as JAFO says above - definitely isnt enough.....
Hopefully he will comment and explain further.
This isn't an area I've explored much, so I'll be interested to hear how you get on.
In fact I think that the only time I've swapped out a bootloader was on a part-bricked Dahua 5208 NVR. But it did indirectly provide the final fix.
 

Gul-Dukat

Young grasshopper
Joined
Sep 25, 2017
Messages
41
Reaction score
11
Location
Australia
Minor update: No joy with the fast burn.
Will have to open up the camera board and check out the 1k-4k7 pullup resistor and install one if its not
 
Joined
Aug 7, 2017
Messages
3
Reaction score
0
Camera need just normal power. Do not use vcc of uart, need of power is more than you can have from usb uart adapter (max 500mA).
I assume that before powering up I should place 1K resistor at bootprom to disable booting. Then I need to use fastboot to flash the image ?
 
Top