Forums

Flash programing

Started by amin...@yahoo.com August 16, 2010
Hi everyone
I have a problem with flash programing, I have my F2812 custom board and run my program in internal ram then it's work good. i use xds510 emulator,
now i want to load my code into flash for stand alone working.
the problem is my code runnning but some peripheral not work in this mode,ADC_ISR and T0_ISR are work but SCI and SPI not work, i track my code and saw SCI and SPI ISR running but no data send to output,
I readed all ti document about flash programing but dont understand why.
some of my initialize code and my CMD here,

i'm really confused, thank you for your attention.
-----------------------------------
======================================================================extern Uint16 CodefuncsLoadStart;
extern Uint16 CodefuncsLoadEnd;
extern Uint16 CodefuncsRunStart;

extern Uint16 econstLoadStart;
extern Uint16 econstLoadEnd;
extern Uint16 econstRunStart;

#pragma CODE_SECTION(Automatic, "Codefuncs");
#pragma CODE_SECTION(HandleMode, "Codefuncs");
#pragma CODE_SECTION(PosRead, "Codefuncs");
#pragma CODE_SECTION(MasterCheck, "Codefuncs");
#pragma CODE_SECTION(SpeedCheck, "Codefuncs");

#pragma CODE_SECTION(SciaRx_isr, "ramfuncs");
#pragma CODE_SECTION(SciaTx_isr, "ramfuncs");
#pragma CODE_SECTION(ScibRx_isr, "ramfuncs");
#pragma CODE_SECTION(ScibTx_isr, "ramfuncs");
#pragma CODE_SECTION(SpiRx_isr, "ramfuncs");
#pragma CODE_SECTION(SpiTx_isr, "ramfuncs");
#pragma CODE_SECTION(Adc_isr, "ramfuncs");
#pragma CODE_SECTION(T1int_isr, "ramfuncs");
-----------------------------------
======================================================================main{
InitSysCtrl();

DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
EALLOW;
PieVectTable.RXAINT = &SciaRx_isr;
PieVectTable.TXAINT = &SciaTx_isr;

PieVectTable.RXBINT = &ScibRx_isr;
PieVectTable.TXBINT = &ScibTx_isr;

PieVectTable.SPITXINTA = &SpiTx_isr;
PieVectTable.ADCINT = &Adc_isr;
PieVectTable.TINT0 = &T1int_isr;
EDIS;

MemCopy( &RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
MemCopy( &econstLoadStart, &econstLoadEnd, &econstRunStart);
MemCopy( &CodefuncsLoadStart, &CodefuncsLoadEnd, &CodefuncsRunStart);
InitFlash();

InitGpio();
// InitECan();
// ECanConfig();
InitSci();
InitSpi();
InitCpuTimers();
InitAdc();
Config_ADC_EVA();

GpioDataRegs.GPDSET.bit.GPIOD0 = 1;
GpioDataRegs.GPDSET.bit.GPIOD1 = 1;

GpioDataRegs.GPDCLEAR.bit.GPIOD0 = 1;
GpioDataRegs.GPDCLEAR.bit.GPIOD1 = 1;

// InitXIntrupt();
for(i=0;i<16;i++){ Receivedata[i] = 0x00;}

// Configure CPU-Timer 0 to interrupt every second:
// 100MHz CPU Freq, 1 second Period (in uSeconds)
// ConfigCpuTimer(&CpuTimer0, 150, 100000);

ConfigCpuTimer(&CpuTimer0, 150, 250);// int 250 uS
StartCpuTimer0();

PieCtrlRegs.PIECRTL.bit.ENPIE = 1; // Enable the PIE block
// PieCtrlRegs.PIEIER6.bit.INTx1=1; //Enable SPI Rx int
PieCtrlRegs.PIEIER6.bit.INTx2=1; //Enable SPI Tx int
PieCtrlRegs.PIEIER1.bit.INTx6 = 1; //Enable ADC int
PieCtrlRegs.PIEIER1.bit.INTx7 = 1; //Enable Timer0 Int
// PieCtrlRegs.PIECRTL.bit.ENPIE = 1; // Enable the PIE block
PieCtrlRegs.PIEIER9.bit.INTx3=1; // PIE Group 9, INT3 //Enable SciB Rx
PieCtrlRegs.PIEIER9.bit.INTx4=1; // PIE Group 9, INT4 //Enable SciB Tx

PieCtrlRegs.PIEIER9.bit.INTx1=1; // PIE Group 9, INT3 //Enable SciB Rx
PieCtrlRegs.PIEIER9.bit.INTx2=1; // PIE Group 9, INT4 //Enable SciB Tx

// PieCtrlRegs.PIEACK.bit.ACK9 = 1;

IER |= M_INT1;
IER |= M_INT6;
IER |= M_INT9;
EINT; // Enable Global Interrupts
-



You can post a message or access and search the archives of this group on DSPRelated.com:
http://www.dsprelated.com/groups/c28x/1.php

_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

Archives: http://www.dsprelated.com/groups/c28x/1.php

To Post: Send an email to c...

Other DSP Related Groups: http://www.dsprelated.com/groups.php