GithubHelp home page GithubHelp logo

ragges / tektools Goto Github PK

View Code? Open in Web Editor NEW
27.0 5.0 6.0 2.38 MB

Tektronix TDS 5xx/6xx/7xx/8xx tools on Linux, ARM, and MacOS

Makefile 2.39% C 93.99% Batchfile 0.55% Shell 0.42% HTML 2.31% Emacs Lisp 0.34%
gpib tektronix oscilloscope nvram flash eeprom firmware

tektools's Introduction

Tektronix TDS 5xx/6xx/7xx/8xx tools on Linux, ARM, and MacOS

These are tools for backing up and restoring NVRAM, Flash and EEPROMs in certain Tektronix oscilloscopes such as the TDS 5xx/6xx/7xx series, with minor modifications so that they can be used with Linux, and optionally ARM CPUs e.g. a Raspberry Pi, and MacOS with NI drivers.

(What is special with ARM is that C compilers for efficiency often defaults to char being unsigned, which some programs do not expect.)

Changelog

Release notes / change history is in CHANGELOG.md

Prerequisites

You need some system to run it on, e.g.:

  • Linux based:
  • MacOS based:
    • A MacOS system
    • A 488.2 library, e.g. National Instruments 488.2 drivers
    • A GPIB adapter

The programs have been tested for reading (making backups) with these setups:

  • Linux based:
    • Raspberry Pi (3B+)
    • Raspbian (version 9.11)
    • linux-gpib (version 4.3.0)
    • USB to GPIB adapter, Agilent 82357B (from Ebay)
  • MacOS based:
    • Mac
    • National Instruments 488.2 drivers
    • USB to GPIB adapter, National Instruments

These programs will likely work with just minor modifications on many other POSIX compliant systems with an NI-488.2 compliant GPIB API, but this has not been tested.

linux-gpib

linux-gpib can be a little tricky to install and get working. If the linker has problems finding the gpib libraries when you run the programs, try running sudo ldconfig. The GPIB adapter may need firmware for booting, check the linux-gpib documentation. The /dev/gpibN device files may be accessible only by root - if so, try e.g. sudo chgrp dialout /dev/gpib*.

To test the linux-gpib installaton and GPIB connectivity, use ibterm, for example:

/usr/local/bin/ibterm -d N

where N is the GPIB address of the instrument.

At the ibterm prompt, type *IDN? and check that you get a reasonable identification response from the instrument:

ibterm>*IDN?
TEKTRONIX,TDS 694C,0,CF:91.1CT FV:v6.4e

Installing

To get and compile the programs, clone the git repository, go to the tektools directory and run make:

git clone https://github.com/ragges/tektools.git
cd tektools
make

Running the programs

tektool, tekfwtool

These programs read and write the NVRAMs containing user settings, stored waveforms, and on older instruments calibration data, and the flash that contains the firmware.

