¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Make a backup of your TDS5xx/6xx/7xx memories


 

Hello,

Here's how to do it:

- Compile the code below (you know what to change in the code for various memories)

- Get your NI GPIB adapter and attach it to the scope
- Put NVRAM protection switch (S1002) to forward position
- Turn the scope on

- Run the PC program


Hopefully the result of this is loads and loads of firmware and NVRAM backups uploaded somewhere safe like ko4bb-site.

Have fun.

...

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include "ni488.h"

void GpibError(const char * msg); /* Error function declaration */

int Device = 0; /* Device unit descriptor */
int BoardIndex = 0; /* Interface Index (GPIB0=0,GPIB1=1,etc.) */

int main(int argc, char *argv[])
{
FILE *outfile;

int f;

unsigned long addr, straddr, endaddr, data;
unsigned short lenght;
unsigned char checksum;
unsigned char str[0x100];

int PrimaryAddress = 29; /* Primary address of the device */
int SecondaryAddress = 0x7E; /* Secondary address of the device */
unsigned char Buffer1[0x500]; /* Read buffer */


Device = ibdev( /* Create a unit descriptor handle */
BoardIndex, /* Board Index (GPIB0 = 0, GPIB1 = 1, ...) */
PrimaryAddress, /* Device primary address */
SecondaryAddress, /* Device secondary address */
T3s, /* Timeout setting (T10s = 10 seconds) */
1, /* Assert EOI line at end of write */
0); /* EOS termination mode */

if (ibsta & ERR) { /* Check for GPIB Error */
GpibError("ibdev Error");
}

ibclr(Device); /* Clear the device */
if (ibsta & ERR) {
GpibError("ibclr Error");
}

/* Attempt to read TDS544A flash ROM contents */

outfile = fopen("KRNLdump.bin","wb");
printf("&#92;n");

// straddr = 0x01000000L; /* Start of flash ROM */
// endaddr = 0x01FFFFFFL; /* End of flash ROM */

// straddr = 0x04000000L; /* Start of TDS544A NVRAM */
// endaddr = 0x0407FFFFL; /* End of TDS544A NVRAM */

straddr = 0x00000000L; /* Start of Kernel ROM */
endaddr = 0x0003FFFFL; /* End of Kernel ROM */

addr = straddr;

do {
/* Read memory message */

str[0] = 'm'; /* m - read memory command */
str[1] = 0x00; /* checksum - fill later */
str[2] = 0x00; /* message lenght MSB */
str[3] = 0x08; /* message lenght LSB */

str[4] = (unsigned char)(addr >> 24 & 0xFF);
str[5] = (unsigned char)(addr >> 16 & 0xFF);
str[6] = (unsigned char)(addr >> 8 & 0xFF);
str[7] = (unsigned char)(addr & 0xFF);

str[8] = 0x00; /* data lenght - try 16 bytes first */
str[9] = 0x00;
str[10] = 0x04;
str[11] = 0x00;

checksum = str[0] + str[2] + str[3];
for(f = 4; f < 12; f++) checksum += str[f];
str[1] = (unsigned char) checksum;

//printf("&#92;nSending:&#92;n");
//for(f = 0; f < 12; f++) printf("%02X ", str[f]);
ibwrt(Device, str, 12); /* Send */
if (ibsta & ERR) GpibError("ibwrt Error");

/* Read Acknowledge (plus-sign msg) */
ibrd(Device, Buffer1, 1); /* Read up to x bytes from the device */
if (ibsta & ERR) GpibError("ibrd Error");
//printf("&#92;nAck reveiced:&#92;n");
//for(f = 0; f < 1; f++) printf("%02X ", Buffer1[f]);

/* Read reply message */
ibrd(Device, Buffer1, 0x404); /* Read up to x bytes from the device */
if (ibsta & ERR) GpibError("ibrd Error");
//printf("&#92;nReceived:&#92;n");
//for(f = 0; f < 0x404; f++) printf("%02X ", Buffer1[f]);

/* Save buffer contents */
for(f = 4; f < 0x404; f++)
{
fputc(Buffer1[f], outfile);
}

/* Send Acknowledgement (plus-sign msg) */
str[0] = '+';
ibwrt(Device, str, 1); /* Send */
if (ibsta & ERR) GpibError("ibwrt Error");

addr += 0x400;

} while(addr <= endaddr);

fclose(outfile);

ibonl(Device, 0); /* Take the device offline */
if (ibsta & ERR) GpibError("ibonl Error");

system("PAUSE");
}


void GpibError(const char *msg) {

printf("%s&#92;n", msg);

printf("ibsta = 0x%x <", ibsta);
if (ibsta & ERR ) printf(" ERR");
if (ibsta & TIMO) printf(" TIMO");
if (ibsta & END ) printf(" END");
if (ibsta & SRQI) printf(" SRQI");
if (ibsta & RQS ) printf(" RQS");
if (ibsta & CMPL) printf(" CMPL");
if (ibsta & LOK ) printf(" LOK");
if (ibsta & REM ) printf(" REM");
if (ibsta & CIC ) printf(" CIC");
if (ibsta & ATN ) printf(" ATN");
if (ibsta & TACS) printf(" TACS");
if (ibsta & LACS) printf(" LACS");
if (ibsta & DTAS) printf(" DTAS");
if (ibsta & DCAS) printf(" DCAS");
printf (" >&#92;n");

printf ("Iberr() = %d", iberr);
if (iberr == EDVR) printf(" EDVR <Driver error>&#92;n");
if (iberr == ECIC) printf(" ECIC <Not Controller-In-Charge>&#92;n");
if (iberr == ENOL) printf(" ENOL <No Listener>&#92;n");
if (iberr == EADR) printf(" EADR <Address error>&#92;n");
if (iberr == EARG) printf(" EARG <Invalid argument>&#92;n");
if (iberr == ESAC) printf(" ESAC <Not System Controller>&#92;n");
if (iberr == EABO) printf(" EABO <Operation aborted>&#92;n");
if (iberr == ENEB) printf(" ENEB <No GPIB board>&#92;n");
if (iberr == EOIP) printf(" EOIP <Async I/O in progress>&#92;n");
if (iberr == ECAP) printf(" ECAP <No capability>&#92;n");
if (iberr == EFSO) printf(" EFSO <File system error>&#92;n");
if (iberr == EBUS) printf(" EBUS <Command error>&#92;n");
if (iberr == ESTB) printf(" ESTB <Status byte lost>&#92;n");
if (iberr == ESRQ) printf(" ESRQ <SRQ stuck on>&#92;n");
if (iberr == ETAB) printf(" ETAB <Table Overflow>&#92;n");
if (iberr == ELCK) printf(" ELCK <Lock error>&#92;n");
if (iberr == EARM) printf(" EARM <Ibnotify rearm error>&#92;n");
if (iberr == EHDL) printf(" EHDL <Invalid Handle>&#92;n");
if (iberr == EWIP) printf(" EWIP <Wait already in progress>&#92;n");
if (iberr == ERST) printf(" ERST <Notification cancelled due to reset>&#92;n");
if (iberr == EPWR) printf(" EPWR <Power error>&#92;n");

printf("Ibcnt() = %u&#92;n", ibcnt);
printf("&#92;n");

/* Call ibonl to take the device and interface offline */
//ibonl(Device, 0);

//system("PAUSE");
//exit(1);
}

Join [email protected] to automatically receive all group messages.