bugAVR C Runtime Library - Bugs: bug #22870, Error in wdt.h and ATmega164P

 
 

bug #22870: Error in wdt.h and ATmega164P

Submitted by:  Sebastian Sohn <lm331>
Submitted on:  Mon 07 Apr 2008 06:12:12 PM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 9 - ImmediateItem Group: None
Status: NonePercent Complete: 100%
Assigned to: Eric Weddington <arcanum>Open/Closed: Closed
Release: 1.6.2Fixed Release: 1.7.0

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 07 Apr 2008 07:25:05 PM UTC, comment #1:

This is also a problem for the 644P. Appears that some of the processor defines were removed after:

#if defined(_AVR_AT90CAN128_) \

I added back in the _AVR_ATmega644P_ line in my version of wdt.h and this fixed the problem in my project.

Ken Burns <kburns>
Mon 07 Apr 2008 06:12:12 PM UTC, original submission:

Tried to compile my current project (ATmega164P) with WinAVR20080402. Compiling stopped at the line wdt_disable();

main.c:128: warning: asm operand 0 probably doesn't match constraints
main.c:128: error: impossible constraint in 'asm'

In main.i I found this:
_asm_ __volatile__ ( "in _tmp_reg_, _SREG_" "\n\t" "cli" "\n\t" "out %0, %1" "\n\t" "out %0, _zero_reg_" "\n\t" "out _SREG_,__tmp_reg__" "\n\t" : : "I" ((((uint16_t) &(((volatile uint8_t )(0x60)))) - 0x20)), "r" ((uint8_t)((1 << (4)) | (1 << (3)))) : "r0" );
The WDTCSR is located at address 0x60, thus unavailable for the OUT instruction.

The wdt.h contains two macros one with the STS instruction and one with the OUT instruction. The STS version should be used if the expression _AVR_ATmega164_ is defined.

I've added this code to wdt.h:
#ifndef _AVR_ATmega164_
#error ERROR NOT COMPILING FOR ATMEGA164P
#endif

Now compiling is aborted with the message ERROR NOT COMPILING FOR ATMEGA164P.

I'm using the standard MFile makefile with
MCU = atmega164p

Many thanks for your efforts!

Sebastian Sohn <lm331>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by kburns (Posted a comment)
  • -unavailable- added by arcanum (Updated the item)
  • -unavailable- added by lm331 (Submitted the item)
  • -unavailable- added by lm331
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Apr 2008 08:46:08 PM UTCarcanumPercent Complete0%=>100%
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>1.7.0
    Mon 07 Apr 2008 06:19:48 PM UTCarcanumPriority5 - Normal=>9 - Immediate
      Assigned toNone=>arcanum
    Mon 07 Apr 2008 06:12:13 PM UTClm331Carbon-Copy-=>Added lm331

    Back to the top


    Powered by Savane 3.1-cleanup1