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/DK-TM4C129X: FaultISR() generated when GrStringDraw() used

Part Number: DK-TM4C129X

Tool/software: Code Composer Studio

Hello,

I am working on a project that involves sampling of the analog signal and performing FFT on it and capturing the fundamental frequency index and amplitude and displaying on the Kentec K350QVGV2-F 320x240 LCD display. To display them, I used the snprintf()  function to convert the fundamental amplitude (float value) to a string, and then the GrStringDraw function to display that string, but when the Grstringdraw function is called, program goes to FaultISR(). I tried to increase the stack size from 512 to 2048, but it didnt work. Removing GrStringDraw() and then running doesnt causes the FaultISR, so it is sure that this function causes the error. I tried debugging with the "spma043" documentation on diagnosing faultISR, but it didnt help. My NVIC_FAULT_STAT register is having the instruction bus error bit sit.

This is how I am using the function:

uint32_t fftSize = 256;
uint32_t ifftFlag = 0;
uint32_t doBitReverse = 1;
float32_t maxValue;
uint32_t testIndex = 0;
tContext sContext;
uint32_t sysclock;
char buffer[100];

/* Process the data through the CFFT/CIFFT module */
arm_cfft_f32(&arm_cfft_sR_f32_len256, 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);
testOutput[0] = 0;
/* Calculates maxValue and returns corresponding BIN value */
arm_max_f32(testOutput, fftSize, &maxValue, &testIndex);
snprintf(buffer, 100, "%06f", maxValue);
GrStringDraw (&sContext,buffer,-1,100,50,0);
//GrStringDrawCentered(&sContext, buffer, -1,
//GrContextDpyWidthGet(&sContext) / 2, 50, false);



  

Does someone have any ideas on how to solve this issue?

Thanks,

Harshul

  • If it is not the stack, then one of the most common causes of a fault ISR is failure to initialize a peripheral before using it. Did you initialize the peripherals that interface to the Kentec? You can look at the function PinoutSet() in the file pinout.c (C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\dk-tm4c129x\drivers\pinout.c) used in the example DK-grlib_demo.

    Also, look the the LR when in the FaultISR() function. It often points back to the instruction after the instruction that caused the fault. By checking the assembly language and the CPU register contents, you may be able to identify what address (and therefore which peripheral) was being accessed when the fault occurred.