AnsweredAssumed Answered

2147x FFTA

Question asked by Clack on Sep 29, 2016
Latest reply on Nov 8, 2016 by Jithul_Janardhanan

I debug the 2147x FFTA and have a problem. When I set a breakpoint at FFTA ISR (FFTIsr), the dsp work correctly and everytime the pc can stop at breakpoint. But the dsp runs at full speed, then cces report a error:

Core access to a SPORT/LINK Port is hung at PC:0x1244c2

I don't know what happen, and who can tell me what to do . Thanks!

 

 

/*****************************************************************************

 * 21479flashtest.c

 *****************************************************************************/

 

#include <sys/platform.h>

#include "21479flashtest.h"

 

#include <stdio.h>     /* Get declaration of puts and definition of NULL. */

#include <builtins.h>  /* Get definitions of compiler builtin functions */

#include <platform_include.h>      /* System and IOP register bit and address definitions. */

#include <processor_include.h>

#include <services/int/adi_int.h>  /* Interrupt Handler API header. */

#include "adi_initialize.h"

#include <sru.h>

 

/**

 * If you want to use command program arguments, then place them in the following string.

 */

extern void initPLL(void);

extern void initExternalMemory(void);

int FFTtest(void);

void FFTIsr(void);

#define PCI 0x80000

#define COEFFSEL 0x100000

#define OFFSET_MASK 0x7FFFF

 

volatile int fft_done=0;

 

 

 

volatile float inputdata[512] = {

                                                        #include "input512.dat"

                                                        };  /*input data is in the form of real followed by imag.*/

static float coeffdata[512] = {

                                                        #include "twiddle256complx.dat"

                                                        }; /*512 twiddle data in the form of real and imag. coeff are in terms of cos, -sin, sin, cos.*/

volatile float outputdata[512];

 

int dataTxTCB[6] = {0,0,0,512,1,(int)inputdata};

int coeffTCB[6] = {0,0,0,512,1,(int)coeffdata};

int dataRxTCB[6] = {0,0,0,512,1,(int)outputdata};

 

int I1[256] ={};

int Q1[256] ={};

int I2[256] ={};

int Q2[256] ={};

float SUMI[256] ={};

float SUMQ[256] ={};

float DIFFI[256] ={};

float DIFFQ[256] ={};

int main(void)

{

//      asm("JUMP 0;");

         int temp;

         int i,a;

         /* Initialize managed drivers and/or services at the start of main(). */

         adi_initComponents();

 

         /* Initialize SHARC PLL*/

         initPLL();

         /* Initialize DDR2 SDRAM controller to access memory */

//      initExternalMemory();

 

    a= 0;

         *pPICR0 =P3I4|P3I3|P3I1|P3I0;

         adi_int_InstallHandler(ADI_CID_P3I, FFTIsr, NULL, true);

         SRU(HIGH, PBEN09_I);

         SRU(HIGH,DAI_PB09_I);

 

         for(i=0;i<256;i++)

         {

                   I1[i] = i;

                   I2[i] = i+1;

                   Q1[i] = i;

                   Q2[i] = i+2;

         }

         FFTtest();

         while(1)

         {

         }

         /* Begin adding your custom code here */

         return 0;

}

int FFTtest(void)

{

         unsigned int temp;

         /* Selecting FFT accelerator */

         *pPMCTL1&=~(BIT_17|BIT_18);

         *pPMCTL1|=FFTACCSEL;

 

         /*PMCTL1 effect latency*/

         //asm("nop;nop;nop;nop;");

         NOP();NOP();NOP();NOP();NOP();

 

         /*Clearing the FFTCTL registers*/

         *pFFTCTL2=0;

         *pFFTCTL1=FFT_RST;

         //asm("nop;nop;nop;nop;");

         NOP();NOP();NOP();NOP();NOP();

 

         temp= ((int)(dataTxTCB) + 5) & OFFSET_MASK;  /*Set up coeff TCB*/

         coeffTCB[0]= temp;

         *pCPIFFT= (((int)coeffTCB+5) & OFFSET_MASK)|COEFFSEL;   /* Start transmit TCB.*/

 

         /* Enable receiveTCB   need not wait for the transmit TCB to complete. */

         temp = PCI;  /* Enables interrupt after DMA for receive*/

         dataRxTCB[0] = temp;

         temp= (int)dataRxTCB + 5;

         *pCPOFFT = temp;   /* Starts DMA.*/

 

         *pFFTCTL2=VDIMDIV16_16|FFT_LOG2VDIM_8;  /* Set up VDIM values*/

 

         *pFFTCTL1=FFT_EN|FFT_START|FFT_DMAEN;

 

         //asm("nop;nop;nop;nop;");

         NOP();NOP();NOP();NOP();NOP();

//      while((*pFFTDMASTAT & ODMACHIRPT)==0);

 

//      puts("256_Point_FFT_completed");

         return 0;

}

void FFTIsr(void)

{SRU(HIGH,DAI_PB09_I);

          unsigned int state=0;

//      state= *pFFTDMASTAT;

         FFTtest();

         SRU(LOW,DAI_PB09_I);

}

Attachments

Outcomes