bugAVR C Runtime Library - Bugs: bug #12865, Global Interrupts Explicitly...

 
 

bug #12865: Global Interrupts Explicitly Enabled by SIGNAL Macro

Submitted by:  None
Submitted on:  Thu 28 Apr 2005 07:38:08 PM UTC  
 
Category:  Library Severity:  4 - Important
Priority:  9 - Immediate Item Group:  None
Status:  Invalid Assigned to:  None
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Fri 29 Apr 2005 10:12:39 PM UTC, comment #6: 

I found the problem!  Though I changed the macro usage from INTERRUPT to SIGNAL within the .c file, I neglected to change it in the .h file.  It might be helpful to display some warning for this case.  Thanks for your help.

William

Anonymous
Fri 29 Apr 2005 10:04:24 PM UTC, comment #5: 

Sorry, but the Makefile is not the one that shows the problem. Can you attach your source code file that shows the problem?

Thanks
Eric

Eric Weddington <arcanum>
Project Administrator
Fri 29 Apr 2005 09:33:06 PM UTC, comment #4: 

I have upgraded to WinAVR 20050214 and the behavior is
the same.  The SIGNAL macro always puts SEI as the
first instruction in the handler.  I just used the
standard installation, so there shouldn't be anything
funny there.  My makefile is based on
makefile_template from the 20050214 distribution.  It is attached so perhaps you can see something strange in it.

Anonymous
Thu 28 Apr 2005 09:23:36 PM UTC, comment #3: 

This is known to work with ATmega128 and avr-libc 1.0.4. I've used it successfully myself.

- What version of GCC and binutils are you using?

- Can you try upgrading your toolset? The latest version of avr-libc is 1.2.3.

Eric

Eric Weddington <arcanum>
Project Administrator
Thu 28 Apr 2005 09:11:07 PM UTC, comment #2: 

-The device that you are using
Atmega128

- The version number of avr-libc
1.0.4

- A code sample that will show the error when compiled.
SIGNAL(SIG_OVERFLOW0)
{
    TCNT0IntCnt++;
}

Thanks,
William

Anonymous
Thu 28 Apr 2005 07:47:46 PM UTC, comment #1: 

Please provide:
- The device that you are using
- The version number of avr-libc
- A code sample that will show the error when compiled.

Thanks
Eric

Eric Weddington <arcanum>
Project Administrator
Thu 28 Apr 2005 07:38:08 PM UTC, original submission:  

Unlike the INTERRUPT macro, the SIGNAL macro should not explicitly enable global interrupts (sei).  Here is an example of the failure.

41:       SIGNAL(SIG_OVERFLOW1)
42:       {
   SEI                      Global Interrupt Enable <- HERE
   PUSH    R1               Push register on stack
   PUSH    R0               Push register on stack
   IN      R0,0x3F          In from I/O location
   PUSH    R0               Push register on stack
   CLR     R1               Clear Register
   PUSH    R24              Push register on stack
   PUSH    R25              Push register on stack
   PUSH    R26              Push register on stack
   PUSH    R27              Push register on stack
   ...

  

   ...
   RETI                     Interrupt return

Here is the description from the documentation.

#define SIGNAL (  signame     )  

   Value:

void signame (void) _attribute_ ((signal));           \
void signame (void)
#include <avr/signal.h>

Introduces an interrupt handler function that runs with global interrupts initially disabled.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #2903:  makefile added by None (13KiB - text/plain - makefile from failing case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

 

 

Follow 6 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-04-29 arcanum StatusNone => Invalid
    Open/ClosedOpen => Closed
2005-04-29 None Attached File- => Added makefile, #2453
2005-04-28 arcanum Severity3 - Normal => 4 - Important
    Priority5 - Normal => 9 - Immediate
2005-04-28 None Carbon-Copy- => Added nicad2 --AT-- yahoo --DOT-- com

Back to the top


Powered by Savane 3.5