Timer Interrupt on OMAP3530

HiAll

I have a query on Timer interrupt for OMAP3530.
I have enabled the timer interrupt for RTOS which i use. I get the
Timer Interrupt as per expected behaviour. At this point of time the
Interrupt bit and IRQ Pending in the interrupt controller seems to be
set.

Now after handling the interrupt I clear the Interrupt by writing to
Interrupt status register (This is said in spec.) Now i find that
Interrupt bit and IRQ Pending in the interrupt controller is reset ,
showing that the interrupt is handled.

Now the problem: Even though i have cleared the timer interrupt i keep
on getting the Timer interrupt.This is not a desired behaviour as i
have configured for One shot timer interrupt. After the first
interrupt the timer is stoped. What might be the problem ?

Important Note: When i single step through my OS i do not get the
timer interrupt again and again.The execution seems to be perfect when
i single step .
But when i say run it goes and hit at the break point which i have put
it in IRQ vector.

Can u help me ? How is GP Timer handled in Uboot. or linux?

Regards
Rahanesh

Now the problem: Even though i have cleared the timer interrupt i keep
on getting the Timer interrupt.This is not a desired behaviour as i
have configured for One shot timer interrupt. After the first
interrupt the timer is stoped. What might be the problem ?

Important Note: When i single step through my OS i do not get the
timer interrupt again and again.The execution seems to be perfect when
i single step .
But when i say run it goes and hit at the break point which i have put
it in IRQ vector.

Hi Rahanesh,

From your email it seems, like you miss to set the NEWIRQAGR bit in
INTCPS_CONTROL after processing the interrupt. More info about this can be
found in the TRM (spruf98b.pdf) chapter 10 - Especially figure 10.5 and
table 10-16... Without doing this, AFAIR the IRQ-output from the
Interrupt-controller will stay active causing the ARM to always jump to the
INTR-vector, even though no interrupt source is active...

With respect to the stuff working different when you single-step. This is
because emulation as default (using Lauterbach and Code Composer Studio)
will prevent interrupts from happening unless you hit "Run" as you as well
found. The reason for this is to prevent single-stepping being mixed up in
ISRs all the time. The assumption being, that if you are allowed to
single-step that particular piece of your code, you can as well live without
interrupts occurring.

Here you should however take special care, since if you hit step-over on a
function call in the C-environment, what the debugger will do is usually to
set a breakpoint at the next statement and let the core free running (in
order to speed up the execution). In this case you will therefore get an
interrupt although you would expect it to behave as being in
"single-stepping mode"...

I hope this explanation helped?
  Søren

Hi soren,

That was very helpful. I could clear my interrupt. Thanks a lot for your
support.

Your explanation was very helpful.

Thanks man

Regards
Rahanesh

Hi Rahanesh,

I’m very interested in your FreeRTOS port !!! Please stay in touch !!!
I am currently looking at building my own kernel on the beagleboard with the help of Think (http://think.objectweb.org/)
It is a set of tools to build component based embedded systems.
I would be very great full if you could share your timer code with me since I’m not an expert in low level programming and that might save me some time :slight_smile:

cheers,

Maxime

Hi Maxime,

I am very happy for your interest. The name of the RTOS is RoSES.
RoSES is completely designed and developed by TATA ELXSI Ltd.
It is not an Open source RTOS. I will not be able to share my code as such.

But I will be very happy to help you with configuring the timers.

Regards
Rahanesh

maxime louvel wrote:

Hi Rahanesh,

I'm very interested in your FreeRTOS port !!! Please stay in touch !!!!

I don't think FreeRTOS is mentioned anywhere in the messages. How do
you know it is FreeRTOS?

Thanks,
Caglar

Hi,

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

maxime louvel wrote:

Hi Rahanesh,

I’m very interested in your FreeRTOS port !!! Please stay in touch !!!

I don’t think FreeRTOS is mentioned anywhere in the messages. How do
you know it is FreeRTOS?

I don’t, I jump too fast to conclusion, my eyes aren’t enough open I guess :slight_smile:
sorry about that

Caglar,

I don’t know. It might be a mistake.

Regards
Rahanesh

I would like to trigger an interrupt on the board from an external
source, but really have no idea where to begin.

Hi Rahanesh?

First of all - Please send emails/questions to the BegaleBoard mailing list
and *not* directly to me directly for the future - I can't service all
individual requests... :slight_smile:

In order to trigger an interrupt on a GPIO from the expansion connector you
need to do the following
  1) Make sure the PIN on the OMAP is set/muxed to GPIO mode (TRM Chapter 7)
  2) Configure the given pin in the GPIO controller (TRM Chapter 24)
  3) Enable the GPIO-block interrupt in the interrupt controller (TRM
Chapter 10)

