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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #22870: Error in wdt.h and ATmega164P

Submitter:  Sebastian Sohn <lm331>
Submitted:  Mon 07 Apr 2008 06:12:12 PM UTC
   
 
Category:  Library Severity:  3 - Normal
Priority:  9 - Immediate Item Group:  None
Status:  None Assigned to:  arcanum
Percent Complete:  100% Open/Closed:  Closed
Release:  1.6.2 Fixed Release:  1.7.0

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.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-04-07 arcanum Percent Complete0% 100%
        Open/ClosedOpen Closed
        Fixed ReleaseNone 1.7.0
    2008-04-07 arcanum Priority5 - Normal 9 - Immediate
        Assigned toNone arcanum
    2008-04-07 lm331 Carbon-Copy- Added lm331

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code