<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Hamsterkraft</title>
 <link href="http://localhost:4000/feed.xml" rel="self"/>
 <link href="http://localhost:4000/"/>
 <updated>2020-09-08T19:47:24+02:00</updated>
 <id>http://localhost:4000/</id>
 <author>
   <name>psychowoife</name>
   <email>admin@hamsterkraft.de</email>
 </author>

 
 <entry>
   <title>TL-WR841 RAM/ROM Upgrade</title>
   <link href="http://localhost:4000/hardware/2020/08/TP-Link_TL-WR841_RAM_ROM.html"/>
   <updated>2020-08-24T00:00:00+02:00</updated>
   <id>http://localhost:4000/hardware/2020/08/TP-Link_TL-WR841_RAM_ROM</id>
   <content type="html">&lt;p&gt;(Tutorial for TP-Link TL-WR841N(D) v8,v9,v10,v11,v12)&lt;/p&gt;

&lt;p&gt;With the next release of OpenWRT (&amp;gt;19.07.3) no images for devices only containing 4Mbyte flash and 32Mbyte RAM will be build. So devices like the TP-Link TL-WR841N will get no future images. But luckily the popular TP-Link TL-WR841N can be fairly easily upgraded, provided one is able to solder smd components, and building your own image is no magic.&lt;/p&gt;

&lt;p&gt;Starting with 19.07.0 OpenWRT switched TL-WR841N from target &lt;em&gt;ar71xx&lt;/em&gt; into the new &lt;em&gt;ath79&lt;/em&gt; target. Due to Flash size limitation all pre-build images do not contain a webinterface. To make flashing easier after switching to a new ROM chip, we will initially use a 18.0x.x build with included webinterface.
After building our own fresh image including a webinterface and a more recent linux kernel we can flash it with no problems afterwards.&lt;/p&gt;

&lt;p&gt;The most difficult part is the RAM upgrade, because the TSOP-II 66pin chip is not the easiest to desolder. I’ve done my swap with the help of a hot-air station. This step may be optional but without, OpenWRT will easily run out ouf RAM and you may be very limited functionality wise.&lt;/p&gt;

&lt;p&gt;Swapping the ROM chip is not to difficult. A hot-air station may make the process a breeze, but using only a soldering iron is barely harder.&lt;/p&gt;

&lt;p&gt;Helpful tools for soldering are a pair of small tweezers, solder, flux, and solder-wick.&lt;/p&gt;

&lt;h1 id=&quot;prequisites&quot;&gt;&lt;small&gt;&lt;strong&gt;Prequisites:&lt;/strong&gt;&lt;/small&gt;&lt;/h1&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;64Mbyte RAM chip -&amp;gt; optional but recommended&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;8/16Mbyte flash chip&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;flash programmer&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Linux (Windows possible by using cygwin)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;for possible RAM and ROM chips look at the bottom tables.&lt;/p&gt;

&lt;p&gt;to read the old flash chip and write the new one, a flash programmer is needed. I used the TL866CS MiniPro. There are plenty of options for flash programmer, like the CH341A (popular for BIOS flashing) and you can easily use a raspberry pi (just search for raspberry pi SPI flasher).&lt;/p&gt;

&lt;p class=&quot;orange&quot;&gt;&lt;span class=&quot;closebtn&quot; onclick=&quot;this.parentElement.style.display='none';&quot;&gt;&amp;times;&lt;/span&gt;&lt;small&gt;&lt;b&gt;Warning!&lt;/b&gt; Doing upgrades step by step, will help troubleshooting in case of problems. Do either ROM or RAM first and check before progressing&lt;/small&gt;&lt;/p&gt;

&lt;h1 id=&quot;open-device&quot;&gt;&lt;small&gt;&lt;strong&gt;Open Device&lt;/strong&gt;&lt;/small&gt;&lt;/h1&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/open_00.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/open_00_small.png&quot; alt=&quot;open_00&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;remove screws under both foots&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/open_01.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/open_01_small.png&quot; alt=&quot;open_01&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;use plastic spudger to open clips&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/open_02.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/open_02_small.png&quot; alt=&quot;open_02&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;clip on bottom side&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/open_03.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/open_03_small.png&quot; alt=&quot;open_03&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;clip on top side&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/board_overview.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/board_overview_small.png&quot; alt=&quot;board_overview&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;PCB v11 (v12 looks identical)&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h1 id=&quot;ram&quot;&gt;&lt;small&gt;&lt;strong&gt;RAM&lt;/strong&gt;&lt;/small&gt;&lt;/h1&gt;

