<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Programmer &#8211; NVR IPCAMERA SECURITY</title>
	<atom:link href="https://www.nvripc.com/tag/programmer/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.nvripc.com</link>
	<description>CCTV Help Desk Blog!</description>
	<lastBuildDate>Tue, 14 May 2024 14:34:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.nvripc.com/wp-content/uploads/2024/04/cropped-icons8-camera-91-32x32.png</url>
	<title>Programmer &#8211; NVR IPCAMERA SECURITY</title>
	<link>https://www.nvripc.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Unbricking your Dahua IP camera (Tips, Tricks &#038; Firmware)</title>
		<link>https://www.nvripc.com/unbricking-your-dahua-ip-camera-tips-tricks-firmware/</link>
					<comments>https://www.nvripc.com/unbricking-your-dahua-ip-camera-tips-tricks-firmware/#respond</comments>
		
		<dc:creator><![CDATA[M.Salih ASLAN]]></dc:creator>
		<pubDate>Tue, 14 May 2024 14:34:50 +0000</pubDate>
				<category><![CDATA[NVR]]></category>
		<category><![CDATA[Bandwidth]]></category>
		<category><![CDATA[Camera]]></category>
		<category><![CDATA[Cameras]]></category>
		<category><![CDATA[Config Tool]]></category>
		<category><![CDATA[ConfigTool]]></category>
		<category><![CDATA[Configure]]></category>
		<category><![CDATA[dahua]]></category>
		<category><![CDATA[DAHUA IP Camera]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[download firmware]]></category>
		<category><![CDATA[Ethernet]]></category>
		<category><![CDATA[Factory Default]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[Firmware Upgrade]]></category>
		<category><![CDATA[ftp server]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Install]]></category>
		<category><![CDATA[Instructions]]></category>
		<category><![CDATA[IP address]]></category>
		<category><![CDATA[ip cam]]></category>
		<category><![CDATA[IP Camera]]></category>
		<category><![CDATA[latest firmware]]></category>
		<category><![CDATA[ONVIF]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Recorder]]></category>
		<category><![CDATA[RESET]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Step by Step]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[Video Instructions]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">https://www.nvripc.com/?p=8783</guid>

					<description><![CDATA[<p>Unbricking your Dahua IP camera (Tips, Tricks &#38; Firmware), I am starting this thread to capture a bunch of information in one spot to assist those with &#8220;bricked&#8221; cameras due failed firmware upgrades. I bought my first Dahua IP camera just a couple weeks ago. I was impressed &#38; pretty happy with it, but upon [&#8230;]</p>
<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.nvripc.com/unbricking-your-dahua-ip-camera-tips-tricks-firmware/">Unbricking your Dahua IP camera (Tips, Tricks &#038; Firmware)</a> first appeared on <a rel="nofollow" href="https://www.nvripc.com">NVR IPCAMERA SECURITY</a>.&lt;/p&gt;</p>
]]></description>
										<content:encoded><![CDATA[<p>Unbricking your Dahua IP camera (Tips, Tricks &amp; Firmware), I am starting this thread to capture a bunch of information in one spot to assist those with &#8220;bricked&#8221; cameras due failed firmware upgrades. I bought my first Dahua IP camera just a couple weeks ago. I was impressed &amp; pretty happy with it, but upon reading about new capabilities in newer firmware, I decided to upgrade it. Then like many others on here, I lost access to the Web GUI and the camera was no longer functioning.</p>
<p>I spent the last two weeks getting to know everything about these cameras and this thread will capture all this information. It will take me several weeks to document all the information so please be patient.</p>
<p>There are a variety of problems that I will try my best to explain and share the possible solutions. I have gotten pretty comfortable with these cameras and have purposely bricked them to various degrees of severity just to validate the recovery process. Most people &#8220;brick&#8221; their cameras trying to upgrade the firmware. This is not a serious issue and it can be corrected very easily. The camera runs an upgrade service on port 3800. The configTool always shows a default port of 37777 but this is not an issue as it can do the upgrade on port 3800 anyway. Change your port to 3800 and use a firmware file lsted below and you are back in business.</p>
<p>I will keep updating this post as I get more time to write all the details around recovery. I will also post links to over 40+ firmware files that and which cameras they will work with. It will take me a bit of time to capture all this information, so please be patient.</p>
<h2> How to Download and Prepare Firmware</h2>
<p>This guide will show how to download and prepare the firmware file for a Dahua device.</p>
<p>Firmware files for Dahua devices can be found at <a href="https://dahuawiki.com/Firmware_by_Device" target="_blank" rel="dofollow noopener">Firmware by Device</a> or the specific product page for the device</p>
<p>Firmware is typical provided in a ZIP file, a compressed file format</p>
<p>This file will contain the actual firmware file, which needs to be extracted from the ZIP file in preparation for the upgrade</p>
<p>Prerequisites</p>
<div>
<div>
<div>• Computer with internet access (to download firmware file)</div>
</div>
<div>
<div>• Dahua device</div>
</div>
</div>
<p>Video Instructions</p>
<p>Step by Step Instructions</p>
<p>Confirm the Model and current firmware of Dahua device</p>
<p>1. Enter the IP of the device into a browser</p>
<p>At the Web Login</p>
<p>Enter the Username and Password</p>
<p>Click Login</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image1.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image1.jpeg" /></a></p>
<p>2. Click Info</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image2.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image2.jpeg" /></a></p>
<p>3. Click Version</p>
<p>The Device Type will be displayed</p>
<p>The current System Version will be displayed</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image3.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image3.jpeg" /></a></p>
<p>Download the firmware file for device from DahuaWiki</p>
<p>4. In a browser go to DahuaWiki.com</p>
<p>Under Specifications, Firmware, &amp; Manuals</p>
<p>Click the device type (in this example Recorder)</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image4.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image4.jpeg" /></a></p>
<p>5. Enter the device model into the field</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image5.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image5.jpeg" /></a></p>
<p>6. The results will be filtered</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image6.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image6.jpeg" /></a></p>
<p>7. Click the firmware icon to download the firmware file</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image7.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image7.jpeg" /></a></p>
<p>8. The file will download</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image8.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image8.jpeg" /></a></p>
<p>Extract the firmware file to local computer</p>
<p>9. Right click the Start Menu / Windows icon in the bottom left of the screen</p>
<p>Select File Explorer</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image9.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image9.jpeg" /></a></p>
<p>10. Select Desktop</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image10.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image10.jpeg" /></a></p>
<p>11. Click Home</p>
<p>Then click New folder to create a new folder to extract the contents of the firmware zip file</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image11.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image11.jpeg" /></a></p>
<p>12. Find the created folder in the list, double click to open</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image12.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image12.jpeg" /></a></p>
<p>13. Under the Downloads window of the browser, click &#8216;Show in folder&#8217;</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image13.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image13.jpeg" /></a></p>
<p>A new File Explorer window should open containing the directory the firmware zip was downloaded to</p>
<p>Locate the file in the list</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image14.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image14.jpeg" /></a></p>
<p>14. Right click</p>
<p>Select Cut</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image15.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image15.jpeg" /></a></p>
<p>15. Select the window with the new directory</p>
<p>Right click in the window</p>
<p>Select Paste</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image16.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image16.jpeg" /></a></p>
<p>The folder will appear in the directory</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image17.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image17.jpeg" /></a></p>
<p>16. Right click the file</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image18.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image18.jpeg" /></a></p>
<p>17. The contents of the zip file will appear in a new window</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image19.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image19.jpeg" /></a></p>
<p>18. Click to select all files in the folder</p>
<p>Drag and drop the files to the created folder</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image20.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image20.jpeg" /></a></p>
<p>The files will appear in the directory</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image21.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image21.jpeg" /></a></p>
<p>The firmware file will appear in the directory ready to use</p>
<p><a href="https://www.nvripc.com/wp-content/uploads/2024/05/image22.jpeg" target="_blank" rel="noopener"><img decoding="async" src="https://www.nvripc.com/wp-content/uploads/2024/05/image22.jpeg" /></a></p>
<h2>Unbricking your Dahua IP camera (Tips, Tricks &amp; Firmware)</h2>
<p>BRICKED CAMERA? How can you tell?</p>
<p>There are several types of &#8220;BRICKED&#8221; camera conditions and they have varying levels of severity and also varying levels of complexity for recovery. Most are simple and caused by bad firmware uploads. The worst will require a full rebuild of the partitions which load the kernel, software and all other data.</p>
<p>1. The first step in identifying the severity of your issue is to determine what still working on your camera. In order to do that, lets remove as many variables as possible to the troubleshooting process. If possible, connect the camera ethernet and PC ethernet on it&#8217;s own switch and make sure that no vlan tagging is enabled on the switch.</p>
<p>Next, you need to figure out if the IP address is still reacheable. Ping the last known ip address. The default address for most cameras is 192.168.1.108.</p>
<p>If you don&#8217;t know it you can use the arp/ping method to configure which adds as startic arp entry to a new ip address. (This feature is enabled on the camera by default)</p>
<p>2. Once you have a pingable IP, you need to know what services are still active on the camera. This can be done with a simple port scanner. I have added a link to below in tools.</p>
<p>3. Run the port scanner and record which ports are still open. In many cases port 23 and port 3800 will still be open. If this is your situation, it is a very simple fix. If no ports are open, you will need to do a full image load which is more complex.</p>
<p>The typical ports that you would see are:</p>
<p>23 &#8211; Telnet access</p>
<p>80 &#8211; Web User interface</p>
<p>443 &#8211; SSL</p>
<p>554 &#8211; Real time streaming port</p>
<p>3800 &#8211; Upgrade Deamon</p>
<p>5000 &#8211; UPnP</p>
<p>37777 &#8211; TCP Video streaming</p>
<p>37778 &#8211; UDP Video Streaming</p>
<p>42323 &#8211; Real time remote runner</p>
<p>Plus a whole bunch more of UDP ports and more TCP ports</p>
<p>REPAIR WITH PORT 3800</p>
<p>Download a step by step guide (DAHUA IP Camera Recovery v1.0.pdf) with screen prints @ <a href="http://tinyurl.com/lbl3up7" target="_blank" rel="noopener">http://tinyurl.com/lbl3up7</a></p>
<p>1A. If port 3800 is open you can connect with the Dahua Config tool (link below in tools). I tdefault to port 37777 but change it to 3800 as this port where the upgrade daemon is listening. Port 37777 is a redirect but it won&#8217;t work if your firmware has failed.</p>
<p>Launch the config tool and click on login button. Type the IP address , username and password then port 3800.</p>
<p>Open a know working firmware file and upload to the camera.</p>
<p>1B. If port 3800 is not open, go to the next step to enable port 3800.</p>
<p>2. If you have telnet access, you can login with putty. Link to putty below in tools. The default Web UI password is admin / admin.</p>
<p>In older firmware the telnet account is root / vizxv</p>
<p>In newer firmware the telnet account is admin / 7ujMko0+&#8221;web UI password&#8221; &#8212;&gt; 7ujmko0admin</p>
<p>Once connected you can execute a ps command to see running processes. /usr/sbin/upgraded process is what listens on port 3800 for the firmware binary file.</p>
<p>There is also another copy in /var/tmp/</p>
<p>A useful tip for watching the upgrade process is to kill the &#8220;upgraded&#8221; process that is running and re-launch it in the foreground to watch the upgrade.</p>
<p>~#&gt;ps</p>
<p>625 root 0:00 [mtdblock3]
<p>630 root 0:00 [mtdblock4]
<p>635 root 0:00 [mtdblock5]
<p>772 root 0:00 [ubi_bgt7d]
<p>776 root 0:00 [ubifs_bgt7_0]
<p>790 root 0:00 /sbin/telnetd</p>
<p>798 root 0:00 [OSA_796_1]
<p>860 root 0:00 syshelper elper 60</p>
<p>861 root 0:00 /usr/sbin/upgraded</p>
<p>869 root 0:00 [dsplogd]
<p>870 root 0:00 [encode_guard]
<p>889 root 0:00 [flush-ubifs_6_0]
<p>923 root 3:29 ./VideoDaemon AEWB AF TVOUT</p>
<p>~#&gt; kill -9 861</p>
<p>~#&gt; /usr/sbin/upgraded</p>
[OSA-APP] OSA Build on Apr 19 2014 at 09:55:50.</p>
[OSA-APP] SVN NUM: 1609.</p>
[libpdi] libpdi.so Build on Apr 19 2014 at 10:06:34.</p>
[libpdi] SVN NUM: 13790.</p>
[libpdi] Flashtype = 4,patSize = 100000,rwSize = 800,ersSize = 20000</p>
<p>22:52:46|[crypt] crypt_open ok!</p>
<p>Name: upgraded, bulid date: Apr 19 2014 09:17:58, svn: 255</p>
[libpdi] &gt;&#8212;&#8212;-getSystemInfo&#8212;&#8212;-&gt;</p>
<p>Fail to get env authcode!</p>
[libpdi] Get authcode error</p>
<p>@@@@ buf = PZC4MU056W00XXX</p>
<p>22:52:52|[pdc] WARN (MISC_ioctl|493): Get SdCard cfg failed !</p>
[libpdi] deviceType: IPC-HFW4300S-V2</p>
[libpdi] processor: A5S88</p>
[libpdi] hardwareVersion: 1.00</p>
[libpdi] appAutoStart: 1</p>
[libpdi] serialNumber: PZC4MU056W00XXX</p>
[libpdi] processorCount: 1</p>
[libpdi] deviceClass: IPC</p>
[libpdi] noPtz: 1</p>
[libpdi] noSdCard: 1</p>
[libpdi] bandWidth: 48</p>
[libpdi] &lt;&#8212;&#8212;-getSystemInfo&#8212;&#8212;-&lt;</p>
<p>UPGRADED_MSG: Can&#8217;t Open /mnt/mtd/Config/passwd</p>
<p>UPGRADED_MSG: Login success!</p>
<p>UPGRADED_MSG: Kill 976 successful</p>
[libpdi] Read: blkIndex: 1,pageIndex: 0,byteIndex: 0 ,fLag: ff</p>
[libpdi] Write: blkIndex: 1,pageIndex: 0,byteIndex: 0 ,fLag: 0</p>
<p>UPGRADED_MSG: reset_watchdog</p>
<p>UPGRADED_MSG: Receive A4(alarm)</p>
<p>UPGRADED_MSG: reset_watchdog</p>
<p>UPGRADED_MSG: Receive A1(alive package)</p>
<p>UPGRADED_MSG: reset_watchdog</p>
<p>UPGRADED_MSG: Received : 29868252, FileSize : 29868252</p>
<p>UPGRADED_MSG: Download Complete</p>
<p>UPGRADED_MSG: DoDownLoad success!</p>
<p>UPGRADED_MSG: Flash init success</p>
<p>UPGRADED_MSG: hwid file success!</p>
<p>Fail to get env native!</p>
<p>UPGRADED_ERR: LINE: 1074: invalid file: Install.lua</p>
<p>UPGRADED_MSG: zip file total size: 40900220</p>
[libpdi] &gt;&#8212;&#8212;-getSystemInfo&#8212;&#8212;-&gt;</p>
<p>Fail to get env authcode!</p>
[libpdi] Get authcode error</p>
<p>@@@@ buf = PZC4MU056W00XXX</p>
<p>22:53:10|[pdc] WARN (MISC_ioctl|493): Get SdCard cfg failed !</p>
[libpdi] deviceType: IPC-HFW4300S-V2</p>
[libpdi] processor: A5S88</p>
[libpdi] hardwareVersion: 1.00</p>
[libpdi] appAutoStart: 1</p>
[libpdi] serialNumber: PZC4MU056W00XXX</p>
[libpdi] processorCount: 1</p>
[libpdi] deviceClass: IPC</p>
[libpdi] noPtz: 1</p>
[libpdi] noSdCard: 1</p>
[libpdi] bandWidth: 48</p>
[libpdi] &lt;&#8212;&#8212;-getSystemInfo&#8212;&#8212;-&lt;</p>
<p>UPGRADED_MSG: packet.name: SD6XXX, board.name: IPC-HFW4300S-V2</p>
<p>UPGRADED_MSG: packet.hardver: , board.hardver:</p>
<p>UPGRADED_MSG: packet.name: IPC-HX3XXX, board.name: IPC-HFW4300S-V2</p>
<p>UPGRADED_MSG: packet.hardver: , board.hardver:</p>
<p>UPGRADED_MSG: Verify version success</p>
<p>Header CRC Checking &#8230; OK</p>
<p>Image Name: kernel.img</p>
<p>Image Type: kernel.img (gzip compressed)</p>
<p>Data Size: 2546876 B, Bytes = 2.43 MB</p>
<p>Load Address: 0XC80000</p>
<p>Data CRC Checking &#8230; OK</p>
<p>Programing start at: 0XC80000</p>
[libpdi] write update Flag</p>
[libpdi] Read: blkIndex: 0,pageIndex: 0,byteIndex: 0 ,fLag: ff</p>
[libpdi] Write: blkIndex: 0,pageIndex: 0,byteIndex: 0 ,fLag: 55</p>
[libpdi] Flash_createPartionTab:6</p>
[libpdi] Erase Partion: 6</p>
[libpdi] FlashErase: addr= 0x0xc80000,blkNum:44, blkSize:0x20000,len:0x580000</p>
<p>&lt;5&gt;UBIFS: un-mount UBI device 2, volume 0</p>
<p>&lt;5&gt;UBIFS: un-mount UBI device 4, volume 0</p>
<p>Upgrade : Complete Total 6%&#8230;</p>
<p>Header CRC Checking &#8230; OK</p>
<p>Image Name: partition-x.cramfs.img</p>
<p>Image Type: partition-x.cramfs.img (gzip compressed)</p>
<p>Data Size: 4160 B, Bytes = 0.00 MB</p>
<p>Load Address: 0X500000</p>
<p>Data CRC Checking &#8230; OK</p>
<p>Programing start at: 0X500000</p>
[libpdi] Flash_createPartionTab:3</p>
[libpdi] Erase Partion: 3</p>
[libpdi] FlashErase: addr= 0x0x500000,blkNum:8, blkSize:0x20000,len:0x100000</p>
<p>Upgrade : Complete Total 6%&#8230;</p>
<p>Header CRC Checking &#8230; OK</p>
<p>Image Name: romfs-x.ubifs.img</p>
<p>Image Type: romfs-x.ubifs.img (gzip compressed)</p>
<p>Data Size: 7340096 B, Bytes = 7.00 MB</p>
<p>Load Address: 0X1200000</p>
<p>Data CRC Checking &#8230; OK</p>
<p>Programing start at: 0X1200000</p>
[libpdi] Flash_createPartionTab:7</p>
[libpdi] Erase Partion: 7</p>
[libpdi] FlashErase: addr= 0x0x1200000,blkNum:64, blkSize:0x20000,len:0x800000</p>
<p>Upgrade : Complete Total 24%&#8230;</p>
<p>Header CRC Checking &#8230; OK</p>
<p>Image Name: pd-x.ubifs.img</p>
<p>Image Type: pd-x.ubifs.img (gzip compressed)</p>
<p>Data Size: 1966144 B, Bytes = 1.88 MB</p>
<p>Load Address: 0X940000</p>
<p>Data CRC Checking &#8230; OK</p>
<p>Programing start at: 0X940000</p>
[libpdi] Flash_createPartionTab:5</p>
[libpdi] Erase Partion: 5</p>
[libpdi] FlashErase: addr= 0x0x940000,blkNum:26, blkSize:0x20000,len:0x340000</p>
<p>Upgrade : Complete Total 28%&#8230;</p>
<p>Header CRC Checking &#8230; OK</p>
<p>Image Name: user-x.ubifs.img</p>
<p>Image Type: user-x.ubifs.img (gzip compressed)</p>
<p>Data Size: 21233728 B, Bytes = 20.25 MB</p>
<p>Load Address: 0X2200000</p>
<p>Data CRC Checking &#8230; OK</p>
<p>Programing start at: 0X2200000</p>
[libpdi] Flash_createPartionTab:9</p>
[libpdi] Erase Partion: 9</p>
[libpdi] FlashErase: addr= 0x0x2200000,blkNum:204, blkSize:0x20000,len:0x1980000</p>
<p>Upgrade : Complete Total 80%&#8230;</p>
<p>Header CRC Checking &#8230; OK</p>
<p>Image Name: custom-x.ubifs.img</p>
<p>Image Type: custom-x.ubifs.img (gzip compressed)</p>
<p>Data Size: 1966144 B, Bytes = 1.88 MB</p>
<p>Load Address: 0X600000</p>
<p>Data CRC Checking &#8230; OK</p>
<p>Programing start at: 0X600000</p>
[libpdi] Flash_createPartionTab:4</p>
[libpdi] Erase Partion: 4</p>
[libpdi] FlashErase: addr= 0x0x600000,blkNum:26, blkSize:0x20000,len:0x340000</p>
<p>Upgrade : Complete Total 85%&#8230;</p>
<p>Header CRC Checking &#8230; OK</p>
<p>Image Name: web-x.ubifs.img</p>
<p>Image Type: web-x.ubifs.img (gzip compressed)</p>
<p>Data Size: 5505088 B, Bytes = 5.25 MB</p>
<p>Load Address: 0X1A00000</p>
<p>Data CRC Checking &#8230; OK</p>
<p>Programing start at: 0X1A00000</p>
[libpdi] Flash_createPartionTab:8</p>
[libpdi] Erase Partion: 8</p>
[libpdi] FlashErase: addr= 0x0x1a00000,blkNum:64, blkSize:0x20000,len:0x800000</p>
<p>Upgrade : Complete Total 99%&#8230; [libpdi] Read: blkIndex: 0,pageIndex: 1,byteIndex: 0 ,fLag: ff</p>
[libpdi] Write: blkIndex: 0,pageIndex: 1,byteIndex: 0 ,fLag: aa</p>
<p>Upgrade : Complete Total 100%&#8230; UPGRADED_MSG: will reboot system</p>
[libpdi] rebootSystem: i will reboot</p>
[libpdi] Read: blkIndex: 1,pageIndex: 0,byteIndex: 0 ,fLag: ff</p>
[libpdi] Write: blkIndex: 1,pageIndex: 0,byteIndex: 0 ,fLag: 0</p>
[libpdi] pdi:system will reboot!!</p>
<p>Here you can see each partition being loaded wit the individual img files. I will write a quick how to on loading each one individually at a later time.</p>
<p>If you chose a valid firmware file, you will be back in working order. If you still have problems, repeat with another firmware file till you have a valid file. The IPC-HFW4300S-V2 is not natively compatible with all other 4300S firmware. I am in the process of writing a how to that explains how to over come this issue.</p>
<hr />
<h2>UNBRICK WITH UBOOT via SERIAL</h2>
<p>NOTE: This section is coming soon&#8230; I&#8217;m gathering all the images I need for various camera types</p>
<p>OTHER USEFUL INFORMATION (to be sorted later)</p>
<p>The firmware consists of several images that are loaded into various partitions in flash in a UBI file system. You can load each partition separately if needed. More on this later&#8230;. (I&#8217;ll put a guide together on flashing and recovering partitions)</p>
<p>Once you telnet into the camera, there are number of useful binaries in the user shell that can help correct and diagnose some of the problems people are experiencing. One of the helpful steps is to kill the /var/tmp/upgraded process and run it in the foreground so you can see what is going on and easily capture error messaged. The /var/tmp/upgraded process is what opens the port 3800 and allows you to connect to the camera with the config tool if your web services have failed. There is also another copy in usr/sbin/.</p>
<p>Also, in there is a command to reset all the parameters back to factory defaults (username, password, ip address back to 192.168.1.108 etc.) This can be accomplished with /sbin/clearparam.</p>
<p>Another issue that people run into is the constant reboot issue. This can be caused by a failed process. The main application which provides all the camera capabilities (web interface, streaming, etc.) is /usr/bin/sonia. This process is what makes most firmware different from version to version (sort of). There are also changes to the web partition which contains the web server pages that /usr/bin sonia hosts on port 80. The sonia process is invoked by a shell script in init.d and if the process is killed, the camera reboots after a few minutes. This has cause many people issues when trying to &#8220;unbrick&#8221; the camera since you only have a few minutes between reboots.</p>
<p>To stop the reboots you can update the flash. There is a parameter called appauto that tells the camera to auto start /us/bin/sonia. If you want the camera to start and not invoke the shell script that launches sonia, you need to set appauto to 0. This will stop the camera from rebooting when sonia is not running.</p>
<p>This cam be accomplished by running &#8216;/sbin/appauto 0&#8217;. To turn it back on, just run /sbin/appauto 1. This writes the boot parameter in flash that the kernel reads before starting the process. You can check the current status of the appauto bootparameter with &#8216;cat /proc/dahua/bootpara&#8217; It will only show what the parameter was when you booted up, so if you changes it you need to reboot to see the change in /proc/dahua/bootpara.</p>
<p>Realtime streaming URL &#8211; rtsp://192.168.1.108/cam/realmonitor?channel=1&amp;subtype=0&amp;proto=Onvif</p>
<p>You can change the subtype to 1 for the secondary stream also you can add user:password@ in front of the IP address if you have the permissions set requiring it.</p>
<p>You can use the HTTP API to configure some parameters that are not yet in the web UI. For instance, another member discovered he could enable NFS through the web UI in addition to the local SD card. This config is not possible through the web interface as you need to pick one or the other.</p>
<p>These documents details the API of Dahua video products (links provided to some of the versions below). Programmers or users can access and configure Dahua video products through the API. Every setting of the camera is available through the API whereas only a small number are available through the WEB interface. The document with version 1.10 is available with firmware version 2.0 and above. This document with version 1.20, 1.21, 1.22, 1.23,1.24,1,25,1,26,1,27,1,28 is available with firmware 2.210 and above.This document with version 1. 29 ,1.30, 1.31, 1.32, 1.33, 1.34, 1.35,</p>
<p>1.36 is available with firmware 2.210 and above.This document with version 1.37 is available with firmware 2.212, 2.4 and above.</p>
<p>I have also done a bit of testing around the tftp process that is invoked in u-boot that looks for upgrade_info_7db780a713a4.txt and failed.txt. I think with a little more work, I&#8217;ll figure out if there is a recovery method using tftp without serial access. This would be necessary if you lose telnet access and need to rebuild the kernel partition that hosts telnetd.</p>
<hr />
<h2>Tools</h2>
<p>DAHUA IP Camera Recovery v1.0.pdf&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/lbl3up7" target="_blank" rel="noopener">http://tinyurl.com/lbl3up7</a></p>
<p>Port Scanner &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/q53pojg" target="_blank" rel="noopener">http://tinyurl.com/q53pojg</a></p>
<p>Putty &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/lvbbmsq" target="_blank" rel="noopener">http://tinyurl.com/lvbbmsq</a></p>
<p>Tftp Server &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/m46wnhe" target="_blank" rel="noopener">http://tinyurl.com/m46wnhe</a></p>
<hr />
<h2>Dahua Docs &amp; Tools</h2>
<p>DAHUA_HTTP_API 1.0 .pdf &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/lb43lga" target="_blank" rel="noopener">http://tinyurl.com/lb43lga</a></p>
<p>DAHUA_HTTP_API_1.23.pdf &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/lrwye3k" target="_blank" rel="noopener">http://tinyurl.com/lrwye3k</a></p>
<p>DAHUA_HTTP_API_FOR_IPC 1.28.pdf &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. <a href="http://tinyurl.com/kskrcay" target="_blank" rel="noopener">http://tinyurl.com/kskrcay</a></p>
<p>DAHUA_HTTP_API_FOR_IPC&amp;SD-V1.36.pdf &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/mooccf9" target="_blank" rel="noopener">http://tinyurl.com/mooccf9</a></p>
<p>DAHUA_HTTP_API_FOR_IPC&amp;SD-V1.37.pdf &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/kvyddfp" target="_blank" rel="noopener">http://tinyurl.com/kvyddfp</a></p>
<p>DAHUA_HTTP_API_FOR_DVR_V1.29.pdf &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/klc72tr" target="_blank" rel="noopener">http://tinyurl.com/klc72tr</a></p>
<p>General_ConfigTool_Eng_V1.0.5.R.120428.zip &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/mwlzbb3" target="_blank" rel="noopener">http://tinyurl.com/mwlzbb3</a></p>
<p>General_ConfigTool_Eng_V1.06.1.T.120807.zip &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/leudphu" target="_blank" rel="noopener">http://tinyurl.com/leudphu</a></p>
<p>General_ConfigTool_Eng_V1.07.2.R.130304.zip &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/obs5ud7" target="_blank" rel="noopener">http://tinyurl.com/obs5ud7</a></p>
<p>General_ConfigTool_Eng_V1.07.3.R.130701.zip &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/o6p628f" target="_blank" rel="noopener">http://tinyurl.com/o6p628f</a> &lt;&#8212;- Use this one</p>
<p>General_ConfigTool_Eng_V2.00.0.R.140410.zip &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/nbqtgev" target="_blank" rel="noopener">http://tinyurl.com/nbqtgev</a></p>
<hr />
<h2>Firmware Files</h2>
<p>Firmware files are grouped by camera type and video signal (NTSC &#8211;&gt; Eng_N / PAL &#8211;&gt; Eng_P / or BOTH &#8211;&gt; Eng_NP)</p>
<p>Files are ordered by version number with the latest Firmware in blue.</p>
<p>Files with DH_ prefix are DAHUA direct firmware files and those with General_ prefix are general release for OEM cameras but I&#8217;ve had good luck with both.</p>
<p>DH_IPC-HX1100_Eng_NP_V2.210.0000.3.R.20140416.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/m2jf3qv" target="_blank" rel="noopener">http://tinyurl.com/m2jf3qv</a></p>
<p>General_IPC-HX3(2)XXX_Eng_N_V2.210.0001.0.R.20130517.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/q98zg9x" target="_blank" rel="noopener">http://tinyurl.com/q98zg9x</a></p>
<p>General_IPC-HX3(2)XXX_Eng_P_V2.210.0001.0.R.20130517.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/nekapn3" target="_blank" rel="noopener">http://tinyurl.com/nekapn3</a></p>
<p>General_IPC-HX3(2)XXX_Eng_NP_V2.210.0001.0.R.20130517.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/p59ym6z" target="_blank" rel="noopener">http://tinyurl.com/p59ym6z</a></p>
<p>General_IPC-HX3(2)XXX_Eng_P_V2.211.0000.0.R.20130726.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/my54r9z" target="_blank" rel="noopener">http://tinyurl.com/my54r9z</a></p>
<p>General_IPC-HX3(2)XXX_Eng_N_V2.212.0000.0.R.20131206.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/lrvtm2z" target="_blank" rel="noopener">http://tinyurl.com/lrvtm2z</a></p>
<p>General_IPC-HX3(2)XXX_Eng_P_V2.212.0000.0.R.20131206.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/n9rv23n" target="_blank" rel="noopener">http://tinyurl.com/n9rv23n</a></p>
<p>General_IPC-HX3(2)XXX_Eng_N_V2.212.0001.0.R.20131224.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/l5kg2d9" target="_blank" rel="noopener">http://tinyurl.com/l5kg2d9</a></p>
<p>General_IPC-HX3(2)XXX_Eng_P_V2.212.0001.0.R.20131224.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/q6c2gox" target="_blank" rel="noopener">http://tinyurl.com/q6c2gox</a></p>
<p>DH_IPC-HX3(2)XXX_Eng_NP_8M_V2.212.0000.4.R.20140307.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/mnzx33h" target="_blank" rel="noopener">http://tinyurl.com/mnzx33h</a></p>
<p>DH_IPC-HX3(2)XXX_Eng_NP_8M_V2.212.0000.5.R.20140326.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/ke285w5" target="_blank" rel="noopener">http://tinyurl.com/ke285w5</a></p>
<p>DH_IPC-HX3(2)XXX_Eng_NP_8M_V2.212.0000.6.R.20140419.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/mllzcox" target="_blank" rel="noopener">http://tinyurl.com/mllzcox</a></p>
<p>General_IPC-HX3(2)XXX_Eng_P_V2.420.0000.0.R.20140414.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/nftaogy" target="_blank" rel="noopener">http://tinyurl.com/nftaogy</a></p>
<p>DH_IPC-HX3(2)XXX_Eng_N_V2.420.0000.0.R.20140414.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. <a href="http://tinyurl.com/ma5q64d" target="_blank" rel="noopener">http://tinyurl.com/ma5q64d</a></p>
<p>General_IPC-HX5(4)XXX_Eng_P_V2.210.0000.2.R.20130821.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. <a href="http://tinyurl.com/pdcdmdk" target="_blank" rel="noopener">http://tinyurl.com/pdcdmdk</a></p>
<p>General_IPC-HX5(4)XXX_Eng_N_V2.210.0000.4.R.20130911.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/pdoxjzj" target="_blank" rel="noopener">http://tinyurl.com/pdoxjzj</a></p>
<p>General_IPC-HX5(4)XXX_Eng_P_V2.210.0000.9.R.20131217.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/p3g4t54" target="_blank" rel="noopener">http://tinyurl.com/p3g4t54</a></p>
<p>General_IPC-HX5(4)XXX_Eng_N_V2.210.0000.10.R.20140111.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/mnjpd79" target="_blank" rel="noopener">http://tinyurl.com/mnjpd79</a></p>
<p>General_IPC-HX5(4)XXX_Eng_P_V2.210.0000.12.R.20140225.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/nssnph6" target="_blank" rel="noopener">http://tinyurl.com/nssnph6</a></p>
<p>DH_IPC-HX5(4)XXX_Eng_NP_V2.210.0000.12.R.20140225.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/lcjr8xv" target="_blank" rel="noopener">http://tinyurl.com/lcjr8xv</a></p>
<p>DH_IPC-HX5(4)XXX_Eng_NP_V2.210.0000.16.R.20140421.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/k67gu9u" target="_blank" rel="noopener">http://tinyurl.com/k67gu9u</a></p>
<p>DH_IPC-HX5(4)XXX_Eng_NP_V2.210.0000.18.R.20140429.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. <a href="http://tinyurl.com/n779scx" target="_blank" rel="noopener">http://tinyurl.com/n779scx</a></p>
<p>General_IPC-HX5(4)XXX_Eng_N_V2.210.0000.21.R.20140613.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/qd2thhe" target="_blank" rel="noopener">http://tinyurl.com/qd2thhe</a></p>
<p>General_IPC-HX5(4)XXX_Eng_P_V2.210.0000.21.R.20140613.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/p8q75b4" target="_blank" rel="noopener">http://tinyurl.com/p8q75b4</a></p>
<p>General_IPC-HX5(4)XXX_Eng_N_V2.400.0000.0.R.20131231.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/kmd7hu9" target="_blank" rel="noopener">http://tinyurl.com/kmd7hu9</a></p>
<p>DH_IPC-HX5(4)XXX_Eng_N_Stream3_V2.420.0000.0.R.20140419.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/mb75g2n" target="_blank" rel="noopener">http://tinyurl.com/mb75g2n</a></p>
<p>DH_IPC-HX5(4)XXX_Eng_P_Stream3_V2.420.0002.0.R.20140621.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/laj29k5" target="_blank" rel="noopener">http://tinyurl.com/laj29k5</a></p>
<p>General_IPC-HX5(4)XXX_Eng_N_Stream3_V2.420.0000.0.R.20140419.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/mzw85fz" target="_blank" rel="noopener">http://tinyurl.com/mzw85fz</a></p>
<p>General_IPC-HX5(4)XXX_Eng_P_Stream3_V2.420.0000.0.R.20140419.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/ov6krph" target="_blank" rel="noopener">http://tinyurl.com/ov6krph</a></p>
<p>General_IPC-HX5(4)XXX_Eng_P_Stream3_P2P_V2.420.0000.0.R.20140419.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; <a href="http://tinyurl.com/oxgblkq" target="_blank" rel="noopener">http://tinyurl.com/oxgblkq</a></p>
<p>General_IPC-HX5(4)XXX_Eng_N_Stream3_V2.420.0002.0.R.20140621.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/kejg3fv" target="_blank" rel="noopener">http://tinyurl.com/kejg3fv</a></p>
<p>General_IPC-HX5(4)XXX_Eng_P_Stream3_V2.420.0002.0.R.20140621.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/pfmevdu" target="_blank" rel="noopener">http://tinyurl.com/pfmevdu</a></p>
<p>General_IPC-HX5(4)XXX_Eng_N_Stream3_V2.420.0003.0.R.20140930.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/kchslos" target="_blank" rel="noopener">http://tinyurl.com/kchslos</a></p>
<p>General_IPC-HX5(4)XXX_Eng_N_V2.420.0003.0.R.20140930.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/ok4f8fx" target="_blank" rel="noopener">http://tinyurl.com/ok4f8fx</a></p>
<p>General_IPC-HX5(4)XXX_Eng_N_Stream3_V2.420.0005.0.R.20141205.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. <a href="http://tinyurl.com/qbrfg3k" target="_blank" rel="noopener">http://tinyurl.com/qbrfg3k</a></p>
<p>General_IPC-HX5(4)XXX_Eng_P_Stream3_V2.420.0005.0.R.20141205.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. <a href="http://tinyurl.com/ot99vgw" target="_blank" rel="noopener">http://tinyurl.com/ot99vgw</a></p>
<p>DH_IPC-HX8XXX_Eng_NP_V2.400.0000.2.R.20140506.bin &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. <a href="http://tinyurl.com/lbar98x" target="_blank" rel="noopener">http://tinyurl.com/lbar98x</a></p>
<p>I will also post the bare metal img files when I get some time which contain the firmware and all the img files including the update.img that can be used for serial recovery.</p>
<p>I have just started the process of uploading firmware&#8230; There are much more to come as well as many more camera models.</p>
<p>Also if you have any you want to share please PM me what you have and where I can link them to this thread.</p>
<p>Thanks to Euly for sharing firmware files!</p>
<p>IMPORTANT NOTE FOR IPC-HFW4300S-V2 CAMERAS</p>
<p>The new camera appears to have differences (a few that I already found) that makes some of the general firmware incompatible with them. I have found a workaround, but it is complex. I will try to summarize it in a separate thread in the following weeks. I will also repackage the newest firmware files in versions that will work for the V2 cameras. Stay tuned! In the meantime, you can use General_IPC-HX5(4)XXX_Eng_N_V2.210.0000.21.R.20140613.bin or the PAL equivalent to recover your camera.</p>
<p>Well, that&#8217;s all I have time to share for now, but I&#8217;ll do my best to put together a comprehensive guide to the inner workings of these cameras and a guide to unbrick in any failed software situation.</p>
<p>Thanks and take care.</p>
<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.nvripc.com/unbricking-your-dahua-ip-camera-tips-tricks-firmware/">Unbricking your Dahua IP camera (Tips, Tricks &#038; Firmware)</a> first appeared on <a rel="nofollow" href="https://www.nvripc.com">NVR IPCAMERA SECURITY</a>.&lt;/p&gt;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nvripc.com/unbricking-your-dahua-ip-camera-tips-tricks-firmware/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>BIOS or SPI programming on Windows or Linux</title>
		<link>https://www.nvripc.com/bios-or-spi-programming-on-windows-or-linux/</link>
					<comments>https://www.nvripc.com/bios-or-spi-programming-on-windows-or-linux/#comments</comments>
		
		<dc:creator><![CDATA[M.Salih ASLAN]]></dc:creator>
		<pubDate>Fri, 02 Jul 2021 07:15:14 +0000</pubDate>
				<category><![CDATA[Guide]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Access Point]]></category>
		<category><![CDATA[acti]]></category>
		<category><![CDATA[BIOS]]></category>
		<category><![CDATA[BIOS ROM]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Feature]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[nvr]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[YouTube]]></category>
		<guid isPermaLink="false">https://www.nvripc.com/?p=2494</guid>

					<description><![CDATA[<p>Without a working BIOS, even the most powerful hardware can’t be brought to life. In some rare cases, the BIOS chip in your system can become corrupt, which will return your system completely unusable. To fix this situation but also for other reasons like simply a backup, tuning, modding or enabling hidden features, flashing your [&#8230;]</p>
<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.nvripc.com/bios-or-spi-programming-on-windows-or-linux/">BIOS or SPI programming on Windows or Linux</a> first appeared on <a rel="nofollow" href="https://www.nvripc.com">NVR IPCAMERA SECURITY</a>.&lt;/p&gt;</p>
]]></description>
										<content:encoded><![CDATA[<p>Without a working BIOS, even the most powerful hardware can’t be brought to life. In some rare cases, the BIOS chip in your system can become corrupt, which will return your system completely unusable. To fix this situation but also for other reasons like simply a backup, tuning, modding or enabling hidden features, flashing your BIOS ROM is interesting. Recently I got in the situation where the BIOS chip in my Lenovo X1 Yoga got corrupt. To fix this, I purchased the CH341a MiniProgrammer. In this post you can find the documented steps I took to reflash the BIOS and bring my laptop back to life.</p>
<p>As mentioned in the introduction, the BIOS chip from my Lenovo X1 Yoga laptop got corrupt and I managed to repair things by reflashing it with a working BIOS ROM. For this article, I will repeat the steps I took, on a Dell Precision T1700 MT. The process is exactly the same.</p>
<blockquote><p>editor&#8217;s note: the following explanation also applies to dvr or nvr recorders.</p></blockquote>
<h2>Youtube Video</h2>
<p>If you are interested, I also created a YouTube video from this blogpost. If you prefer classic text, you can just follow the rest of this article:</p>
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
<div class="wp-block-embed__wrapper"><iframe title="BIOS Flashing on Windows or Linux using a CH341a MiniProgrammer" src="https://www.youtube.com/embed/r8f-3syiFSc?feature=oembed" width="584" height="329" frameborder="0" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe></div>
</figure>
<h1>Introduction</h1>
<p>There are several ways to (re-)program the contents on your BIOS chip. The easiest is by running a BIOS update/programming tool directly on your working machine. The BIOS is mostly only used during the initial boot time and can safely be reflashed on a started system. Obviously, for that to work, the system still has to be able to boot. If this is no longer the case, you will need to reprogram the BIOS using another device.</p>
<p>BIOS chips come in several different packages. Today, in my experience, most of the times, a SOIC-8 package is used. This is a soldered 8 pin (2×4) IC. This was the case for the Lenovo X1 yoga but also for the Dell Precision T1700 MT and some other systems I checked.</p>
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" class="wp-image-982" src="https://jensd.be/wp-content/uploads/2020-12-23-16_56_36-P1000035.JPG-Windows-Photo-Viewer-1024x643.png" sizes="(max-width: 1024px) 100vw, 1024px" srcset="https://jensd.be/wp-content/uploads/2020-12-23-16_56_36-P1000035.JPG-Windows-Photo-Viewer-1024x643.png 1024w, https://jensd.be/wp-content/uploads/2020-12-23-16_56_36-P1000035.JPG-Windows-Photo-Viewer-300x188.png 300w, https://jensd.be/wp-content/uploads/2020-12-23-16_56_36-P1000035.JPG-Windows-Photo-Viewer-768x482.png 768w, https://jensd.be/wp-content/uploads/2020-12-23-16_56_36-P1000035.JPG-Windows-Photo-Viewer-478x300.png 478w, https://jensd.be/wp-content/uploads/2020-12-23-16_56_36-P1000035.JPG-Windows-Photo-Viewer.png 1247w" alt="" width="1024" height="643" /></figure>
<h1>Hardware requirements</h1>
<h2>1) Programmer</h2>
<p>In order to read and write the contents on our BIOS chip, we will need a programmer that can physically connect with it and perform those actions.</p>
<p>There are a lot of different types of programmers out there but a popular model, most likely due it’s wide availability for low prices on Ebay, Amazon or Aliexpress, is the CH341a MiniProgrammer:</p>
<figure class="wp-block-image size-large"><img decoding="async" class="wp-image-985" src="https://jensd.be/wp-content/uploads/image-12-1024x413.png" sizes="(max-width: 1024px) 100vw, 1024px" srcset="https://jensd.be/wp-content/uploads/image-12-1024x413.png 1024w, https://jensd.be/wp-content/uploads/image-12-300x121.png 300w, https://jensd.be/wp-content/uploads/image-12-768x309.png 768w, https://jensd.be/wp-content/uploads/image-12-500x201.png 500w, https://jensd.be/wp-content/uploads/image-12.png 1395w" alt="" width="1024" height="413" /></figure>
<p>This device allows a variety of options to program/flash SPI flash or BIOS chips but also other types of EEPROMs of type 24XX and 25XX which are found in various devices like routers, access points, videocards,… and is suited to program the SOIC-8 BIOS chips that are used in a lot of systems these days.</p>
<h2>2) Adapter, cable or clip</h2>
<p>In case your BIOS chip is socketed, you can remove the chip from the board and place it on top of the programmer (with an adapter). If it’s soldered on the board you will either need to de-solder it or use a clamp/clip that fits the package type of your BIOS chip.</p>
<p>Although desoldering this type of IC is not very hard, it’s still a lot easier to use a clip that is suited for the package type. This avoids the need to remove the chip from the motherboard and the risk to potentially damage other components.</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-984" src="https://jensd.be/wp-content/uploads/image-11.png" sizes="auto, (max-width: 970px) 100vw, 970px" srcset="https://jensd.be/wp-content/uploads/image-11.png 970w, https://jensd.be/wp-content/uploads/image-11-300x203.png 300w, https://jensd.be/wp-content/uploads/image-11-768x519.png 768w, https://jensd.be/wp-content/uploads/image-11-444x300.png 444w" alt="" width="970" height="655" /></figure>
<p>The clip, as you can see above, can be placed on top of the chip on the board. When doing so, you need to carefully pay attention that the red wire, indicating pin 1, matches with the side of the IC that has a small dot, indicating pin 1 on chip side.</p>
<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-988" src="https://jensd.be/wp-content/uploads/image-15.png" sizes="auto, (max-width: 155px) 100vw, 155px" srcset="https://jensd.be/wp-content/uploads/image-15.png 310w, https://jensd.be/wp-content/uploads/image-15-291x300.png 291w" alt="" width="155" height="160" /></figure>
</div>
<p>The rest of the connections should follow the same rule. On the CH341a MiniProgrammer, there is also an indication to where pin 1 should be inserted. As you can see, this is more towards the middle: top row, 4th pin from left to right, of the pin layout for a SPI/BIOS chip (type 25).</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-989" src="https://jensd.be/wp-content/uploads/image-16.png" sizes="auto, (max-width: 945px) 100vw, 945px" srcset="https://jensd.be/wp-content/uploads/image-16.png 945w, https://jensd.be/wp-content/uploads/image-16-300x183.png 300w, https://jensd.be/wp-content/uploads/image-16-768x469.png 768w, https://jensd.be/wp-content/uploads/image-16-491x300.png 491w" alt="" width="945" height="577" /></figure>
<p>While connecting the IC to the programmer, make sure the motherboard is powerless and the programmer is not connected to USB either as this could potentially corrupt/erase or even break the BIOS chip.</p>
<h2>3) Locate the BIOS chip on the motherboard</h2>
<p>The location of the BIOS chip on the motherboard is not always very clear. By searching for ICs that look like a SOIC-8 chip, you can already eliminate a lot. If you’re lucky it has a nearby label like BIOS or SPI. Also, I noticed that in most cases it is not too far from the CMOS battery. Unfortunately there is no fixed rule. You probably will need to search a bit or put your hopes on mighty Google to find someone else that already went through the same exercise.</p>
<p>For the Dell system, I found the BIOS chip on the lower right part of the motherboard, next to a label “SPI”:</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-999" src="https://jensd.be/wp-content/uploads/1-1024x677.png" sizes="auto, (max-width: 1024px) 100vw, 1024px" srcset="https://jensd.be/wp-content/uploads/1-1024x677.png 1024w, https://jensd.be/wp-content/uploads/1-300x198.png 300w, https://jensd.be/wp-content/uploads/1-768x508.png 768w, https://jensd.be/wp-content/uploads/1-454x300.png 454w, https://jensd.be/wp-content/uploads/1.png 1222w" alt="" width="1024" height="677" /></figure>
<p>For my Lenovo X1 Yoga, it was harder to find as the laptop has a plastic foil covering the internal components and I didn’t want to completely remove it. It turned out to be located near the cellular modem, under the connector for the screen:</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-1000" src="https://jensd.be/wp-content/uploads/2.png" sizes="auto, (max-width: 845px) 100vw, 845px" srcset="https://jensd.be/wp-content/uploads/2.png 845w, https://jensd.be/wp-content/uploads/2-300x247.png 300w, https://jensd.be/wp-content/uploads/2-768x632.png 768w, https://jensd.be/wp-content/uploads/2-365x300.png 365w" alt="" width="845" height="695" /></figure>
<h2>4) Identify BIOS chip type</h2>
<p>The programmer is not always able to detect the exact chip type. To make sure, you will need to read the physical label on the chip itself or make sure to look up which exact type is used in your system.</p>
<p>For the Dell system I used, the text was pretty readable by taking a proper macro picture and zooming in:</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-994" src="https://jensd.be/wp-content/uploads/image-20.png" sizes="auto, (max-width: 768px) 100vw, 768px" srcset="https://jensd.be/wp-content/uploads/image-20.png 768w, https://jensd.be/wp-content/uploads/image-20-300x198.png 300w, https://jensd.be/wp-content/uploads/image-20-454x300.png 454w" alt="" width="768" height="508" /></figure>
<p>The label is among the detected types: MX25L3273E.</p>
<p>For the Lenovo X1 Yoga, I was not able to read the label as it got washed out somehow. All I could see was the Winbond label. After a quick Google search I found that for that device, the SPI type was W25Q128FV.</p>
<h1>Software requirements</h1>
<h2>Windows</h2>
<p>For Windows, you will need a tool to read and write the contents of the BIOS flash chip. For this post, I used AsProgrammer which you can download from here: https://github.com/nofeletru/UsbAsp-flash/releases/</p>
<p>There are probably other working tools but I found this one to give the best results with the CH341a. Drivers were not needed for the programmer. It just worked when connecting it to USB on Windows 10.</p>
<div class="736ac091fbf8c283d5d3da30f8ba3ea6" data-index="3"></div>
<h2>Linux</h2>
<p>For Linux, similar as in Windows, you will need a tool to read/write to the SPI. Here I used flashrom which is part of most distributions’ repositories. Same as for Windows, no additional kernel modules were needed to recognize and use the CH341a on my system.</p>
<p>You can easily install flashrom using your package manager.</p>
<p>For example for Debian 10:</p>
<pre class="wp-block-code"><code>jensd@deb10:~$ sudo apt install flashom
Reading package lists… Done
Building dependency tree
Reading state information… Done
…
</code></pre>
<p>&nbsp;</p>
<h1>BIOS chip programming</h1>
<p>For both Windows and Linux, the same sequence of steps can be following:</p>
<ol>
<li>Connect the clip to the BIOS chip, nothing should be powered</li>
<li>Connect the clip or adapters to the CH341a programmer</li>
<li>Connect the CH341a programmer to USB.<br />
I recommend using an extension cable instead of putting it directly in your USB port.</li>
<li>Start the tool to program (AsProgrammer for Windows, flashrom for Linux)</li>
<li>Make sure you configure the correct type of programmer and BIOS chip</li>
<li>Read the data from the chip twice and save it to a file each time</li>
<li>Verify the checksum of both files<br />
This is to make sure that there is no corruption when reading data from the chip. As reading in this condition could brick/corrupt it.</li>
<li>Write the correct/modified file to the chip</li>
<li>Optionally perform another read and verify the checksum of this with the written file to make sure the contents matches with what you flashed in it.</li>
</ol>
<h2>Programming under Windows</h2>
<p>We start with step 5 as explained above. After starting AsProgrammer we first need to set it to use a CH341a. This can be done in the hardware menu:</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-991" src="https://jensd.be/wp-content/uploads/image-17.png" alt="" width="278" height="150" /></figure>
<p>Next. we can click the icon to detect the chip type:</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-997" src="https://jensd.be/wp-content/uploads/image-22.png" sizes="auto, (max-width: 584px) 100vw, 584px" srcset="https://jensd.be/wp-content/uploads/image-22.png 584w, https://jensd.be/wp-content/uploads/image-22-300x230.png 300w, https://jensd.be/wp-content/uploads/image-22-391x300.png 391w" alt="" width="584" height="448" /></figure>
<p>As mentioned above, the programmer is not always able to detect the exact type and gives you a list of possible options. We identified the Dell BIOS chip as type MX25L3273E so we can select this from the list here.</p>
<p>Next, step 6, we can read the data from the chip by clicking the icon with the green arrow. Once reading is completed, save the output to a file by clicking on the save (disk) icon.</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-1001" src="https://jensd.be/wp-content/uploads/image-23.png" sizes="auto, (max-width: 356px) 100vw, 356px" srcset="https://jensd.be/wp-content/uploads/image-23.png 356w, https://jensd.be/wp-content/uploads/image-23-300x115.png 300w" alt="" width="356" height="137" /></figure>
<p>It’s important to repeat this step twice as we need to make sure that communication with the IC is working as expected:</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-1003" src="https://jensd.be/wp-content/uploads/Screenshot_2020-12-23-19-52-25-1-1024x576.jpg" sizes="auto, (max-width: 1024px) 100vw, 1024px" srcset="https://jensd.be/wp-content/uploads/Screenshot_2020-12-23-19-52-25-1-1024x576.jpg 1024w, https://jensd.be/wp-content/uploads/Screenshot_2020-12-23-19-52-25-1-300x169.jpg 300w, https://jensd.be/wp-content/uploads/Screenshot_2020-12-23-19-52-25-1-768x432.jpg 768w, https://jensd.be/wp-content/uploads/Screenshot_2020-12-23-19-52-25-1-1536x864.jpg 1536w, https://jensd.be/wp-content/uploads/Screenshot_2020-12-23-19-52-25-1-500x281.jpg 500w, https://jensd.be/wp-content/uploads/Screenshot_2020-12-23-19-52-25-1.jpg 1920w" alt="" width="1024" height="576" /></figure>
<p>After completing and saving the second dump of the BIOS, we can compare the two files to see if they are exactly the same. This is step 7. We can do that easily by calculating the MD5 checksum from them. In Windows this can be done using certutil with the following command:</p>
<pre class="wp-block-code"><code>Microsoft Windows [Version 10.0.18363.1256]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\jensd&gt;cd c:\data\BIOS

c:\data\BIOS&gt;certutil -hashfile bios1 md5
MD5 hash of bios1:
83bcd273cf7a5fd9a1075b823c83a0e2
CertUtil: -hashfile command completed successfully.

c:\data\BIOS&gt;certutil -hashfile bios2 md5
MD5 hash of bios2:
83bcd273cf7a5fd9a1075b823c83a0e2
CertUtil: -hashfile command completed successfully.</code></pre>
<p>In the above output we can see that both files generated the same hash, so they are identical. This is a good indication that communication with the IC and programmer works as expected.</p>
<p>Both files can now be saved as a backup in case things go wrong of in case you want to reflash the BIOS to an older version.</p>
<p>Next, we can finally write the new or modified contents to the BIOS chip. This can be done by first opening a rom file in AsProgrammer, using the open button, then clicking the down arrow next to the write button and choosing Unprotect -&gt; erase -&gt; programm -&gt; verify:</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-1005" src="https://jensd.be/wp-content/uploads/image-25.png" sizes="auto, (max-width: 465px) 100vw, 465px" srcset="https://jensd.be/wp-content/uploads/image-25.png 465w, https://jensd.be/wp-content/uploads/image-25-300x97.png 300w" alt="" width="465" height="150" /></figure>
<p>You can follow the progress and status in the bottom of the window:</p>
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-1006" src="https://jensd.be/wp-content/uploads/image-26.png" sizes="auto, (max-width: 484px) 100vw, 484px" srcset="https://jensd.be/wp-content/uploads/image-26.png 484w, https://jensd.be/wp-content/uploads/image-26-300x68.png 300w" alt="" width="484" height="109" /></figure>
<p>Once programming is done, optionally, you can read the BIOS chip again, as indicated above, and compare the hash of the written file with the actual contents after writing. This is to make sure that there is no corruption and the contents of the chip matches exactly with the data you wanted to be there.</p>
<h2>Programming under Linux</h2>
<p>The steps under Linux are the same as from Windows. Only here we will use the CLI tool flashrom. As on Windows, we need to go through step 5 and set the correct programmer and BIOS type. The easiest is to launch the tool and let it try to detect the type of BIOS chip:</p>
<pre class="wp-block-code"><code>jensd@deb10:~$ sudo flashrom --programmer ch341a_spi -r backup1.bin
flashrom  on Linux 4.19.0-13-amd64 (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Macronix flash chip "MX25L3205(A)" (4096 kB, SPI) on ch341a_spi.
Found Macronix flash chip "MX25L3205D/MX25L3208D" (4096 kB, SPI) on ch341a_spi.
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on ch341a_spi.
Found Macronix flash chip "MX25L3273E" (4096 kB, SPI) on ch341a_spi.
Multiple flash chip definitions match the detected chip(s): "MX25L3205(A)", "MX25L3205D/MX25L3208D", "MX25L3206E/MX25L3208E", "MX25L3273E"
Please specify which chip definition to use with the -c &lt;chipname&gt; option.</code></pre>
<p>Same as with AsProgrammer, we can see that flashrom is able to come up with a selection but we still have to specify the exact type using the -c option. As our type is MX25L3273E, we can now read the contents of the chip and save it to file backup1.bin using the following command:</p>
<pre class="wp-block-code"><code>jensd@deb10:~$ sudo flashrom --programmer ch341a_spi -r backup1.bin -c "MX25L3273E"
flashrom  on Linux 4.19.0-13-amd64 (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Macronix flash chip "MX25L3273E" (4096 kB, SPI) on ch341a_spi.
Reading flash... done.
jensd@deb10:~$ sudo flashrom --programmer ch341a_spi -r backup2.bin -c "MX25L3273E"
flashrom  on Linux 4.19.0-13-amd64 (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Macronix flash chip "MX25L3273E" (4096 kB, SPI) on ch341a_spi.
Reading flash... done.</code></pre>
<p>Same here again is to read the contents twice and save it in two different files. Once done, it’s time for step 7 and we can compare the checksum of the files to see if they are matching:</p>
<pre class="wp-block-code"><code>jensd@deb10:~$ md5sum backup1.bin
83bcd273cf7a5fd9a1075b823c83a0e2  backup1.bin
jensd@deb10:~$ md5sum backup2.bin
83bcd273cf7a5fd9a1075b823c83a0e2  backup2.bin</code></pre>
<p>Like on Windows, using this method we can be sure that the programmer can communicate properly with the chip and we reduce the chance for corruption. All seems to be good in the above output. If you see a different hash, you first need to fix this before proceeding.</p>
<p>backup1.bin and backup2.bin can be saved for later as they are a proper backup of the current contents of you BIOS chip.</p>
<p>The next step is to write the backup, dump or modded file using flashrom. This time we use the -w option and specify the input file:</p>
<pre class="wp-block-code"><code>jensd@deb10:~$ sudo flashrom --programmer ch341a_spi -w bios.bin -c "MX25L3273E"
flashrom  on Linux 4.19.0-13-amd64 (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Macronix flash chip "MX25L3273E" (4096 kB, SPI) on ch341a_spi.
Reading old flash chip contents... done.
Erasing and writing flash chip...
Warning: Chip content is identical to the requested image.
Erase/write done.</code></pre>
<p>Optionally here as well is to read the contents again and to compare the MD5 checksum with the file we used as input (bios.bin).</p>
<p>In the example above, I wrote back the earlier backed up file, so flashrom was smart enough to detect this and give me a warning about it.</p>
<p>&nbsp;</p>
<p>Hopefully this article can help some people that, just like I was, feel bad because their expensive piece of hardware completely stopped working just because the contents of one tiny IC got corrupted.</p>
<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.nvripc.com/bios-or-spi-programming-on-windows-or-linux/">BIOS or SPI programming on Windows or Linux</a> first appeared on <a rel="nofollow" href="https://www.nvripc.com">NVR IPCAMERA SECURITY</a>.&lt;/p&gt;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nvripc.com/bios-or-spi-programming-on-windows-or-linux/feed/</wfw:commentRss>
			<slash:comments>27</slash:comments>
		
		
			</item>
	</channel>
</rss>
