projects:zsun-wifi-card-reader
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
projects:zsun-wifi-card-reader [2016/01/26 14:19] – [OpenWrt] litrówka dfgg | projects:zsun-wifi-card-reader [2017/09/12 18:35] – [Hardware hacking] emeryth | ||
---|---|---|---|
Line 4: | Line 4: | ||
The goal of this project is to learn as much as possible about the Zsun WiFi card reader and run OpenWrt on it to turn it into an awesome wifi device. | The goal of this project is to learn as much as possible about the Zsun WiFi card reader and run OpenWrt on it to turn it into an awesome wifi device. | ||
+ | **UPDATE 2017-09-12** Info about LEDE and USB gadget working \\ | ||
+ | **UPDATE 2016-11-28** Adding some more info about the new PCB revision, thanks to Erik Dorner, who sent me his analysis a long time ago \\ | ||
+ | **UPDATE 2016-04-23** The new PCB is missing a jumper on the RX serial line, see serial port section \\ | ||
+ | **UPDATE 2016-03-16** The second PCB revision has identical software and hardware (apart from optimized minor component layout), flashing works the same \\ | ||
+ | **UPDATE 2016-03-12** We now know that there are at least two different PCB versions of the reader! | ||
+ | **UPDATE 2016-02-21** github mirror at https:// | ||
+ | **UPDATE 2016-01-27** informatic seems to have figured out how to use the original firmware' | ||
=== People Involved === | === People Involved === | ||
Line 38: | Line 45: | ||
\\ | \\ | ||
The device consists of two PCBs sandwiched together and connected via 8 pins.\\ | The device consists of two PCBs sandwiched together and connected via 8 pins.\\ | ||
+ | **WARNING** There are at least 2 PCB revisions, our original research was on the " | ||
+ | The new revision has optimized layout with some minor changes, software is identical. | ||
+ | |||
The bottom PCB contains only the SD card reader chip and SD slot, it can be safely removed without affecting operation. | The bottom PCB contains only the SD card reader chip and SD slot, it can be safely removed without affecting operation. | ||
+ | **This is only true for the old PCB revision!** The new revision moved the 3.3V regulator to the PCB with the card reader. | ||
+ | |||
=== Serial Port === | === Serial Port === | ||
Line 45: | Line 57: | ||
Bitrate is 115200. | Bitrate is 115200. | ||
- | Original firmware root password is " | + | Original firmware root password is " |
+ | |||
+ | The new PCB has a missing jumper that connects the serial RX testpad to the SoC. Short it or solder directly to the lower pad of the jumper to use serial. | ||
+ | (The second missing resistor is a pull up/down, I guess) | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Thanks to Andreas H. for the clear picture of the new PCB. | ||
=== Ethernet Port === | === Ethernet Port === | ||
Line 52: | Line 71: | ||
Use a Magjack or similar connector with magnetics.\\ | Use a Magjack or similar connector with magnetics.\\ | ||
This port is required for uploading images to u-boot.\\ | This port is required for uploading images to u-boot.\\ | ||
+ | |||
+ | Here's how to properly connect the ethernet port, thanks to **Erik Dorner**: \\ | ||
+ | |||
+ | The AR9331 uses a current-mode line driver, which, in practical terms, means that the center taps of the primary coils of the Ethernet transformer must be connected to the PHY power supply voltage (2.0V for the AR9331).\\ | ||
+ | The SoC is capable of producing this voltage, but it needs some external components (a general purpose PNP transistor and some filter/ | ||
+ | Fortunately, | ||
+ | |||
+ | {{: | ||
+ | |||
+ | If you don't care that much, you can connect 3.3V to the center taps, it should work. | ||
=== USB switch === | === USB switch === | ||
Line 89: | Line 118: | ||
AR9331 is capable of working as a usb device (gadget). | AR9331 is capable of working as a usb device (gadget). | ||
- | Unfortunately the code for that exists only as a patch for an old version of OpenWrt: | + | <del>Unfortunately the code for that exists only as a patch for an old version of OpenWrt:</ |
http:// | http:// | ||
+ | |||
+ | **The USB device/ | ||
+ | |||
+ | (It's not in the 17.01 stable release, though) | ||
So if you want to use the zsun as a USB gadget you will need to: | So if you want to use the zsun as a USB gadget you will need to: | ||
- | - Port the code | + | - <del>Port the code</ |
- Remove the bootstrap resistor setting USB to host mode | - Remove the bootstrap resistor setting USB to host mode | ||
- Remove the card reader PCB and rewire the the USB signal pins | - Remove the card reader PCB and rewire the the USB signal pins | ||
Line 102: | Line 135: | ||
Source: [[http:// | Source: [[http:// | ||
- | Regular telnet | + | Regular telnet |
< | < | ||
Line 137: | Line 170: | ||
My OpenWrt port, based on the 15.05 "Chaos Calmer" | My OpenWrt port, based on the 15.05 "Chaos Calmer" | ||
https:// | https:// | ||
+ | |||
+ | **You have to clone the " | ||
+ | git clone -b zsun https:// | ||
+ | |||
+ | Github mirror: | ||
+ | https:// | ||
Compiled images and image builder: \\ | Compiled images and image builder: \\ | ||
Line 150: | Line 189: | ||
* The SD card reader is reset every time a card is inserted or removed | * The SD card reader is reset every time a card is inserted or removed | ||
+ | |||
+ | ==== Backing up the original firmware ==== | ||
+ | |||
+ | \\ | ||
+ | **YOU SHOULD DO THIS BEFORE ATTEMPTING TO FLASH** \\ | ||
+ | At the end of the flash chip there is an " | ||
+ | You can backup the entire flash over telnet by using dd. | ||
+ | |||
+ | < | ||
+ | |||
+ | **Do this with all the mtd partitions (mtd0 to mtd5)** | ||
+ | |||
+ | Then make a symlink to /tmp in /etc/disk so you can download the files via the web interface. | ||
+ | |||
+ | |||
+ | < | ||
==== Flashing ==== | ==== Flashing ==== | ||
Line 157: | Line 212: | ||
- Reflash the firmware from the original firmware using mtd_write (easy but you have to do it right on the first try) | - Reflash the firmware from the original firmware using mtd_write (easy but you have to do it right on the first try) | ||
- Attach a programmer to the flash chip (impossible to mess up) | - Attach a programmer to the flash chip (impossible to mess up) | ||
+ | - Use the original firmware' | ||
Line 171: | Line 227: | ||
</ | </ | ||
- | Where openwrt.bin is your rootfs+kernel image (in that order!). | + | Where openwrt.bin is your rootfs+kernel image (in that order! and the kernel must be at the correct offset!), that is **openwrt-ar71xx-generic-zsun-sdreader-squashfs-sysupgrade.bin** if you're using our image. |
Line 185: | Line 241: | ||
# serves files off your current directory, remember to chmod o+r files you'd like to use</ | # serves files off your current directory, remember to chmod o+r files you'd like to use</ | ||
- | Then download your files onto zsun's /tmp (ramfs is mounted there), copy mtd_write to ramfs too, just to be safe, and write them with mtd_write. | + | Then download your files onto zsun's /tmp (ramfs is mounted there), just to be safe, and write them with mtd_write. |
Keep in mind **you have to flash kernel first**, since rootfs is used by running system. | Keep in mind **you have to flash kernel first**, since rootfs is used by running system. | ||
Line 219: | Line 275: | ||
"//Bus error//" | "//Bus error//" | ||
+ | |||
+ | === Using the original firmware' | ||
+ | |||
+ | Device can be flashed without any special tools even in Windows by copying special update package with SMB/Network Shares and opening two URLs. More information here: | ||
+ | [[projects: | ||
==== Pictures ==== | ==== Pictures ==== | ||
Line 226: | Line 287: | ||
{{: | {{: | ||
{{: | {{: | ||
+ | {{: |
projects/zsun-wifi-card-reader.txt · Last modified: 2020/02/12 16:14 by emeryth