Tekway MSO

Jump to: navigation, search

by Tinhead

In July 2012 Tekway Technologies Co.,Ltd announced a new Oscilloscope model to expand their product portfolio [1]

However it is not a completly new product, but an Mixed Signal Oscilloscope based on Tekway's DSO2.0 platform model DST1000B. A month later Hantek, who licensed already bevor the DSO 2.0 platfrom from Tekway, announced their own version of these MSO [2], [3]

I was able to get an early unit, which was already looking very promising. As soon i recognized that these MSO are nothing else than DSO mainboard with small Addon-PCB (the LA part of the MSO) and special crafted firmware, the idea was born to build own clone of the LA PCB to "upgrade" my Tekway DSOs.

However, a 8 layer PCB is not cheap, to get a good price i would have to order huge amount of them. Therefore i've asked Tekway directly with the little hope they can sell me these LA PCBs only. The answer was "sure, but you will have to order 200pcs". This was actually 198 more than i hoped, so i've asked other Hantek/Tekway/Volcraft owners here [4],here [5], and here [6] to join me in the collective purchase.

This article is describing the mechanical and as well firmware changes necessary to convert DSO 2.0 Platform DSO to an MSO. This might be one of the following models:

* Tekway DST1000B series - DST1062B, DST1102B, DST1202B
* Hantek B series - DSO5062B, DSO5102B, DSO5202B
* Hantek BM/BMV series - DSO5062BM/BMV, DSO5102BM/BMV, DSO5202BM/BMV
* Voltcraft DSO 3062B
* Voltcraft DSO 1062D
* some of the PCE Instruments (Hantek clones) models [7]
* Hantek Handheld DSO1xxxB/BV series
* Extech Handheld MS6060, MS6100, MS6200

The last two listed models (Extech and Hantek Handhelds) can not be changes to MSO due lack of space in the enclosure and different I/O port pinout.

Even if this was one-off collective purchase and not everybody who asked got an LA PCB, the information collected in this Article can be used to build own DIY LA PCB or simply to test the MSO firmware.


Electronic changes

On the DSO PCB there are only two changes necessary:

- the I/O Header need to be soldered. 
- additional 0R resistro need to be populated to allow the SoC's nGCS4 to
  communicate with LA FPGA. Without the firmware will NOT WORK properly. 
  It can be easy localized, directly near the S3C2440 SoC:

 MSO Tekway R0before.jpg
 MSO Tekway R0after.jpg


Mechanical changes

This is the easy task, simply cut a hole :) I've made an set of (more or less) self-describing pictures and compiled as PDF, so simply check what i did before you start to do any mechanical changes. Check the see Download section below [8]

Firmware upgrade

  • For Hantek BM/BMV series owners

I have NOT yet prepared upgrade procedure for these models. This is basically due the fact that none of the 'collective purchase' purchasers owned BM/BMV model. In principle BM/BMV models are already Linux 2.6.30.4 based (exact as the MSO), but there are afaik some kernel and root fs changes necessary to allow MSO firmware to run on BM/BMV model. I think the easiest way is simply

- run a ful firmware backup, e.g. this tool might be useful [9]
- backup manually DSO setting files (check below what files are affected)
- use JTAG to restore the Master Image file to your DSO - see Download section below
- when ready remove JTAG connector and reboot DSO
- restore manually DSO setting files
- run self-calibration

