If you ever brick your router by uploading the wrong firmware, thus corrupting the bootloader, the only way you could restore it is by writing directly to flash IC.
Desoldering flash memory
The TP-link WR642G uses an SPI Spansion FL016A1F which first need to be desoldered. I found out that the solder bridge method works quite well as it helps diffuse the heat across all legs at the same time, check the video below for more details:
Then you need to wire the flash to your MCU following the layout found on the Spansion datasheet (take into consideration the fact that the flash IC runs at 3.3v).
For convenience I soldered the flash IC on a breakout board left from another project:
I wrote a small program in plain C to dump flash memory through the SPI bus to the UART interface. you can git clone git://github.com/orfix/spiflash my source code or write your own if you like :)
The entire 2MiB dump takes around ~3min if the console is configured with a baudrate of 115200.