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.

How does one set the interrupt vector INT_ADC0SS3 to get Touch screen to work in a SYS/BIOS project

Other Parts Discussed in Thread: SYSBIOS

Hi All,

I am trying to convert the grlib_demo code to a SYS/BIOS based project.  I cannot get the "touch" on the touch screen to work. Specifically (at least) I do not understand how to set the Interrupt vector for the touch screen.  I suspect it can be done statically with XGCONF utility or at runtime dynamically with a library call in main() before calling BIOS_start().  I assume my basic issue is a poor understanding of interrupts.

I have several other SYS/BIOS project running successfully.  My new project requires a touch screen.  After over a week of research I am stuck and would really appreciate any help I can get.

What I (probably) know.

I am Using: CCS 6.1,  SYS/BIOS 6.35, TI DK-TM4C129X Development Board, example code starting point is grlib_demo.

I created new a SYS/BIOS project including the drivers from grlib_demo including the touch.c module.

The required interrupt vector for the "touch" interrupt  is  INT_ADC0SS3  as determined from the touch.c code in the demo project.

The touch.c code text information explains:

"It is the responsibility of the application using the touch screen driver! to ensure that this function is installed in the interrupt vector table for the ADC0 samples sequencer 3 interrupt."  That seems reasonable and easy until I tried to do it.

The .vecs Section in the project command file  (.cmd) is generated by the RTOS configuration.  The .vtable Section of the .cmd file is created by TivaWare code. DON't use both or a conflict occurs.  I learned NOT to use "IntRegister" TivaWare call.  Modifying the .cmd file is not the correct solution.

SYS/BIOS initialization causes the interrupt vector table to be moved from start of Flash to start of SRAM.

The following paragraph has been resolved by using "Target Specific Support" (see below).

So I thought I could use the XCONF and create a .cfg file to set the interrupt vector statically. That does not work because the required interrupt vector, INT_ADC0SS3, has a value of 33 and the maximum HWI or SWI interrupt number is 32.

code snippet in main before BIOS_start();  is copied from grlib_demo code and is shown below.

    ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
            SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
            SYSCTL_CFG_VCO_480), 120000000);

    // Configure the device pins.
    PinoutSet();

    // Initialize the display driver.
    Kentec320x240x16_SSD2119Init(ui32SysClock);

    // Initialize the graphics context.
    GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119);

    // Draw the application frame.
    FrameDraw(&sContext, "grlib-demo");

    // Configure and enable uDMA
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA);
    SysCtlDelay(10);
    uDMAControlBaseSet(&psDMAControlTable[0]);
    uDMAEnable();


    // Initialize the sound driver.
    SoundInit(ui32SysClock);
    SoundVolumeSet(128);
    SoundStart(g_pi16AudioBuffer, AUDIO_SIZE, 64000, SoundCallback);

    // Initialize the touch screen driver and have it route its messages to the  widget tree.
 
    TouchScreenInit(ui32SysClock);
    TouchScreenCallbackSet(WidgetPointerMessage);

What I do not know:

The following sentence has been resolved by using "Target Specific Support" (see below).

What type of interrupts are the ones in the interrupt vector table which have an interrupt number greater than 32?

What is the correct method to set the required interrupt vector, if that is my real problem?

How do I determine the cause of the crash?

Update to original post:

I have found that when using the XCONF utility,  by selecting "SYSBIOS/Target Specific Support / M3 (Ducati) / Hwi - Instance Settings" I can assign the interrupt service routine to Interrupt Number 33 (INT_ADC0SS3) and when I load the application for debug, I see the interrupt service routine address in the Interrupt Vector Table.

However, the following crash still occurs.

ti.sysbios.family.arm.m3.Hwi: line 1127: E_noIsr: id = 81, pc = 00016cd0
Exception occurred in background thread at PC = 0x00016cd0.
Core 0: Exception occurred in ThreadType_Main.
Main name: main(), handle: 0x0.
Main stack base: 0x200064dc.
Main stack size: 0x1000.
R0 = 0x00000000  R8  = 0x00000000
R1 = 0x200064c4  R9  = 0x00000000
R2 = 0x200059b4  R10 = 0x00000000
R3 = 0x200059a4  R11 = 0x00000000
R4 = 0x00000000  R12 = 0x20007420
R5 = 0x00000000  SP(R13) = 0x20007450
R6 = 0x00000000  LR(R14) = 0x00016cd1
R7 = 0x200074d8  PC(R15) = 0x00016cd0
PSR = 0x61000000
ICSR = 0x00000851
MMFSR = 0x00
BFSR = 0x00
UFSR = 0x0000
HFSR = 0x00000000
DFSR = 0x0000000a
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
Terminating execution...

Final update to post:

All one has to do is use the XCONF utility to also assign the Sound interrupt handler to interrupt 81 and it works.

Apologies to anyone who read through my lengthy post for a problem I resolved in short order after posting.  I did work for a week before posting ;-))