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.

RTOS/TM4C1292NCPDT: Stack error

Part Number: TM4C1292NCPDT

Tool/software: TI-RTOS

Hi,

I have configured 32 bit timer 5 as shown below,

SysCtlPeripheralDisable (SYSCTL_PERIPH_TIMER5);

SysCtlPeripheralReset (SYSCTL_PERIPH_TIMER5);

SysCtlPeripheralEnable (SYSCTL_PERIPH_TIMER5);

SysCtlIntEnable(SYSCTL_PERIPH_TIMER5);

while (!SysCtlPeripheralReady (SYSCTL_PERIPH_TIMER5))

{

}

/* Set timer3 to a 32-bit periodic up counter driven from the system clock */

TimerClockSourceSet (TIMER5_BASE, TIMER_CLOCK_PIOSC);

TimerConfigure (TIMER5_BASE, TIMER_CFG_A_PERIODIC_UP);

TimerMatchSet(TIMER5_BASE, TIMER_A, 0xFFFFFFFF);

TimerLoadSet (TIMER5_BASE, TIMER_A, 0x4C4B400);

TimerIntRegister(TIMER5_BASE, TIMER_A, &ModbusWatchdogISR);

TimerIntEnable(TIMER5_BASE, TIMER_TIMA_TIMEOUT);

TimerEnable (TIMER5_BASE, TIMER_A);

Inside ISR handler, I have cleared the timer interrupt. I have set stack size 15KB in .cfg file.

 

Program.stack = 15360;

 

My program is getting terminated after turning on the timer showing stack out of bounds. The console window is as shown below,


The debug window is as shown below,


The task detail from ROV is attached below,


 

Please help me to get out of this error.

Expecting your quick reply,

 

Thanks & Regards

Sandra

 

  • sandra george78 said:
    Expecting your quick reply,

    Those who "expect" a quick reply ... are more likely to "expect" disappointment - brought on by so demanding a request!

    Should not "Forum Neutrality" grant  "equal access and response time" - to all posters?        (Not just to the overly demanding (EXPECTANT) ones!)

    Note too - that as you're here so often (requesting rescue) - should you not consider investing "your" time/energy "Assisting others?"       Such proves  (both) a more "reasonable & balancing expectation" does it not?

  • Hi Sandra,

    You cannot call TimerIntRegister in a TI-RTOS based application. For a detail look at what happens, take a look at the last post on this thread: e2e.ti.com/.../2347913

    It's a different device, but the driverlib's IntRegister() function is similar.

    You can use the Timer module in the TI-RTOS kernel to configure your timer instead. Or you can use the Clock module if the period you want is a multiple of the Clock's period (which is 1ms by default on your device).

    Todd

  • Thank you Todd for the reply.

    I configured timer module in the .cfg file as shown below,

    Now the timer is working. But I need to get a clarity in the value to be set in timerLoadSet(). Now, I set a random value to the timerLoadSet function and I am using the following functions to start the timer from a user function.

    TimerLoadSet (TIMER5_BASE, TIMER_A, 0xFFFFFFFF);

    IntMasterEnable();

    TimerIntEnable(TIMER5_BASE, TIMER_TIMA_TIMEOUT);

    TimerEnable (TIMER5_BASE, TIMER_A);

    IntEnable(INT_TIMER5A);

    I want to set the timeout value of the timer between 100ms and 65535ms as user programmable. What is the relation between the value we set for period in .cfg file and the value to be given in the timerLoadSet function? Can you please tell me how to calculate the value to be loaded to the timer.

    Regards

    Sandra

  • You can use the Timer_setPeriod() API to change the period of the timer. You don't need to use any driverlib calls. You can do everything via the Timer module in the kernel.

    Please refer to the kernel's (SYS/BIOS) API Reference to see full details about the Timer module.

  • Hi Todd,

    Thank you very much for your reply.

    Regards

    Sandra

  • I've split your new question to a new thread e2e.ti.com/.../2393837

    Todd