To convert back to BM/BMV DSO you will have only to copy the BM/BMV model specific DSO application (/dso.exe) and the (model and firmware) specific language files (/OuLanguages/* ) to your DSO. All what necessary to run BM/BMV model DSO is included in MSO kernel/root fs (which is not the case vice versa).

  • For owners of all other - as listed above - Tekway DSO 2.0 platform oscilloscopes

There are two ways to upgrade the firmware

* via UART/USB
* via JTAG

Via JTAG is the easiest way, however not everybody own an USB-Based JTAG and necessary applications to flash the NAND connected to Samusung S3C2440. If you own such JTAG adapter run following steps :

- ensure your DSO is having at lest firmware 2.06.3_121027.0 loaded
- download the Master Image file (see download section below)
- unzip the dst1kb_backup.up to empty Flash Drive, plug in into your 
  DSO and run from Utility Menu the "Firmware update".
- be patient, it can take up to 5 minutes to create all necessary backups! 
- when ready, unplug the Flash Drive an check on your PC the content on the
  folder 'dump' (will be created during firmware update).
  It should contain following (DSO unique/specific!) files:
     chk_base_volt
     mult_adc.log
     tdc.log
     i2c.log
     tdc_edge125M
     tdc_overtime125M
     tdc_pulse125M
     chk1kb_091023
     boot.bin
     kernel.bin
     root.bin
  If one or more file missing please DO NOT proceed with further steps!
- restore via JTAG adapter the mso_ready.bin file to your DSO
  NOTE: this file contains as well OOB blocks (full raw backup)
- when ready remove JTAG connector and reboot DSO. During the first boot 
  you should see ""E2PROM Backing" message:
  Tekway MSO Capture9.jpg
- delete the dst1kb_backup.up file from the Flash Drive
- copy the dst1kb_restore.up file to Flash Drive, plug in into your 
  DSO and run from Utility Menu the "Firmware update".
- when ready, unplug the Flash Drive and let the MSO warm-up properly
- after the warm-up run "Self-calibration" from the Utility Menu

That's all, your DSO is now converted to MSO.


Via UART/USB is not the easiest, but still feasible way. You will need a LVTTL UART to USB converter, like one of the CP21xx based cheap TTL UART USB converter on ebay. Additionally PC Terminal application with Xmodem support (e.g. Hyperterminal) and Windows based PC with DNW.exe application (check download section below). If you not using Windows, ehm no idea how to communicate with supervivi from other OSs. I would say google for it or use the upgrade over JTAG as described above.

The UART port have following pinout:

Tekway MSO uart hw1007.jpg

Even if the +3.3V pin could be used for DIY things, like BT-UART converter, please leave it unused. For firmware upgrade we need only TXD, RXD and GND. The header have 2.0mm pitch, it make sense here to solder a solid header.

First of all check the UART<->USB connectivity, the necessary settings are 115200, 8n1. If you see messages during DSO boot, and you can enter the shell by CTRL+C / ENTER then you are fine here and can continue with the Upgrade procedure:

- ensure your DSO is having at lest firmware 2.06.3_121027.0 loaded
- download the Master Image file (see download section below)
- unzip the dst1kb_backup.up to empty Flash Drive, plug in into your 
  DSO and run from Utility Menu the "Firmware update".
- be patient, it can take up to 5 minutes to create all necessary backups! 
- when ready, unplug the Flash Drive an check on your PC the content on the
  folder 'dump' (will be created during firmware update).
  It should contain following (DSO unique/specific!) files:
     chk_base_volt
     mult_adc.log
     tdc.log
     i2c.log
     tdc_edge125M
     tdc_overtime125M
     tdc_pulse125M
     chk1kb_091023
     boot.bin
     kernel.bin
     root.bin

If one or more file missing please DO NOT proceed with further steps!

- while booting the DSO up try multiple times to hit space key, if the boot
  process have not stopped at following screen power off DSO and try again
  until you see something like that:
  Tekway MSO Capture0.PNG

This is the bootloader prompt. Unfortunately the original Tekway/Hantek bootloader have NO USB support, so you have first to upload another one bootloader (supervivi.bin) to your DSO to enable USB access within bootloader. IMPORTANT: use only the supervivi.bin from Master Image file in the download section. DO NOT use other versions from internet, they can destroy the MTD partitions in the DSOs NAND flash memory.

- to upload the new bootloader type in the bootloader prompt following:
  load flash vivi x
  and push enter key. 
- now in your terminal application (i'm using hyperterm, sure not the best
  solution but it works) choose "Transfer->Send file", select the supervivi.bin,
  select Xmodem as protocol (the x in what you typed in bootloader prompt
  means Xprotocol too). Now you should see somehing like this picture:
  Tekway MSO Capture1.PNG
- when ready, reboot your DSO. During boot hit again multiple times space key
  until the DSO stop at such screen:
  Tekway MSO Capture2.PNG
- if so, type menu and hit Enter to see following supervivi menu:
  
  Tekway MSO Capture4.PNG
  Tekway MSO Capture5.PNG
- now connect the DSO over USB cable to your PC, you should be prompted to 
  install Device Drivers. Use these from download section below. After the
  Device Driver installation un/replug the USB cable and run the dnw.exe
  When you don't see the USB:OK message try to re-plug USB cable, sometimes
  DSO/PC reboot is necessary:
  Tekway MSO Capture3.PNG

If you DO NOT see the USB:OK, please DO NOT proceed with further steps.

- type in the supervivi bootloader menu "r" - this means restore, immediately
  after choose in the dnw.exe menu "Usb Port->Transmit/Restore" and select 
  the mso_ready.bin file.
  NOTE: if you need too long for these steps dnw.exe and/or supervivi will
  timeout here. Try then again. You should see now in the dnw.exe and your
  terminal application the transfer/flashing progress:
  Tekway MSO Capture6.PNG
  Tekway MSO Capture7.PNG

After the supervivi bootloader programmed the NAND with the mso_ready.bin file the menu will be displayed again, just scroll back to see the flashing status, here my example (note, my NAND have one bad block, not a big deal):

  Tekway MSO Capture8.PNG
- when ready remove the USB/UART cables, close dnw.exe and reboot DSO. 
  During the first boot you should see ""E2PROM Backing" message:
  Tekway MSO Capture9.jpg
- delete the dst1kb_backup.up file from the Flash Drive
- copy the dst1kb_restore.up file to the Flash Drive, plug in into your 
  DSO and run from Utility Menu the "Firmware update".
- when ready, unplug the Flash Drive and let the MSO warm-up properly
- after the warm-up run "Self-calibration" from the Utility Menu

That's all, your DSO is now converted to MSO.

Customization

The Master Image has been prepared to run DM9000EP Device Driver (Ethernet), if you don't need it comment out following lines in the #net section of the /etc/init.d/rcS

insmod /dso/driver/dm9000.ko
ifconfig lo 127.0.0.1
net_set &
/etc/rc.d/init.d/netd start

The Master Image has been configured to use 192.168.100.155 as IP Address. If you wish to change it, edit the /etc/net.conf file, e.g.:

IPADDR=10.1.1.10
NETMASK=255.255.255.0
GATEWAY=10.1.1.1
MAC=10:23:45:67:89:ab

The Master Image has been configured to have telnet and ftp servers enabled. The user name is simply root with no password. This is why ftp might not work properly. If you don't need ftp simply comment out follwing line in the #net section of the /etc/init.d/rcS

 /etc/rc.d/init.d/netd start

To copy files to MSO it might be good idea to use the tool from Peter Dreisiebner [10]

MSO firmware backup

To make a backup of the fresh created MSO please execute following steps:

- download and unzip the MSO Backup tools (see Download section below) 
- copy the dst1kb_mso_backup_tool.up to empty Flash Drive, plug in into
  your MSO and run from "Utility Menu" the "Firmware update".
- be patient, it can take up to 5 minutes to create all necessary backups! 
- when ready, unplug the Flash Drive an check on your PC the content on the
  folder 'dump' (will be created during firmware update).
  It should contain following files:
     boot.bin
     kernel.bin
     root.bin
  and probably 
     root2.bin

In case there is no root2.bin in the 'dump' directory, don't care i've attached one to the MSO Backup tools (see Download section below).

MSO firmware restore

To restore the MSO firmware backup, we need first to create a proper restore file. To do so, following need to be done:

- download and unzip MSO Backup tools (see download section below) 
- copy empty1.bin, empty2.bin and in case you don't have own one
  root2.bin into the directory with own MSO backup files
  (boot.bin, kernel.bin, root.bin and in case available 
  root2.bin)
- on the command prompt (from that directory with all the files) execute:

copy /B boot.bin + empty1.bin + root2.bin + kernel.bin + root.bin + empty2.bin fw_backup.bin

This will merge all these files and create proper restore file fw_backup.bin which then can be used to restore MSO firmware

* via JTAG 
* via USB/UART 

to your MSO

Via JTAG is the easiest way, however not everybody own an USB-Based JTAG and necessary applications to flash the NAND connected to Samusung S3C2440. If you own such JTAG cable run following steps :

- connect JTAG cable to MSOs ARM JTAG port (J901) and boot MSO
- run the NAND programming tool (H-JTAG JFLASH, OpenOCD) and restore the 
  fw_backup.bin into the MSO NAND. Note: the OOB blocks are incuded in
  the fw_backup.bin file.
- when ready, power off MSO, unplug JTAG cables and power on again.

That's all, the MSO firmware has been restored to your MSO.

Via UART/USB is not the easiest, but still feasible way. You will need a LVTTL UART to USB converter, like one of the CP21xx based cheap TTL UART USB converter on ebay. Additionally PC Windows based PC is necessary to run the DNW.exe application (check download section below).

The UART port have following pinout:

Tekway MSO uart hw1007.jpg

For firmware upgrade we need only TXD, RXD and GND pins.

The header have 2.0mm pitch, it make sense here to solder a solid header.

First of all check the UART<->USB connectivity, the necessary settings are 115200, 8n1. If you see messages during MSO boot, and you can enter the shell by CTRL+C / ENTER then you are fine here and can continue:

- while booting the DSO up try multiple times to hit space key, if the boot
  process have not stopped at following screen power off MSO and try again
  until you see u-boot bootloader prompt:
  Tekway MSO Capture10.PNG
- now connect the MSO over USB cable to your PC, you should be prompted to 
  install Device Drivers (if not already installed). Use these from download 
  section below. After the Device Driver installation un/replug the USB cable 
  and run the dnw.exe When you don't see the USB:OK message try to 
  re-plug USB cable, sometimes MSO/PC reboot is necessary:
  Tekway MSO Capture3.PNG

If you DO NOT see the USB:OK, please DO NOT proceed with further steps.

- in the u-boot Bootloader prompt choose 1
  Tekway MSO Capture12.PNG
- in the dnw.exe choose supervivi.bin file
  Tekway MSO Capture11.PNG
  and wait until the supervivi.bin has been programmed into NAND.
  It make sense here to check if the u-boot really downoaded anything, 
  simply scroll up and check if the "RECEIVED FILE SIZE" is > 0
  Tekway MSO Capture13.PNG
  In case the u-boot didn't downloaded anything it will still erase
  the Boot block and of course itself from NAND memory
  If so, the MSO will be unable to boot the next time you power cycle it!
  Therefore, in case there was transmition error, simply try again to 
  transfer the supervivi.bin. If necessary reboot PC - not MSO - or
  reconnect the USB cable.
- when ready, power cycle the MSO. While booting the MSO up try multiple times 
  to hit space key, if the boot process have not stopped at following screen 
  power off MSO and try again until you see supervivi bootloader prompt:
  Tekway MSO Capture2.PNG
- if so, type menu and hit Enter to see following supervivi menu:
  
  Tekway MSO Capture4.PNG
  Tekway MSO Capture5.PNG
- type in the supervivi bootloader menu "r" - this means restore, immediately
  after choose in the dnw.exe menu "Usb Port->Transmit/Restore" and select 
  the fw_backup.bin file.
  NOTE: if you need too long for these steps dnw.exe and/or supervivi will
  timeout here. Try then again. You should see now in the dnw.exe and your
  terminal application the transfer/flashing progress:
  Tekway MSO Capture6.PNG
  Tekway MSO Capture7.PNG

After the supervivi bootloader programmed the NAND with the fw_backup.bin file the menu will be displayed again, just scroll back to see the flashing status, here my example (note, my NAND have one bad block, not a big deal):

  Tekway MSO Capture8.PNG
- when ready remove the USB/UART cables, close dnw.exe and reboot MSO.

That's all, the MSO firmware has been restored to your MSO.

DSO firmware restore

If, for what ever reason, is necessary to restore the original DSO firmware back to MSO to convert back the MSO into DSO, following Guide can be used

To restore the DSO firmware backup, we need first to create a proper restore file. To do so, following need to be done:

- download and unzip DSO Backup tools (see download section below) 
- copy blank.bin and mizi_tag.bin into the directory with your DSO
  backup files (boot.bin, kernel.bin und root.bin)
- on the command prompt (from that directory with all the files) execute:

copy /B boot.bin + blank.bin + kernel.bin + root.bin + mizi_tag.bin fw_backup.bin

This will merge all these files and create proper restore file fw_backup.bin which then can be used to restore DSO firmware

* via JTAG 
* via USB/UART 

to your MSO to convert back from MSO into DSO.


Via JTAG is the easiest way, however not everybody own an USB-Based JTAG and necessary applications to flash the NAND connected to Samusung S3C2440. If you own such JTAG cable run following steps :

- connect JTAG cable to MSOs ARM JTAG port (J901) and boot MSO
- run the NAND programming tool (H-JTAG JFLASH, OpenOCD) and restore the 
  fw_backup.bin into the MSO NAND. Note: the OOB blocks are incuded in
  the fw_backup.bin file.
- when ready, power off MSO, unplug JTAG cables and power on again.

That's all, the DSO firmware has been restored and your MSO converted back into DSO.


Via UART/USB is not the easiest, but still feasible way. You will need a LVTTL UART to USB converter, like one of the CP21xx based cheap TTL UART USB converter on ebay. Additionally PC Windows based PC is necessary to run the DNW.exe application (check download section below).

The UART port have following pinout:

Tekway MSO uart hw1007.jpg

For firmware upgrade we need only TXD, RXD and GND pins.

The header have 2.0mm pitch, it make sense here to solder a solid header.

First of all check the UART<->USB connectivity, the necessary settings are 115200, 8n1. If you see messages during MSO boot, and you can enter the shell by CTRL+C / ENTER then you are fine here and can continue:

- while booting the DSO up try multiple times to hit space key, if the boot
  process have not stopped at following screen power off MSO and try again
  until you see u-boot bootloader prompt:
  Tekway MSO Capture10.PNG
- now connect the MSO over USB cable to your PC, you should be prompted to 
  install Device Drivers (if not already installed). Use these from download 
  section below. After the Device Driver installation un/replug the USB cable 
  and run the dnw.exe When you don't see the USB:OK message try to 
  re-plug USB cable, sometimes MSO/PC reboot is necessary:
  Tekway MSO Capture3.PNG

If you DO NOT see the USB:OK, please DO NOT proceed with further steps.

- in the u-boot Bootloader prompt choose 1
  Tekway MSO Capture12.PNG
- in the dnw.exe choose supervivi.bin file
  Tekway MSO Capture11.PNG
  and wait until the supervivi.bin has been programmed into NAND.
  It make sense here to check if the u-boot really downoaded anything, 
  simply scroll up and check if the "RECEIVED FILE SIZE" is > 0
  Tekway MSO Capture13.PNG
  In case the u-boot didn't downloaded anything it will still erase
  the Boot block and of course itself from NAND memory
  If so, the MSO will be unable to boot the next time you power cycle it!
  Therefore, in case there was transmition error, simply try again to 
  transfer the supervivi.bin. If necessary reboot PC - not MSO - or
  reconnect the USB cable.
 - when ready, power cycle the MSO. While booting the MSO up try multiple times
  to hit space key, if the boot process have not stopped at following screen 
  power off MSO and try again until you see supervivi bootloader prompt:
  Tekway MSO Capture2.PNG
- if so, type menu and hit Enter to see following supervivi menu:
  
  Tekway MSO Capture4.PNG
  Tekway MSO Capture5.PNG


- type in the supervivi bootloader menu "r" - this means restore, immediately
  after choose in the dnw.exe menu "Usb Port->Transmit/Restore" and select 
  the fw_backup.bin file.
  NOTE: if you need too long for these steps dnw.exe and/or supervivi will
  timeout here. Try then again. You should see now in the dnw.exe and your
  terminal application the transfer/flashing progress:
  Tekway MSO Capture6.PNG
  Tekway MSO Capture7.PNG

After the supervivi bootloader programmed the NAND with the fw_backup.bin file the menu will be displayed again, just scroll back to see the flashing status, here my example (note, my NAND have one bad block, not a big deal):

  Tekway MSO Capture8.PNG
- when ready remove the USB/UART cables, close dnw.exe and reboot MSO.

That's all, the DSO firmware has been restored and your MSO converted back into DSO.


Repair / DIY version

I did fully reversed the MSO LA PCB and drew a schamatic, check the download section. You can use this schematic not only for repairs or to build your own DIY LA PCB, but as well if you wish to build only an Ethernet Addon board (which is independent part of LA PCB).


Troubleshooting

Here some common Q&A:

During MSO boot i see following error messages, what can i do about?

*** Warning - bad CRC or NAND, using default environment
 
##### EmbedSky BIOS for SKY2440/TQ2440 #####
Press Space key to Download Mode !
Booting Linux ...


This is not an ERROR but simply WARNING, it only means that the bootloader was not able to read the configuration and will use default configuration. This is however not important, the default config is what we need, so simply ignore it.


I did ... , now the DSO/MSO is no booting, no messages over UART, Display staying black

It seems you destroyed or deleted the NAND content or at least the bootloader (starting from sector 0x0). All you need to do is now to use ARM JTAG Adapter (and NAND Flasher application) to reprogram the NAND. Yo don't need to reprogram the whole content, it is enough to program the 'supervivi.bin' from sector 0x0 of the NAND and then to continue to restore DSO or MSO firmware (depends on what you wish to restore) with one of the above listed procedures (simply each time from supervivi section)

Ok, but what JTAG Adapter will work?

In principle any ARM JTAG Adapter, important is that the Adapter and Flasher Application supports Samsung S3C24x0 and K9F1208 NAND. Here a small list of what will work:

H-JTAG USB or H-JTAG LPT Wiggler with H-JTAG Flasher
ARM LPT Wiggler with SJF2440 or XJSF244x Application.
OpenJTAG von [11] with Oflash Application [12]
OpenOCD kompatibles ARM JTAG Adapter and OpenOCD [13]

You can buy them, or build DIY version -> for Application and Schematics see download section below.

Downloads

Links