&lt;p&gt;to upgrade RAM only swapping of the RAM chip has to be done.&lt;/p&gt;

&lt;p class=&quot;red&quot;&gt;&lt;span class=&quot;closebtn&quot; onclick=&quot;this.parentElement.style.display='none';&quot;&gt;&amp;times;&lt;/span&gt;&lt;small&gt;&lt;b&gt;Warning!&lt;/b&gt; Be careful to not knock of any small components around the RAM chip or damage any traces or pads. Doing so will most probably render your device inoperable. &lt;/small&gt;&lt;/p&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/RAM.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/RAM_small.png&quot; alt=&quot;RAM&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;original 32M RAM&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;the best method (in my opinion) to remove the old chip, is by using a hot-air station with flux. But if you don’t care about the old RAM chip surviving you can take a box cutting knife and carefully cut off the legs as close as possible to the chip. Do not cut into the PCB by doing so. The remaining legs on the board can be removed with a normal solderin iron one by one.&lt;/p&gt;

&lt;p&gt;After the chip is removed, use some flux and solder wick to clean of the solder pads.&lt;/p&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/newRAM.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/newRAM_small.png&quot; alt=&quot;newRAM&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;new 64M RAM&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Place the new RAM chip in the right orientation (white mark on board corresponds to indent on chip) on the pads. First only solder one of the corner legs to align and stabilize the chip. Next solder the corner on the opposite site before you can solder the rest.&lt;/p&gt;

&lt;p&gt;If all went good the new RAM will be automaticly detected by the Processor and the device will start just fine. It can also be checked on the Overview in luci webinterface or via ssh.&lt;/p&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/memory.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/memory.png&quot; alt=&quot;64M Memory&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;working 64M Memory&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h1 id=&quot;rom&quot;&gt;&lt;small&gt;&lt;strong&gt;ROM&lt;/strong&gt;&lt;/small&gt;&lt;/h1&gt;