There might be handles in Linux to do some of this - I unfortunately don't
know...

The TRM is as usual the spruf98b.pdf document :slight_smile:

Best regards - Good luck
  Søren

Hi All,

I'm new to the BB and I've only had my board for a few weeks now and
I'm trying to understand the Expansion Header/GPIO/Interrupts. I can't
seem to find any tutorials or any extensive information on this
subject?

I would like to trigger my board to turn on/wake from sleep when
triggered by an external sensor (through an interrupt, if that works
best). Can anyone point me in the right direction or suggest the best
method for triggering?

Thanks!

Good evening. I am having troubles getting an interrupt from a GP timer 1. I use u-boot to run my application.

struct gptimer *gptimer1 = (struct gptimer *)GPT1;
struct InterruptController *intc = (struct InterruptController *)MPU_INTC;

intc->intcSysConfig = 0x00000000;
intc->intcIdle = 0x00000001;
intc->intcMir1 = 0x00000020;
intc->intcIlr37 = 10;
gptimer1->tldr = 0;
gptimer1->tcrr = 0;
gptimer1->tmar = 500;
gptimer1->tier = 0x1;
gptimer1->tclr = 0x00000043;

the interrupts are enabled ( cpsr: 0x8000011 ) and my handler is loaded to 0x4020fff8. I have setup a break point to my handler but I never reach it.
Can you please tell me what do I miss? I have also pasted the two structures I am using

struct InterruptController
{
unsigned char res1[0x10];
unsigned int intcSysConfig;
unsigned int intcSysStatus;
unsigned int intcSirIrq;
unsigned int intcSirFiq;
unsigned int intcControl;
unsigned int intcProtection;
unsigned int intcIdle;
unsigned int intcIrqPriority;
unsigned int intcFiqPriority;
unsigned int intcThreshold;
unsigned int intcItr0;
unsigned int intcMir0;
unsigned int intcMirClear0;
unsigned int intcMirSet0;
unsigned int intcIsrSet0;
unsigned int intcIsrClear0;
unsigned int intcPendingIrq0;
unsigned int intcPendingFiq0;
unsigned int intcItr1;
unsigned int intcMir1;
unsigned int intcMirClear1;
unsigned int intcMirSet1;
unsigned int intcIsrSet1;
unsigned int intcIsrClear1;
unsigned int intcPendingIrq1;
unsigned int intcPendingFiq1;
unsigned int intcItr2;
unsigned int intcMir2;
unsigned int intcMirClear2;
unsigned int intcMirSet2;
unsigned int intcIsrSet2;
unsigned int intcIsrClear2;
unsigned int intcPendingIrq2;
unsigned int intcPendingFiq2; // 0xDC
unsigned char res2[0x22];
unsigned int intcIlr0; // 0x100
<…rest of intcllrX registers… >

and

struct gptimer {
int tidr; /* 0x00 r /
char res[0xc];
int tiocp_cfg; /
0x10 rw /
int tistat; /
0x14 r /
int tisr; /
0x18 rw /
int tier; /
0x1c rw /
int twer; /
0x20 rw /
int tclr; /
0x24 rw /
int tcrr; /
0x28 rw /
int tldr; /
0x2c rw /
int ttgr; /
0x30 rw /
int twpc; /
0x34 r*/
int tmar; /* 0x38 rw*/
int tcar1; /* 0x3c r /
int tcicr; /
0x40 rw /
int tcar2; /
0x44 r */
};

I will provide you with some more info about the register values

This is how interrupt controller is configured:

SysConfig:0x00000000
SysStatus:0x00000001
SirIRQ:0xffffff80
SirFIQ:0xffffff80
Control:0x00000000
Protection:0x00000000
Idle:0x00000001
IrqPriority:0xffffffc0
FiqPriority:0xffffffc0
Threshold:0x000000ff

ITR1:0x00000000
MIR1:0x000000ff
ILR37:0x00000034

And this is how GPTIMER1 is configured

TIDR:0x00000013
TIOCP_CFG:0x00000000
TISTAT:0x00000001
TISR:0x00000004
TIER:0x00000001
TWER:0x00000000
TCLR:0x00000043
TCRR:0x0002e369
TLDR:0x00000000
TTGR:0x00000000
TWPS:0x00000000
TMAR:0x11111111
TCAR1:0x000002da
TSICR:0x00000004
TCAR2:0x000002da
TPIR:0x00000000
TNIR:0x00000000
TCVR:0x00000000
TOCR:0x00000000
TOWR:0x00000000

All I want is to have an interrupt when the timer matches 0x11111111