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.

EK-TM4C123GXL: sContext unresolved for only 1 function with grlib

Part Number: EK-TM4C123GXL


I've been trying to pass readings to my screen from a function and I keep running into the problem that sContext is unresolved.  If I remove the update function then everything is fine and screens work as they should with Lab 10 of the TIVA Workshop.  I'm using Lab 10 as the base to build a set of screens.

I tried to redefine the context variable in the function which allows the linker to assembly the object file.  But then when I go to run the program I get a FaultISR.  I didn't think it was the right way to do this anyways but I had to try something.

Here's my function and header so far:

#include <stdint.h>
#include <stdbool.h>
#include "grlib/grlib.h"
#include "grlib/widget.h"
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
#include "driverlib/debug.h"
#include "driverlib/adc.h"
#include "driverlib/fpu.h"
#include "driverlib/rom.h"
#include "Kentec320x240x16_ssd2119_8bit.h"
#include "touch.h"


extern void updateScreen(void);
extern tContext sContext;
#include "updateScreen.h"



void updateScreen(void){

    TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);

    GrContextForegroundSet(&sContext, ClrBlue);
    GrStringDraw(&sContext, "test", -1, 150, 2, 0);
    //    GrStringDraw(&sContext, sample_buf, 5, 150, 40, 0);

}

Any help you could give me with using sContext API functions in subfunctions would be appreciated.

Thanks

  • Hi Shane,
    Before you call updateScreen() did you first initialize with GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119)?
  • Yes. The interrupt that calls the update screen function isn't enabled until after the context has been initialized. I enable the timer interrupt right before going into the while(1) loop in lab 10.

    But I can't even create the out file so that doesn't seem to be a relavent problem.

  • Or could it be that I can't even register a timer interrupt for a specific function (using TimerIntRegister(uint32_t ui32Base, uint32_t ui32Timer, void (*pfnHandler)(void)))  that involves sContext before I initialize the context? Even if the function will not be called in the program until after the context is initialized?


    I'll try this tomorrow and see. The context has been giving me problems for a while now (at least I think that's what is wrong with other displays I've attempted to make) so if you have any resources (besides the Stellaris Graphics Library manual and the TIVA workshops) that would be great.