This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320C5517: HWA FFT reference code

Part Number: TMS320C5517

Tool/software: TI C/C++ Compiler

Hello,

I am trying to use the HWA FFT in the C5517 of the DSP Shield (https://web.stanford.edu/group/kovacslab/cgi-bin/index.php?page=dsp-shield

<Linking>

 undefined                                                   first referenced
  symbol                                                         in file     
 ---------                                                   ----------------
 hwafft_8pts(long *, long *, unsigned short, unsigned short) main.obj        
 hwafft_br(long *, long *, unsigned short)                   main.obj        

error: unresolved symbols remain
error: errors encountered during linking; "main.out" not built

-stack    0x2000                /* PRIMARY STACK SIZE    */
-sysstack 0x1000                /* SECONDARY STACK SIZE  */
-heap     0x6400                /* HEAP AREA SIZE        */  


MEMORY
{
  PAGE 0:
    VEC(RWX)	  : origin = 0000100h length = 000200h
    DATA0(RWX)    : origin = 0000300h length = 05D00h 
    DATA1(RWX)    : origin = 0006000h length = 0A000h 
    SARAM0(RX)    : origin = 0010000h length = 038000h            
    SARAM1(RW)    : origin = 0048000h length = 002000h  
    SARAM2(RW)    : origin = 004A000h length = 002000h  
    SARAM3(RW)    : origin = 004C000h length = 002000h
    SDRAM(RW)     : origin = 0050000h length = 800000h
    
}

SECTIONS
{
  vectors       : > VEC ALIGN = 256
  .text         : > SARAM0 ALIGN = 4
  .data         : > SARAM0 
  .cinit        : > SARAM0 
  .switch       : > SARAM0
  .stack        : > DATA1 
  .sysstack     : > DATA1 
  .bss          : > SARAM0 , fill =0 
  .sysmem       : > DATA1
  .const        : > SARAM0
  .cio	        : > SARAM0
  .extmem       : > SDRAM
  USB_buffer1   : > SARAM1
  USB_buffer2   : > SARAM2 
  USB_buffer3   : > SARAM3 , fill =0   
  
  GROUP: align(32)
  {
	.const:twiddle32
       	.const:twiddle
	audio_buffers
	fft_buf
	
  } > DATA0
}

/* HWAFFT Routines ROM Addresses */
/* C5517 (Phoenix 2.1) */
_hwafft_br		= 0x00fefefc;
_hwafft_8pts	= 0x00feff10;
_hwafft_16pts	= 0x00feffff;
_hwafft_32pts	= 0x00ff0155;
_hwafft_64pts	= 0x00ff045e;
_hwafft_128pts	= 0x00ff05f3;
_hwafft_256pts	= 0x00ff0804;
_hwafft_512pts	= 0x00ff0a02;
_hwafft_1024pts	= 0x00ff0c7c;

#include "tistdtypes.h"
#include "hwafft.h"

const int FFT_LEN = 64;

Int32 data[2 * FFT_LEN] = {0};
Int32 scratch[2 * FFT_LEN] = {0};
Int32 data_br[2 * FFT_LEN] = {0};
Uint16 fft_flag;
Uint16 scale_flag;
Uint16 out_sel;

Int32 *result;


int main( void )
{

	fft_flag = FFT_FLAG;
    scale_flag = SCALE_FLAG;
    // data = <1024-point Complex input>;
    
    /* Bit-Reverse 1024-point data, Store into data_br, data_br aligned to
       12-least significant binary zeros*/
    hwafft_br(data, data_br, DATA_LEN_1024);  /* bit-reverse input data,
                                                 Destination buffer aligned */
    /* Compute 1024-point FFT, scaling enabled. */
    out_sel = hwafft_8pts(data_br, scratch, fft_flag, scale_flag);
    if (out_sel == OUT_SEL_DATA)
    {
    	result = data;
    }
    else
    {
    	result = scratch;
	}


}

  • Hi,

    This has been forwarded to the design team. Feedback will be posted here.

    Best Regards,
    Yordan
  • Hi Fernando

    I am not sure what is the problem.

    Obviously Something in your project prevent the linker from seeing the hardware references that is in the linker command file.  I wonder if the project indeed uses this linker command file.  (you can plug an error in the linker command file and try to rebuild,   see if the project gives error)

      I actually wrote an application note how to build a benchmark project for the C55 family.  So look at  the following link and try to repeat the steps there.   

    http://www.ti.com/lit/an/sprac34/sprac34.pdf

    To build a project exactly as it is described in the document. 

    I looked at the source file of the project that I have and the only difference that I see between my source and your source is that I have not included hwafft.h.

    Again, try to rebuild your project based on the instructions in the application note and tell me the results.

    Ran