tekfwtool downloads a piece of 68k code to be able to write firmware to the flash faster, tektool does not.

  • tektool supports flash type 28F016SA (there is experimental support for 28F160S5 that can be enabled with a #define in the program)
  • tektfwool supports flash types 28F016SA and 28F160S5

The scope must be started with the NVRAM protection switch set to unprotected mode (the rocker switch behind the small holes on the right side of the scope). The scope starts in bootloader mode and appears almost dead, it does not show anything on the screen and all LEDs on the front stays lit, but it responds on GPIB, typically on address 29.

tekfwtool looks for the 68k code in the file "target.bin" in the current directory. It must either be run when standing in the directory of the program, or there must be a copy of that file, or a link to it, in the current working directory.

You could for example dump NVRAM and firmware from the scope using:

# NOTE - Addresses and lengths may have to be adjusted depending
# on model
./tektool -r NVRAM_all.bin -b 0x04000000 -l 0x100000
./tektool -r firmware.bin -b 0x01000000 -l 0x400000

getcaldata

getcaldata reads and writes the calibration data in the EEPROMs on the acquisition board on newer models, typically models ending with B or higher.

The EEPROM chips may be called e.g. U1052 and U1055, or U1055 and U1056. This program calls them U1052 and U1055 and ignores what is printed on the board.

The scope should be booted normally.

The program assumes the GPIB address of the scope is 1, this can be changed in the program.

Just run it and it will dump the EEPROMs.

You may want to double check that the addresses and sizes of the NVRAMs are correct for your model.

tdsNvramFloppyTool and TDSNvrCV_2_1

tdsNvramFloppyTool is a set of scripts that are to be put on a floppy disk that will let the scope itself read and write NVRAM and EEPROM data to/from floppy disks - no GPIB is needed.

In tdsNvramFloppyTool-extra there is also an extra version, tdsNvramEepromFloppyDumper, that dumps both the NVRAM and the EEPROMs to the floppy in one sweep.

To use the tdsNvramFloppyTool, format a floppy (preferably in the scope), copy the file(s) that do what you want to the floppy, and boot the scope with the floppy inserted.

TDSNvrCV_2_1 is a tool for checksumming NVRAM and EEPROM dumps, written in Java.

Note that for checking EEPROM dumps taken with the getcaldata tool, you need to concatenate the two 256 byte files into one 512 byte file, and run the check on the new combined file:

cat U1052.bin U1055.bin > EEPROM_combined.bin
java -cp TDSNvrCV_2_1.zip TDSNvramChecksumVerifier EEPROM_combined.bin

For more information about using these scripts and the checksumming tool, see the thread on eevblog (or the file README.txt), and the info.txt and info-2.txt files in the directory.

There is nothing OS specific about these, but they are very nice tools, so they are included in this kit anyway.

Hint

You can use tektool, tekfwtool and getcaldata to get the data using GPIB, and tdsNvramFloppyTool to get it using a floppy, and compare the results to check that you have likely got correct and error free data. Note that the first few bytes of one of the the NVRAM chips is the clock, so it constantly changes.

You can also use the NVRAM and EEPROM checksumming tool TDSNvrCV_2_1 to check your dumps.

If you use the floppy method first, and then immediately flip the NVRAM protection switch and reboot it for GPIB dumping using tektool/tekfwtool, only the first few bytes of the NVRAM, the date and time, should differ.

Built With

Links to sources

DIST directories

In the program directories there are subdirectories called DIST that contain the original programs and in some cases other stuff that came with it.

Acknowledgments

  • All the helpful people in the community that has made this possible
  • flyte at eevblog.com forum
  • Sven Schnelle ([email protected])
  • Dr. Albert Roseiro at Tantratron

tektools's People

Contributors

ragges avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tektools's Issues

Cannot verify dump

DUMP.zip

I just dumped the NVRAM with the floppy tool on my TDS540A (fw version 3.8.4e) and looks like the supplied tool does not recognize it. Is there a way i could check this dump is valid?

Output of $ java -cp TDSNvrCV_2_1.jar TDSNvramChecksumVerifier DUMP.BIN:

TDSNvramChecksumVerifier v2.1

Read 655360 bytes of dump data from DUMP.BIN

Detected large file, considering dump an NVRAM dump

NO prototype match found for dump data, listing all interpretations known by this tool:

Interpretation of dump data as a firmware TDS524A-v3.8.7e based dump :
dump section=EXTCONST address=0x8ce size=0xfa checksum=INVALID (actual=0x8d22 computed=0xc954)
dump section=INTCONST address=0x1420 size=0x380 checksum=INVALID (actual=0x397d computed=0x6040)
dump section=STATE address=0x19fc size=0x716 checksum=INVALID (actual=0x5d59 computed=0x563f)
dump section=ENVIRONMENT address=0x1038 size=0x12c checksum=OK (actual=0x9558 computed=0x9558)
dump section=DIAG address=0x1006 size=0x14 checksum=OK (actual=0x2c8 computed=0x2c8)
dump section=HWACCOUNTANT address=0x806 size=0x32 checksum=OK (actual=0x76 computed=0x76)

Interpretation of dump data as a firmware NVRAM-TDS684B-v4.3e based dump :
dump section=INTCONST address=0x1420 size=0x5d2 checksum=INVALID (actual=0x397d computed=0x352a)
dump section=STATE address=0x19fc size=0x9be checksum=INVALID (actual=0x5d59 computed=0x839c)
dump section=ENVIRONMENT address=0x1038 size=0x12c checksum=OK (actual=0x9558 computed=0x9558)
dump section=DIAG address=0x1006 size=0x14 checksum=OK (actual=0x2c8 computed=0x2c8)
dump section=HWACCOUNTANT address=0x806 size=0x32 checksum=OK (actual=0x76 computed=0x76)

Interpretation of dump data as a firmware NVRAM-TDS784C-v5.2e based dump :
dump section=INTCONST address=0x2c20 size=0x70e checksum=INVALID (actual=0x100 computed=0x479e)
dump section=STATE address=0x33f0 size=0x11e4 checksum=INVALID (actual=0x78 computed=0x84f)
dump section=ENVIRONMENT address=0x2838 size=0x12c checksum=INVALID (actual=0x4100 computed=0x7a05)
dump section=DIAG address=0x2806 size=0x14 checksum=INVALID (actual=0x9100 computed=0xf500)
dump section=HWACCOUNTANT address=0x806 size=0x32 checksum=OK (actual=0x76 computed=0x76)

Interpretation of dump data as a firmware NVRAM-TDS694C-v6.4e based dump :
dump section=INTCONST address=0x2c20 size=0x10b2 checksum=INVALID (actual=0x100 computed=0x4f1)
dump section=STATE address=0x3db4 size=0x9be checksum=INVALID (actual=0x7800 computed=0x2f9)
dump section=ENVIRONMENT address=0x2838 size=0x130 checksum=INVALID (actual=0x4100 computed=0xa06)
dump section=DIAG address=0x2806 size=0x14 checksum=INVALID (actual=0x9100 computed=0xf500)
dump section=HWACCOUNTANT address=0x806 size=0x32 checksum=OK (actual=0x76 computed=0x76)

Interpretation of dump data as a firmware NVRAM-TDS784D-v7.4e based dump :
dump section=PFCAL address=0x1002 size=0x17fc checksum=INVALID (actual=0x82a computed=0xab68)
dump section=INTCONST address=0x2c20 size=0x21aa checksum=INVALID (actual=0x100 computed=0x2e52)
dump section=STATE address=0x5330 size=0x11e4 checksum=INVALID (actual=0x6200 computed=0xbcfb)
dump section=ENVIRONMENT address=0x2838 size=0x12c checksum=INVALID (actual=0x4100 computed=0x7a05)
dump section=DIAG address=0x2806 size=0x14 checksum=INVALID (actual=0x9100 computed=0xf500)
dump section=HWACCOUNTANT address=0x806 size=0x32 checksum=OK (actual=0x76 computed=0x76)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.