Hello, I have some code written in C that I want to transfer over to
JScript so I can run within my project to "burn" my DSP code into
EEPROM(Non-volatile RAM). I want to generate an .ldr file (a loader
file) of the .dxe to burn into NovRAM. Then I can load the .ldr file
into the TigerSharc's internal memory and then run a .js JScript and
it will load the boot kernal into the 8-bit NOV-RAM. Sounds very
simple, but currently we have to create the .ldr file and then close
the project and load another project that has the C code to do the
burn it process. It would be nice to create a script that can do this
is the same project directory. Here's the C code I want to transfer
into JScript:
#include <stdio.h>
#include <libsim.h>
#include <sysreg.h>
#include <signal.h>
#include <builtins.h>
#include <math.h>
#include <defTS101.h>
#include "Nov_Burn.h"
unsigned int *pINTMEM, *pNOVRAM;
unsigned int MemLen, loaderData, dummyRead;
unsigned int *pBurnAdd[6];
void main()
{
unsigned int i;
pINTMEM = (unsigned int *) INT_MEM; // load .ldr file to dsp
internal memory
pNOVRAM = (unsigned int *) NOVAD; // pointer to external NOV-RAM
(8-bit device)
MemLen = 8540;
//pINTMEM++;
for (i=0; i<MemLen; i++) // write 8-bits at a time to NOV-RAM
{
loaderData = *pINTMEM; // read from internal memory
*pNOVRAM++ = loaderData; // write 8-bits to external memory
*pNOVRAM++ = loaderData >> 8;
*pNOVRAM++ = loaderData >> 16;
*pNOVRAM++ = loaderData >> 24;
*pINTMEM++;
}
//burn sequence
pBurnAdd[0] = (unsigned int *) 0x10304E38;
pBurnAdd[1] = (unsigned int *) 0x1030B1C7;
pBurnAdd[2] = (unsigned int *) 0x103083E0;
pBurnAdd[3] = (unsigned int *) 0x10307C1F;
pBurnAdd[4] = (unsigned int *) 0x1030703F;
pBurnAdd[5] = (unsigned int *) 0x10304C63;
for (i=0; i<6; i++)
{
dummyRead = *pBurnAdd[i];
}
}
I've been looking over some JScript documentation from Analog Devices
web site but I don't know how to write to address's in JScript. I'm
hoping some one has done something like this and can give me some
ideas.
Thanks,
joe