&lt;p&gt;As the first step we need a dump of the original ROM to extract the ART-partition (Atheros Radio Test). Without this the wireless will not work.&lt;/p&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/ROM.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/ROM_small.png&quot; alt=&quot;ROM&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;4M flash ROM (25Q32CS)&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;To dump the rom, remove the chip and put it in a flash programmer. Due to the necessity of flash programmer for writing new chip anyway, dumping through ssh when OpenWRT is already running on device is not scope of this tutorial.&lt;/p&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/tl866.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/tl866_small.png&quot; alt=&quot;TL866CS&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;TL866CS Programmer with SOP8 adapter&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/clamp.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/clamp_small.png&quot; alt=&quot;SOP8_Clamp&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;clamp for SOP8 chips&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/ch341a.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/ch341a_small.png&quot; alt=&quot;ch341a&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;CH341A programmer&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Also a raspberry pi can be used as a SPI flash programmer needing basicly only a couple wires.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Flash ROM&lt;/th&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Raspberry Pi&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;!SS (1)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;GPIO8 (SPI0_CED_N)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;MISO (2)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;GPIO9 (SPI0_MISO&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;!WP (3)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;3V3&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;GND (4)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;GND&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;MOSI (5)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;GPIO10 (SPI0_MOSI)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;SCK (6)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;GPIO11 (SPI0_SCLK)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;!HOLD (8)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;3V3&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;VDD (8)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;3V3&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p class=&quot;blue&quot;&gt;&lt;span class=&quot;closebtn&quot; onclick=&quot;this.parentElement.style.display='none';&quot;&gt;&amp;times;&lt;/span&gt;&lt;small&gt;&lt;b&gt;Information:&lt;/b&gt; This tutorial does not show how to use a specific programmer. Focus lies on TL-WR841N specific parts.
 &lt;/small&gt;&lt;/p&gt;

&lt;h1 id=&quot;create-new-flash-image&quot;&gt;&lt;small&gt;Create new flash image&lt;/small&gt;&lt;/h1&gt;
&lt;p&gt;By just copying the old ROM to a bigger flash chip won’t work because of the partition layout needed for booting the device. The ART-partition has to be at the end of the flash rom and by simply copying it would end up somewhere in the middle. So the first step is to extract this partition. Also the original firmware will not work anymore.&lt;/p&gt;

&lt;p&gt;To prevent an unbootable device we also change the bootloader to &lt;a href=&quot;https://github.com/pepe2k/u-boot_mod&quot;&gt;u-boot-mod&lt;/a&gt; to get best compatability with a range of flash chips and very good firmware recovery options.&lt;/p&gt;

&lt;p class=&quot;message&quot;&gt;&lt;span class=&quot;closebtn&quot; onclick=&quot;this.parentElement.style.display='none';&quot;&gt;&amp;times;&lt;/span&gt;&lt;small&gt;&lt;b&gt;&lt;/b&gt; Independent of the method used, a ROM dump of 4M size should be extracted. This will be refered to 'dump.bin' from here on.&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;the last 64 Kbyte of the dump contains the ART-partition.
to extract it:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ibs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4k &lt;span class=&quot;nv&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1008 &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;dump.bin &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;art.bin&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;create an zero filled dummy out.bin file with the size of the new flash chip&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/zero &lt;span class=&quot;nv&quot;&gt;ibs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4k &lt;span class=&quot;nv&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4096 | &lt;span class=&quot;nb&quot;&gt;tr&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\0&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;00&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\3&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;77&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; out.bin
&lt;span class=&quot;c&quot;&gt;#for 8MB chips use 2048 instead of 4096&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;copy ART-partition to the end of out.bin&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;notrunc &lt;span class=&quot;nv&quot;&gt;obs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4k &lt;span class=&quot;nv&quot;&gt;seek&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4080 &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;art.bin &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;out.bin
&lt;span class=&quot;c&quot;&gt;#for 8MB chips use 2032 instead of 4080&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;download &lt;a href=&quot;/DO_NOT_DELETE/jenkins/uboot&quot;&gt;bootloader&lt;/a&gt; version for your device (for v12 use v11 uboot) and copy it to the beginning of out.bin&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;notrunc &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;tp-link-tl-wr841n-vVERSION.bin &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;out.bin
&lt;span class=&quot;c&quot;&gt;#replace VERSION with your device version&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;download &lt;a href=&quot;https://downloads.openwrt.org/releases/18.06.8/targets/ar71xx/tiny/&quot;&gt;OpenWRT image&lt;/a&gt; for your device (tl-wr841-vVERSION-squashfs-sysupgrade.bin). Every release version &amp;lt;19.0x.x will suffice as we will upgrade to newer ath79 target image later. Afterwards we copy it into the out.bin behind the bootloader.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;notrunc &lt;span class=&quot;nv&quot;&gt;obs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;4k &lt;span class=&quot;nv&quot;&gt;seek&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;32 &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;tl-wr841-vVERSION-squashfs-sysupgrade.bin &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;out.bin
&lt;span class=&quot;c&quot;&gt;#replace VERSION with your device version&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;for proper operation the MAC address and version string has to be written inside the image.&lt;/p&gt;

&lt;p class=&quot;yellow&quot;&gt;&lt;span class=&quot;closebtn&quot; onclick=&quot;this.parentElement.style.display='none';&quot;&gt;&amp;times;&lt;/span&gt;&lt;small&gt;&lt;b&gt;Warning!&lt;/b&gt; Not setting the correct version string will lead to problems with flashing firmware later on&lt;/small&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'\xAA\xBB\xCC\xDD\xEE\xFF'&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;notrunc &lt;span class=&quot;nv&quot;&gt;ibs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 &lt;span class=&quot;nv&quot;&gt;obs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;256 &lt;span class=&quot;nv&quot;&gt;seek&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;508 &lt;span class=&quot;nv&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;6 &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;out.bin
&lt;span class=&quot;c&quot;&gt;#replace AA BB CC DD EE FF with MAC address on bottom label of device&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'\x08\x41\x00\xVERSION\x00\x00\x00\x01'&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;notrunc &lt;span class=&quot;nv&quot;&gt;ibs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1 &lt;span class=&quot;nv&quot;&gt;obs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;256 &lt;span class=&quot;nv&quot;&gt;seek&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;509 &lt;span class=&quot;nv&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8 &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;out.bin
&lt;span class=&quot;c&quot;&gt;#replace VERSION with your device version written with leading 0 if only one letter (e.g. \xVERSION -&amp;gt; \x09 for v9)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;now the out.bin image is ready to be flashed to the new chip. Afterwards it can be soldered in place of the old chip and the device is ready to be booted.&lt;/p&gt;

&lt;h1 id=&quot;pre-builtd-images&quot;&gt;&lt;small&gt;Pre-builtd images&lt;/small&gt;&lt;/h1&gt;

&lt;p class=&quot;blue&quot;&gt;&lt;span class=&quot;closebtn&quot; onclick=&quot;this.parentElement.style.display='none';&quot;&gt;&amp;times;&lt;/span&gt;&lt;small&gt;&lt;b&gt;&lt;/b&gt; pre-built images for 16M v11 and v12 can be found in the following link&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/DO_NOT_DELETE/jenkins/owrt&quot;&gt;16M_builds&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;building-newest-version-with-webinterface&quot;&gt;&lt;small&gt;Building newest version with webinterface&lt;/small&gt;&lt;/h1&gt;

&lt;p&gt;for dependencies necessary to build own image refer to official &lt;a href=&quot;https://openwrt.org/docs/guide-developer/build-system/install-buildsystem#examples_of_package_installations&quot;&gt;site&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;following steps should NOT be done as ‘root’ or with ‘sudo’&lt;/p&gt;

&lt;p&gt;clone OpenWRT git repository&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;git clone https://git.openwrt.org/openwrt/openwrt.git openwrt&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;change into the openwrt directory&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;openwrt&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;update and install feeds (e.g. needed for luci webinterface)&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;./scripts/feeds update &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt;
./scripts/feeds &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;at this point an adjustment to some source files is necessary to build an image using the new flash size.
edit following files:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;in this part the addresses must be adjusted for 8/16M flash size&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-plaintext&quot; data-lang=&quot;plaintext&quot;&gt;flash@0 {
		compatible = &quot;jedec,spi-nor&quot;;
		reg = &amp;lt;0&amp;gt;;
		spi-max-frequency = &amp;lt;25000000&amp;gt;;

		partitions {
			compatible = &quot;fixed-partitions&quot;;
			#address-cells = &amp;lt;1&amp;gt;;
			#size-cells = &amp;lt;1&amp;gt;;

			uboot: partition@0 {
				label = &quot;u-boot&quot;;
				reg = &amp;lt;0x000000 0x020000&amp;gt;;
				read-only;
			};

			partition@20000 {
				compatible = &quot;tplink,firmware&quot;;
				label = &quot;firmware&quot;;
				reg = &amp;lt;0x020000 0x3d0000&amp;gt;;
			};

			art: partition@3f0000 {
				label = &quot;art&quot;;
				reg = &amp;lt;0x3f0000 0x010000&amp;gt;;
				read-only;
			};
		};&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;here are the finished changes&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-plaintext&quot; data-lang=&quot;plaintext&quot;&gt;flash@0 {
		compatible = &quot;jedec,spi-nor&quot;;
		reg = &amp;lt;0&amp;gt;;
		spi-max-frequency = &amp;lt;25000000&amp;gt;;

		partitions {
			compatible = &quot;fixed-partitions&quot;;
			#address-cells = &amp;lt;1&amp;gt;;
			#size-cells = &amp;lt;1&amp;gt;;

			uboot: partition@0 {
				label = &quot;u-boot&quot;;
				reg = &amp;lt;0x000000 0x020000&amp;gt;;
				read-only;
			};

			partition@20000 {
				compatible = &quot;tplink,firmware&quot;;
				label = &quot;firmware&quot;;
				reg = &amp;lt;0x020000 0xfd0000&amp;gt;; //for 8M use 0xfa0000 instead of 0xfd0000
			};

			art: partition@ff0000 {       //for 8M use fc0000 instead of ff0000
				label = &quot;art&quot;;
				reg = &amp;lt;0xff0000 0x010000&amp;gt;; //for 8M use 0xfc0000 instead of 0xff0000
				read-only;
			};
		};&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;em&gt;target/linux/ath79/image/tiny-tp-link.mk&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;find your tplink-tl-wr841-vXX version and alter 4mlzma for the new flash size. example shows passage for TL-WR841 v11. This looks similar for all other versions.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-plaintext&quot; data-lang=&quot;plaintext&quot;&gt;define Device/tplink_tl-wr841-v11
  $(Device/tplink-4mlzma)
  SOC := qca9533
  DEVICE_MODEL := TL-WR841N/ND
  DEVICE_VARIANT := v11
  TPLINK_HWID := 0x08410011
  SUPPORTED_DEVICES += tl-wr841n-v11
  IMAGES += factory-us.bin factory-eu.bin
  IMAGE/factory-us.bin := tplink-v1-image factory -C US
  IMAGE/factory-eu.bin := tplink-v1-image factory -C EU
endef
TARGET_DEVICES += tplink_tl-wr841-v11&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;in this example the necessary change made to TL-WR841 v11 is shown, but it’s basically the same for all other versions, just alter there description part of the file.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-plaintext&quot; data-lang=&quot;plaintext&quot;&gt;define Device/tplink_tl-wr841-v11
  $(Device/tplink-16mlzma)    //for 8M use tplink-8mlzma instead of tplink-16mlzma
  SOC := qca9533
  DEVICE_MODEL := TL-WR841N/ND
  DEVICE_VARIANT := v11
  TPLINK_HWID := 0x08410011
  SUPPORTED_DEVICES += tl-wr841n-v11
  IMAGES += factory-us.bin factory-eu.bin
  IMAGE/factory-us.bin := tplink-v1-image factory -C US
  IMAGE/factory-eu.bin := tplink-v1-image factory -C EU
endef
TARGET_DEVICES += tplink_tl-wr841-v11&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;at the next step we will configure the build script to build a image for our device&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;make menuconfig&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;‘Target System’ -&amp;gt; ‘Atheros ATH79 (DTS)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;‘Subtarget’ -&amp;gt; ‘Devices with small flash’&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;‘Target Profile’ -&amp;gt; ‘TP-Link TL-WR841N/ND vVERSION’ (choose your device VERSION here)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;‘LuCI’ -&amp;gt; ‘Collections’ -&amp;gt; &amp;lt;*&amp;gt; ‘luci’ (make sure to mark with * not with M)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/menuconfig_00.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/menuconfig_00.png&quot; alt=&quot;Target&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;choose right target&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/menuconfig_01.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/menuconfig_01.png&quot; alt=&quot;LuCI&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;activate LuCI webinterface&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;afterwards choose exit and save when you are asked&lt;/p&gt;

&lt;p&gt;let the build system download all missing files&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;make download&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;start build&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;make&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;the finished image will be in following folder
&lt;em&gt;bin/targets/ath79/tiny/&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;this can now be flashed via the webinterface&lt;/p&gt;
&lt;p class=&quot;orange&quot;&gt;&lt;span class=&quot;closebtn&quot; onclick=&quot;this.parentElement.style.display='none';&quot;&gt;&amp;times;&lt;/span&gt;&lt;small&gt;&lt;b&gt;Warning!&lt;/b&gt; Settings can NOT be kept because of the switch from *ar71xx* to *ath79*. Keeping the settings will lead to a boot loop and a recovery method will be necessary&lt;/small&gt;&lt;/p&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/system.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/system.png&quot; alt=&quot;ath79 build&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;working new image&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/tl_wr841_upgrade/software.png&quot;&gt;
     &lt;img src=&quot;/assets/tl_wr841_upgrade/software.png&quot; alt=&quot;free space&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;over 11MByte free space&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h1 id=&quot;recovey-method-with-new-uboot&quot;&gt;&lt;small&gt;Recovey method with new uboot&lt;/small&gt;&lt;/h1&gt;
&lt;p&gt;by holding the reset button for 3-4sec after powering on the device, it will start a recovery webinterface with the IP: 192.168.1.1&lt;/p&gt;

&lt;h1 id=&quot;possible-chips&quot;&gt;&lt;small&gt;Possible chips&lt;/small&gt;&lt;/h1&gt;
&lt;p&gt;This list only shows examples and is by no means exhaustive. All similar chips, meeting the specifications should work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RAM (64MByte/512MBit DDR1 32Mx16 TSOP-II 66pin)&lt;/strong&gt;&lt;/p&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;/assets/tl_wr841_upgrade/HYSCS02382-1.pdf&quot;&gt;Hynix HY5DU121622CTP-D43&lt;/a&gt; -&amp;gt; &lt;em&gt;used in this tutorial&lt;/em&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Samsung K4H511638B-TCB3&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Samsung K4H511638D-UCB3&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Elpida D5116AFTA-5B-E&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;ROM (3/3.3V 128/64MBit Serial Flash SOIC8)&lt;/strong&gt;&lt;/p&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Winbond W25Q64 (8MB)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;/assets/tl_wr841_upgrade/w25q128fv.pdf&quot;&gt;Winbond W25Q128 (16MB)&lt;/a&gt; -&amp;gt; &lt;em&gt;used in this tutorial&lt;/em&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Spansion S25FL064P (8MB)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Spansion S25FL127S (16MB)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h1 id=&quot;downloads&quot;&gt;&lt;small&gt;&lt;strong&gt;Downloads:&lt;/strong&gt;&lt;/small&gt;&lt;/h1&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;/DO_NOT_DELETE/jenkins/owrt&quot;&gt;16M_builds&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;/DO_NOT_DELETE/jenkins/uboot&quot;&gt;bootloader&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://downloads.openwrt.org/releases/18.06.8/targets/ar71xx/tiny/&quot;&gt;OpenWRT image&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/pepe2k/u-boot_mod&quot;&gt;u-boot-mod&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

</content>
 </entry>
 
 <entry>
   <title>DB9&lt;&gt;RJ45 serial console cable</title>
   <link href="http://localhost:4000/hardware/2020/08/serial_console_cable.html"/>
   <updated>2020-08-23T00:00:00+02:00</updated>
   <id>http://localhost:4000/hardware/2020/08/serial_console_cable</id>
   <content type="html">&lt;p&gt;On a lot of enterprise type networking gear (e.g. switches) a serial port is present in the form of a rj45 connector. The following adapter is needed to connect to a standard db9 connector found on almost every rs232 serial card.&lt;/p&gt;

&lt;figure&gt;
  &lt;a href=&quot;/assets/console_cable/rj45_db9_rs232_pinout.png&quot;&gt;
     &lt;img src=&quot;/assets/console_cable/rj45_db9_rs232_pinout.png&quot; alt=&quot;rj45&amp;lt;&amp;gt;db9_adapter&quot; /&gt;
  &lt;/a&gt;
  &lt;figcaption&gt;rj45 serial console nullmodem cable pinout.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;This pinout corresponds to the Cisco serial monitor pinout, which is used in a lot of other vendor devices too. (e.g. Quanta LB4M)&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>dyndns IPv6</title>
   <link href="http://localhost:4000/dyndns/2020/08/dyndns_v6.html"/>
   <updated>2020-08-21T00:00:00+02:00</updated>
   <id>http://localhost:4000/dyndns/2020/08/dyndns_v6</id>
   <content type="html">&lt;p&gt;&lt;span class=&quot;soon&quot;&gt;coming soon&lt;/span&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>certbot</title>
   <link href="http://localhost:4000/ssl/dyndns/certbot/2020/08/certbot.html"/>
   <updated>2020-08-21T00:00:00+02:00</updated>
   <id>http://localhost:4000/ssl/dyndns/certbot/2020/08/certbot</id>
   <content type="html">&lt;p&gt;&lt;span class=&quot;soon&quot;&gt;coming soon&lt;/span&gt; this is a work in progress&lt;/p&gt;

&lt;p&gt;add a (sub)domain [add all previous domains too!]&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;certbot certonly &lt;span class=&quot;nt&quot;&gt;--webroot&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; /var/lib/letsencrypt/ &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; domain.tld,sub.domain.tld&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>setup kvm on arch linux</title>
   <link href="http://localhost:4000/virtualization/2020/08/kvm-arch-linux.html"/>
   <updated>2020-08-20T00:00:00+02:00</updated>
   <id>http://localhost:4000/virtualization/2020/08/kvm-arch-linux</id>
   <content type="html">&lt;p&gt;&lt;span class=&quot;soon&quot;&gt;coming soon&lt;/span&gt;&lt;/p&gt;
</content>
 </entry>
 

</feed>
