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.

CCS/TM4C123GH6PM: Working with FFT example code but Program not able to fit into available memory

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: EK-TM4C1294XL, TM4C1294NCPDT, , TM4C129XNCZAD

Tool/software: Code Composer Studio

Wth the help of CMSIS DSP library i was running one of the example code "arm_fft_bin_example_f32.c".

THIS IS THE CODE:

#include "arm_math.h"
#include "arm_const_structs.h"
#define TEST_LENGTH_SAMPLES 2048
/* -------------------------------------------------------------------
* External Input and Output buffer Declarations for FFT Bin Example
* ------------------------------------------------------------------- */
extern float32_t testInput_f32_10khz[TEST_LENGTH_SAMPLES];
static float32_t testOutput[TEST_LENGTH_SAMPLES/2];
/* ------------------------------------------------------------------
* Global variables for FFT Bin Example
* ------------------------------------------------------------------- */
uint32_t fftSize = 1024;
uint32_t ifftFlag = 0;
uint32_t doBitReverse = 1;
/* Reference index at which max energy of bin ocuurs */
uint32_t refIndex = 213, testIndex = 0;
/* ----------------------------------------------------------------------
* Max magnitude FFT Bin test
* ------------------------------------------------------------------- */
int32_t main(void)
{
arm_status status;
float32_t maxValue;
status = ARM_MATH_SUCCESS;
/* Process the data through the CFFT/CIFFT module */
arm_cfft_f32(&arm_cfft_sR_f32_len1024, testInput_f32_10khz, ifftFlag, doBitReverse);
/* Process the data through the Complex Magnitude Module for
calculating the magnitude at each bin */
arm_cmplx_mag_f32(testInput_f32_10khz, testOutput, fftSize);
/* Calculates maxValue and returns corresponding BIN value */
arm_max_f32(testOutput, fftSize, &maxValue, &testIndex);
if (testIndex != refIndex)
{
status = ARM_MATH_TEST_FAILURE;
}
/* ----------------------------------------------------------------------
** Loop here if the signals fail the PASS check.
** This denotes a test failure
** ------------------------------------------------------------------- */
if ( status != ARM_MATH_SUCCESS)
{
while (1);
}
while (1); /* main function does not return */
}

AFTER BUILDING THE CODE THIS IS THE ERROR COMING:

SO WHAT IS THIS ERROR WHY IS IT COMING?

  • Hello Siddharth,

    The device you are using as a total Flash memory space of 0x40000 bytes, but your program has compiled with a sized of 0x4b560 bytes of Flash memory required. Therefore it does not fit within the size of your MCU. You should look to see if you can trim out some of the code used. I would suspect the CMSIS library adding too much unneeded overhead, but I'm not an expert with that library to make specific suggestions.

    Alternatively, if you feel you will need to add further functions and will require more Flash space, and are concerned you can't fit everything within the current MCU choice, you could move to using a larger TM4C processor such as the TM4C1294NCPDT (which has a LaunchPad in EK-TM4C1294XL for evaluation) that offers 1MB of flash vs the 256kB of the TM4C123GH6PM.
  • Is there any other option for micro controller or i should go with this one(TM4C1294NCPDT ).....
    "I'm looking for a microcontroller which has"
    1) launchpad
    2) can take an analog input convert it to digital using ADC
    3) Do signal processing like FFT, matrix subtraction of 2D matrix if possible
    4) an interfacing of controller with LCD which can display a matrix value in terms of colors on LCD
  • Hello Siddharth,

    The TM4C devices we have that include an LCD controller do not have a LaunchPad available, though one of them does have a development board which is the DK-TM4C129X. That board features the TM4C129XNCZAD which has an ADC (12 bit resolution), plenty of memory space for the CMSIS FFT libraries, and an LCD Controller.

    For other products which fit your criteria, the follow search will display our TM4C MCU's with an LCD controller (note all of them have the ADC, and you would need to determine your own memory requirements): www.ti.com/.../products.html