2008-08-12 08:40:10     Button press not recognized (through Interrupt Handler).

Document created by Aaronwu Employee on Sep 18, 2013
Version 1Show Document
  • View in full screen mode

2008-08-12 08:40:10     Button press not recognized (through Interrupt Handler).

V Hemanth Kumar (INDIA)

Message: 60329   

 

Hi,

 

I am using BF527 EZKIT.

 

I tried to configure the interrupt for the push button (PB1-SW15), so when the button is pressed the

interrupt is triggered.

 

But the ISR is not triggered when I press the button.

 

I did the below things:-

1. Configure the GPIO PG0 (mapped to PB1-SW15) as input (by setting the FER, direction,

   polar-edge as level high).

2. Set the GPIO interrupt mask A register.

3. Set the EVT12 to the isr (defined in my code).

4. Set the appropriate bit to unmask the interrupt in SIC_IMASK1.

   i.e to enable the interrupt (portG interrupt A mapped IVG12 ) at the system level.

5. Wait for ever in order to process the button press.

 

(Please refer the code which is attached.)

 

{{{

I start the application by :-

1. Downloading the application to 0x1200000 location.

 

2. "bfin-uclinux-nm -n pushbutton" on the host machine.

00001000 T _pb_isr

0000107c T _pb_app

...

 

3. In uboot prompt, execute the application by giving:-

go 0x120007c

}}}

 

 

With these settings, if I press the button the isr (pb_isr) is not called.

 

Please can any one help me out in figuring the problem or by telling the correct steps in

order to over come this problem.

 

Thanks,

Hemanth Kumar.V

 

 

pushbutton.c

QuoteReplyEditDelete

 

 

2008-08-12 08:56:38     Re: Button press not recognized (through Interrupt Handler).

Mike Frysinger (UNITED STATES)

Message: 60330   

 

are you trying to write bare metal code ?

 

did you remember to configure the CEC ?  all interrupts coming from the SIC get routed through the CEC, so if you dont setup both, no interrupt will be delivered.

QuoteReplyEditDelete

 

 

2008-08-12 11:57:56     Re: Button press not recognized (through Interrupt Handler).

V Hemanth Kumar (INDIA)

Message: 60337   

 

Hi,

 

I have written this as an uboot application. Not exactly bare metal since I am not doing any thing related cpu initialization, EVT initialization and other sequence.

 

Yes I have set the bitno:12 (IVG12) in the CEC IMASK register. Also I have enabled the PORTG Channel A bit in the SEC IMASK register. This should (hopefully) enable the interrupt.

 

Is there some thing which I am doing wrong/missing in the code or can it be done some other way.

 

 

QuoteReplyEditDelete

 

 

2008-08-12 12:07:29     Re: Button press not recognized (through Interrupt Handler).

Mike Frysinger (UNITED STATES)

Message: 60338   

 

setting individual bits in the CEC wont affect the global bit ... you need to use the cli/sti instructions to manipulate that

 

if things still dont work, check the related status registers in the SIC and CEC (PEND/LAT/etc...)

QuoteReplyEditDelete

 

 

2008-08-13 11:05:34     Re: Button press not recognized (through Interrupt Handler).

V Hemanth Kumar (INDIA)

Message: 60408   

 

Hi Mike, sorry for the delayed response.

 

In the main loop  I verified that the event 12 bit in ILAT is set when the button is pressed. But this bit is not cleared since the isr routine is not called.

 

Looks like the SIC is indicating the CEC of the interrupt but the CEC is not even bothering to call the isr routine.

 

The spec says the IPEND bit will get cleared when the isr routine is executed.

 

Is it that we have to be in supervisor mode or while compiling the code is there a way to tell it should be build in kernel or supervisor mode?

 

Not sure what the problem is?

 

 

QuoteReplyEditDelete

 

 

2008-08-13 11:17:10     Re: Button press not recognized (through Interrupt Handler).

Mike Frysinger (UNITED STATES)

Message: 60409   

 

what version of u-boot are you using ?  if you're sitting in supervisor mode (u-boot runs at IVG15 for most things), then you need nested interrupts enabled.  this wasnt enabled by default until 2008R1.5 though ...

QuoteReplyEditDelete

 

 

2008-08-13 11:22:18     Re: Button press not recognized (through Interrupt Handler).

V Hemanth Kumar (INDIA)

Message: 60410   

 

I am using  u-boot-1.1.6-2008R1 version.

QuoteReplyEditDelete

 

 

2008-11-17 08:31:53     Re: Button press not recognized (through Interrupt Handler).

V Hemanth Kumar (INDIA)

Message: 65371   

 

In the new release version i.e., u-boot-1.1.6-2008R1.5 with minimal or no changes the above code works.

 

When I press the button the interrupt routine is executed.

 

Ciao, Hemanth.V

Attachments

Outcomes