AnsweredAssumed Answered

FFT out of memory error, linking to flash

Question asked by sauwen on Sep 30, 2010
Latest reply on Oct 18, 2010 by CraigG

Hi everyone,


I am attempting to do a simple FFT on the BF538F, very similar to this discussion:  What happened was, when I did a 2048 pt FFT, the code ran well, but when I tried doing a 4096pt FFT, it created memory problems.  I tried mapping to flash and L1data as suggested, but I got a totally different error.



[Warning li2060]  The following input section(s) that contain program code
        and/or data have not been placed into the executable for processor 'p0'
        as there are no relevant commands specified in the LDF:
[Error li1060]  The following symbols are referenced, but not mapped:
        '_twiddle_table' referenced from .\Debug\FFTtest.doj(program)
Linker finished with 1 error and 1 warning
cc3089: fatal error: Link failed
Tool failed with exit/exception code: 1.
Build was unsuccessful.
This is my code:
#include <sys/exception.h>
#include <complex.h>
#include <filter.h>
#include <math.h>
#include <math_const.h>
#include "ffttestdata4096.h"
#define NUMPOINTS 4096
#pragma section("FLASH_data")
complex_fract16 twiddle_table[NUMPOINTS]; //twiddle sequence
#pragma section("L1_data")
complex_fract16 OUT[NUMPOINTS];
fract16 mag[NUMPOINTS];
void main()
int i;
int twiddle_stride = 1;
int n = NUMPOINTS;
int block_exponent = 0;
int scale_method = 2;
//init twiddle factors
twidfftrad2_fr16(twiddle_table, NUMPOINTS);
rfft_fr16(IN, OUT, twiddle_table, twiddle_stride, n, &block_exponent, scale_method);
for (i=0; i<NUMPOINTS; i++) {
mag[i] = cabs_fr16(OUT[i]);

I am new to this linking procedure, but I can't find any good examples/reference on this.  I have already set up a .ldf file, but I don't know if it needs editing or whatnot.  Any help would be most appreciated.