<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-2008</id>
	<title>Nabble - AVR</title>
	<updated>2009-11-24T08:15:16Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/AVR-f2008.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/AVR-f2008.html" />
	<subtitle type="html">The AVR family of microcontrollers from Atmel are economical, feature-rich microcontrollers featuring flash program memory. The entire family shares the same instruction set and basic architecture.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26498816</id>
	<title>Re: Re: eeprom_read_byte and clr ret_hi</title>
	<published>2009-11-24T08:15:16Z</published>
	<updated>2009-11-24T08:15:16Z</updated>
	<author>
		<name>Wouter van Gulik</name>
	</author>
	<content type="html">David Brown schreef:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Wouter van Gulik wrote:
&lt;br&gt;&amp;gt;&amp;gt; David Brown schreef:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Wouter van Gulik wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; David Brown schreef:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Weddington, Eric wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; -----Original Message----- From: 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26498816&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu. org]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; On Behalf Of Dmitry K. Sent: Sunday, November 22, 2009 12:21 AM To:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26498816&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt; Subject: Re: [avr-libc-dev]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eeprom_read_byte and clr ret_hi
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eeprom_read_byte returns a uint8_t. Why does it clear r25? 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eerd_byte.S: clr &amp;nbsp; &amp;nbsp; ret_hi
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Does the AVR ABI require that r25 be zeroed in a function
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; returning a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; single byte? If not, this instruction could be removed.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; This is a misty point. Look an example:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; unsigned char foo1 (unsigned char *p) { return *p; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; extern unsigned char ext2 (void); int foo2 (void) { return ext2() +
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 1; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Old Avr-gcc (3.3 - 4.2) are clear R25 in both cases: foo1() and
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo2(). &amp;nbsp;The new Avr-gcc (4.3.3 and 4.4.2) are not clear R25 in
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo1().
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Note, the function return value is present only in expression. So
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; it is promoted to integer. So it would be better to clear R25 in
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo1() only (at one place).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I agree that that is the way it should be.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I'm a little confused by this - I hope this is not implying a 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; return to avr-gcc 4.2 R25 clearing? &amp;nbsp;With avr-gcc 4.2, foo1() above 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; would clear R25 even though it is returning an 8-bit value. &amp;nbsp;This 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; has always been a waste of time and space - caller functions make 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; no use of the cleared R25, and thus clear it again themselves (such 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; as in foo2() after calling ext2()). &amp;nbsp;With avr-gcc 4.3, the extra 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; clear R25 instructions are omitted for functions returning 8-bit 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; values. &amp;nbsp;This is the way it should be (unless the C standards 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; disagree...), IMHO. &amp;nbsp;But it looks a little like you want foo1() to 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; clear R25 here?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Incidentally, avr-gcc 4.2.2 actually produces better code for 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo2() than avr-gcc 4.3.2.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; With 4.2.2, the code is:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo2:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; call ext2
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ldi R25, lo8(0)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; adiw r24,1
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ret
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; With 4.3.2 (and 4.3.0), we get:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo2:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; call ext2
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; mov r18, r24
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ldi r19, lo8(0)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; subi r18, lo8(-(1))
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; sbci r19, hi8(-(1))
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; movw r24, r18
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ret
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Is this regression is news to you, I can take it up in the main 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; avr-gcc mailing list and/or a missed optimisation bug report.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; This is &amp;quot;normal&amp;quot; GCC behaviour, caused by internal promotion to int 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; types. Having the clr r25 would have saved the ldi r19. Altough 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; these type of missed optimization are known for long, it 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; (apparently) is difficult to fix them. IIRC the main problem is the 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; carry bit propagation. I still don't now why exactly that is such a 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; big problem, but then again I am no gcc expert.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I understand about int promotion, and how it's a PITA to remove all 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the extra code that the avr backend has to put in because the gcc 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; frontend has promoted the 8-bit data to 16-bit ints. &amp;nbsp;However, 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; avr-gcc 4.2 /does/ do a clr R25 in the function returning an 8-bit 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; result, and then it clears it /again/ after calling it (as in foo2 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; above). &amp;nbsp;That is definitely a waste, and it has been removed in 4.3+.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; The problem I have with the 4.3.2 code above is not the zeroing of 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the upper byte - that's standard int promotion, and is required for 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; correct code. &amp;nbsp;The problem is that the result of ext2() is first 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; moved into a new register pair and then promoted to an int - an 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; unnecessary move, which forces the subi/sbci pair instead of subw, 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; and requires an additional move before the ret instruction. &amp;nbsp;In more 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; complex code, the wasted register resources may also be relevant.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; You're right, I was not grasping the real problem. However using 
&lt;br&gt;&amp;gt;&amp;gt; -fno-split-wide-types makes 4.3.2 behave like 4.2.2. Split wide types 
&lt;br&gt;&amp;gt;&amp;gt; seems to be the problem here.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You are correct - I hadn't thought of that. &amp;nbsp;However, 
&lt;br&gt;&amp;gt; -fno-split-wide-types is a workaround, rather than a solution. &amp;nbsp;Ideally, 
&lt;br&gt;&amp;gt; the good code should be produced regardless of that flag, since 
&lt;br&gt;&amp;gt; split-wide-types is enabled implicitly by all -Ox flags. &amp;nbsp;The 
&lt;br&gt;&amp;gt; split-wide-types is also useful to improve some code sequences, such as 
&lt;br&gt;&amp;gt; when you have 32-bit data but only want to look at part of it.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;Yes of course it is a workaround, it might be a hint on where the 
&lt;br&gt;problem is. I did some simple experiments and it seems that split wide 
&lt;br&gt;type only enforces a copy to a new register pair, which makes it less 
&lt;br&gt;efficient.
&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;&lt;br&gt;Wouter
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26498816&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/eeprom_read_byte-and-clr-ret_hi-tp26418032p26498816.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26497666</id>
	<title>Re: Re: eeprom_read_byte and clr ret_hi</title>
	<published>2009-11-24T06:41:50Z</published>
	<updated>2009-11-24T06:41:50Z</updated>
	<author>
		<name>David Brown-4</name>
	</author>
	<content type="html">Wouter van Gulik wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; David Brown schreef:
&lt;br&gt;&amp;gt;&amp;gt; Wouter van Gulik wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; David Brown schreef:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Weddington, Eric wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; -----Original Message----- From: 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26497666&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu. org]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; On Behalf Of Dmitry K. Sent: Sunday, November 22, 2009 12:21 AM To:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26497666&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt; Subject: Re: [avr-libc-dev]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eeprom_read_byte and clr ret_hi
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eeprom_read_byte returns a uint8_t. Why does it clear r25? 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eerd_byte.S: clr &amp;nbsp; &amp;nbsp; ret_hi
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Does the AVR ABI require that r25 be zeroed in a function
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; returning a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; single byte? If not, this instruction could be removed.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; This is a misty point. Look an example:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; unsigned char foo1 (unsigned char *p) { return *p; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; extern unsigned char ext2 (void); int foo2 (void) { return ext2() +
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 1; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Old Avr-gcc (3.3 - 4.2) are clear R25 in both cases: foo1() and
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo2(). &amp;nbsp;The new Avr-gcc (4.3.3 and 4.4.2) are not clear R25 in
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo1().
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Note, the function return value is present only in expression. So
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; it is promoted to integer. So it would be better to clear R25 in
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo1() only (at one place).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I agree that that is the way it should be.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I'm a little confused by this - I hope this is not implying a return 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to avr-gcc 4.2 R25 clearing? &amp;nbsp;With avr-gcc 4.2, foo1() above would 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; clear R25 even though it is returning an 8-bit value. &amp;nbsp;This has 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; always been a waste of time and space - caller functions make no use 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; of the cleared R25, and thus clear it again themselves (such as in 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo2() after calling ext2()). &amp;nbsp;With avr-gcc 4.3, the extra clear R25 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; instructions are omitted for functions returning 8-bit values. &amp;nbsp;This 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is the way it should be (unless the C standards disagree...), IMHO. &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; But it looks a little like you want foo1() to clear R25 here?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Incidentally, avr-gcc 4.2.2 actually produces better code for foo2() 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; than avr-gcc 4.3.2.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; With 4.2.2, the code is:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo2:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; call ext2
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ldi R25, lo8(0)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; adiw r24,1
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ret
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; With 4.3.2 (and 4.3.0), we get:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo2:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; call ext2
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; mov r18, r24
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ldi r19, lo8(0)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; subi r18, lo8(-(1))
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; sbci r19, hi8(-(1))
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; movw r24, r18
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ret
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Is this regression is news to you, I can take it up in the main 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; avr-gcc mailing list and/or a missed optimisation bug report.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; This is &amp;quot;normal&amp;quot; GCC behaviour, caused by internal promotion to int 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; types. Having the clr r25 would have saved the ldi r19. Altough these 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; type of missed optimization are known for long, it (apparently) is 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; difficult to fix them. IIRC the main problem is the carry bit 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; propagation. I still don't now why exactly that is such a big 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; problem, but then again I am no gcc expert.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I understand about int promotion, and how it's a PITA to remove all 
&lt;br&gt;&amp;gt;&amp;gt; the extra code that the avr backend has to put in because the gcc 
&lt;br&gt;&amp;gt;&amp;gt; frontend has promoted the 8-bit data to 16-bit ints. &amp;nbsp;However, avr-gcc 
&lt;br&gt;&amp;gt;&amp;gt; 4.2 /does/ do a clr R25 in the function returning an 8-bit result, and 
&lt;br&gt;&amp;gt;&amp;gt; then it clears it /again/ after calling it (as in foo2 above). &amp;nbsp;That 
&lt;br&gt;&amp;gt;&amp;gt; is definitely a waste, and it has been removed in 4.3+.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The problem I have with the 4.3.2 code above is not the zeroing of the 
&lt;br&gt;&amp;gt;&amp;gt; upper byte - that's standard int promotion, and is required for 
&lt;br&gt;&amp;gt;&amp;gt; correct code. &amp;nbsp;The problem is that the result of ext2() is first moved 
&lt;br&gt;&amp;gt;&amp;gt; into a new register pair and then promoted to an int - an unnecessary 
&lt;br&gt;&amp;gt;&amp;gt; move, which forces the subi/sbci pair instead of subw, and requires an 
&lt;br&gt;&amp;gt;&amp;gt; additional move before the ret instruction. &amp;nbsp;In more complex code, the 
&lt;br&gt;&amp;gt;&amp;gt; wasted register resources may also be relevant.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You're right, I was not grasping the real problem. However using 
&lt;br&gt;&amp;gt; -fno-split-wide-types makes 4.3.2 behave like 4.2.2. Split wide types 
&lt;br&gt;&amp;gt; seems to be the problem here.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;You are correct - I hadn't thought of that. &amp;nbsp;However, 
&lt;br&gt;-fno-split-wide-types is a workaround, rather than a solution. &amp;nbsp;Ideally, 
&lt;br&gt;the good code should be produced regardless of that flag, since 
&lt;br&gt;split-wide-types is enabled implicitly by all -Ox flags. &amp;nbsp;The 
&lt;br&gt;split-wide-types is also useful to improve some code sequences, such as 
&lt;br&gt;when you have 32-bit data but only want to look at part of it.
&lt;br&gt;&lt;br&gt;mvh.,
&lt;br&gt;&lt;br&gt;David
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26497666&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/eeprom_read_byte-and-clr-ret_hi-tp26418032p26497666.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26494658</id>
	<title>Re: Re: eeprom_read_byte and clr ret_hi</title>
	<published>2009-11-24T03:55:01Z</published>
	<updated>2009-11-24T03:55:01Z</updated>
	<author>
		<name>Wouter van Gulik</name>
	</author>
	<content type="html">David Brown schreef:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Wouter van Gulik wrote:
&lt;br&gt;&amp;gt;&amp;gt; David Brown schreef:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Weddington, Eric wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; -----Original Message----- From: 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26494658&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu. org]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; On Behalf Of Dmitry K. Sent: Sunday, November 22, 2009 12:21 AM To:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26494658&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt; Subject: Re: [avr-libc-dev]
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eeprom_read_byte and clr ret_hi
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eeprom_read_byte returns a uint8_t. Why does it clear r25? 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eerd_byte.S: clr &amp;nbsp; &amp;nbsp; ret_hi
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Does the AVR ABI require that r25 be zeroed in a function
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; returning a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; single byte? If not, this instruction could be removed.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; This is a misty point. Look an example:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; unsigned char foo1 (unsigned char *p) { return *p; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; extern unsigned char ext2 (void); int foo2 (void) { return ext2() +
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 1; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Old Avr-gcc (3.3 - 4.2) are clear R25 in both cases: foo1() and
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo2(). &amp;nbsp;The new Avr-gcc (4.3.3 and 4.4.2) are not clear R25 in
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo1().
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Note, the function return value is present only in expression. So
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; it is promoted to integer. So it would be better to clear R25 in
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; foo1() only (at one place).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I agree that that is the way it should be.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I'm a little confused by this - I hope this is not implying a return 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; to avr-gcc 4.2 R25 clearing? &amp;nbsp;With avr-gcc 4.2, foo1() above would 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; clear R25 even though it is returning an 8-bit value. &amp;nbsp;This has 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; always been a waste of time and space - caller functions make no use 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; of the cleared R25, and thus clear it again themselves (such as in 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; foo2() after calling ext2()). &amp;nbsp;With avr-gcc 4.3, the extra clear R25 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; instructions are omitted for functions returning 8-bit values. &amp;nbsp;This 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; is the way it should be (unless the C standards disagree...), IMHO. &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; But it looks a little like you want foo1() to clear R25 here?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Incidentally, avr-gcc 4.2.2 actually produces better code for foo2() 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; than avr-gcc 4.3.2.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; With 4.2.2, the code is:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; foo2:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; call ext2
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ldi R25, lo8(0)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; adiw r24,1
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ret
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; With 4.3.2 (and 4.3.0), we get:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; foo2:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; call ext2
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; mov r18, r24
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ldi r19, lo8(0)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; subi r18, lo8(-(1))
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; sbci r19, hi8(-(1))
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; movw r24, r18
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; ret
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Is this regression is news to you, I can take it up in the main 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; avr-gcc mailing list and/or a missed optimisation bug report.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This is &amp;quot;normal&amp;quot; GCC behaviour, caused by internal promotion to int 
&lt;br&gt;&amp;gt;&amp;gt; types. Having the clr r25 would have saved the ldi r19. Altough these 
&lt;br&gt;&amp;gt;&amp;gt; type of missed optimization are known for long, it (apparently) is 
&lt;br&gt;&amp;gt;&amp;gt; difficult to fix them. IIRC the main problem is the carry bit 
&lt;br&gt;&amp;gt;&amp;gt; propagation. I still don't now why exactly that is such a big problem, 
&lt;br&gt;&amp;gt;&amp;gt; but then again I am no gcc expert.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I understand about int promotion, and how it's a PITA to remove all the 
&lt;br&gt;&amp;gt; extra code that the avr backend has to put in because the gcc frontend 
&lt;br&gt;&amp;gt; has promoted the 8-bit data to 16-bit ints. &amp;nbsp;However, avr-gcc 4.2 /does/ 
&lt;br&gt;&amp;gt; do a clr R25 in the function returning an 8-bit result, and then it 
&lt;br&gt;&amp;gt; clears it /again/ after calling it (as in foo2 above). &amp;nbsp;That is 
&lt;br&gt;&amp;gt; definitely a waste, and it has been removed in 4.3+.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The problem I have with the 4.3.2 code above is not the zeroing of the 
&lt;br&gt;&amp;gt; upper byte - that's standard int promotion, and is required for correct 
&lt;br&gt;&amp;gt; code. &amp;nbsp;The problem is that the result of ext2() is first moved into a 
&lt;br&gt;&amp;gt; new register pair and then promoted to an int - an unnecessary move, 
&lt;br&gt;&amp;gt; which forces the subi/sbci pair instead of subw, and requires an 
&lt;br&gt;&amp;gt; additional move before the ret instruction. &amp;nbsp;In more complex code, the 
&lt;br&gt;&amp;gt; wasted register resources may also be relevant.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;You're right, I was not grasping the real problem. However using 
&lt;br&gt;-fno-split-wide-types makes 4.3.2 behave like 4.2.2. Split wide types 
&lt;br&gt;seems to be the problem here.
&lt;br&gt;&lt;br&gt;HTH
&lt;br&gt;&lt;br&gt;Wouter
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26494658&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/eeprom_read_byte-and-clr-ret_hi-tp26418032p26494658.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26490260</id>
	<title>Xmega/AVRispMkII reset bug fixed</title>
	<published>2009-11-23T20:15:43Z</published>
	<updated>2009-11-23T20:15:43Z</updated>
	<author>
		<name>Erik Walthinsen-4</name>
	</author>
	<content type="html">I'm working on a contract that currently involves build stuff around the 
&lt;br&gt;ATxmega16A4 chip, and so far have managed to bash a toolchain into 
&lt;br&gt;shape, but was having problems with avrdude requiring me to completely 
&lt;br&gt;disconnect the programmer from USB after every programming cycle, which 
&lt;br&gt;was getting rather obnoxious.
&lt;br&gt;&lt;br&gt;I compared the verbose avrdude output from the STK500 log generated by 
&lt;br&gt;AVRstudio, and on a hunch added one missing command, and voila! fixed. 
&lt;br&gt;Why that command has anything to do with hanging on 2nd program I have 
&lt;br&gt;no idea, but so far it's working repeatedly.
&lt;br&gt;&lt;br&gt;The fix is to call stk500v2_loadaddr(pgm,addr) just before the main 
&lt;br&gt;block write loop in stk600_xprog_paged_write(). &amp;nbsp;I'd provide a diff, but 
&lt;br&gt;it's against 5.6 (which works, unlike 5.8 or svn...) and it's a trivial 
&lt;br&gt;change.
&lt;br&gt;&lt;br&gt;I will be filing a bug report with this information shortly.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;avrdude-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26490260&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avrdude-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---AVRdude---Dev-f2009.html&quot; embed=&quot;fixTarget[2009]&quot; target=&quot;_top&quot; &gt;AVR - AVRdude - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Xmega-AVRispMkII-reset-bug-fixed-tp26490260p26490260.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26488396</id>
	<title>RE: Expanding the ATxmega support in the toolchain</title>
	<published>2009-11-23T16:03:35Z</published>
	<updated>2009-11-23T16:03:35Z</updated>
	<author>
		<name>Weddington, Eric</name>
	</author>
	<content type="html">&amp;nbsp;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26488396&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-chat-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt; [mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26488396&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-chat-bounces+eric.weddington=atmel.com@...&lt;/a&gt;]
&lt;br&gt;&amp;gt; &amp;nbsp;On Behalf Of Erik Walthinsen
&lt;br&gt;&amp;gt; Sent: Monday, November 23, 2009 12:17 AM
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26488396&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-chat@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Subject: Re: [avr-chat] Expanding the ATxmega support in the toolchain
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; 2. Let me know the exact chips you're interested in having 
&lt;br&gt;&amp;gt; support for, and I'll take care of it for you.
&lt;br&gt;&amp;gt; Ideally all of the chips they list as available at this point:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 64,128,192,256 A1
&lt;br&gt;&amp;gt; 64,128,192,256 A3
&lt;br&gt;&amp;gt; 16,32,64,128 A4
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The peripherals are identical in each of the A lines, so the headers
&lt;br&gt;&amp;gt; should be trivial if they don't already exist, it's just specific
&lt;br&gt;&amp;gt; references to most of those combinations that seem to be 
&lt;br&gt;&amp;gt; missing in the
&lt;br&gt;&amp;gt; latest patches I can find.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;Note that these header files are never trivial. There are automatically generated from the XML device files that are shipped with AVR Studio. If AVR Studio doesn't have the XML files, then we don't have the header files for them. Adding support for a device requires more than just adding a header file.
&lt;br&gt;&lt;br&gt;Support for a fair number of those devices are already done. Some won't be done by the next release.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-chat mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26488396&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-chat@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-chat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-chat&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---General-f2011.html&quot; embed=&quot;fixTarget[2011]&quot; target=&quot;_top&quot; &gt;AVR - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Expanding-the-ATxmega-support-in-the-toolchain-tp26471271p26488396.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26487160</id>
	<title>Re: eeprom_read_byte and clr ret_hi</title>
	<published>2009-11-23T14:25:13Z</published>
	<updated>2009-11-23T14:25:13Z</updated>
	<author>
		<name>David Brown-40</name>
	</author>
	<content type="html">Weddington, Eric wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; -----Original Message----- From: 
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487160&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu. org]
&lt;br&gt;&amp;gt;&amp;gt; On Behalf Of David Brown Sent: Monday, November 23, 2009 3:25 AM 
&lt;br&gt;&amp;gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487160&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt; Subject: [avr-libc-dev] Re:
&lt;br&gt;&amp;gt;&amp;gt; eeprom_read_byte and clr ret_hi
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Weddington, Eric wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; -----Original Message----- From: 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487160&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; org] On Behalf Of Dmitry K. Sent: Sunday, November 22, 2009
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 12:21 AM To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487160&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt; Subject: Re:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [avr-libc-dev] eeprom_read_byte and clr ret_hi
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eeprom_read_byte returns a uint8_t. Why does it clear r25?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp;eerd_byte.S: clr &amp;nbsp; &amp;nbsp; ret_hi
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Does the AVR ABI require that r25 be zeroed in a function
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; returning a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; single byte? If not, this instruction could be removed.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; This is a misty point. Look an example:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; unsigned char foo1 (unsigned char *p) { return *p; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; extern unsigned char ext2 (void); int foo2 (void) { return
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ext2() + 1; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Old Avr-gcc (3.3 - 4.2) are clear R25 in both cases: foo1() and
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp;foo2(). &amp;nbsp;The new Avr-gcc (4.3.3 and 4.4.2) are not clear R25
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; in foo1().
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Note, the function return value is present only in expression.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; So it is promoted to integer. So it would be better to clear
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; R25 in foo1() only (at one place).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I agree that that is the way it should be.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; I'm a little confused by this - I hope this is not implying a 
&lt;br&gt;&amp;gt;&amp;gt; return to avr-gcc 4.2 R25 clearing?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; No, that wasn't my intention. I was merely commenting that the return
&lt;br&gt;&amp;gt; type of the macro/function should not be made int (16-bit), that it
&lt;br&gt;&amp;gt; should be a byte (uint8_t) as the API name implicates. If it is
&lt;br&gt;&amp;gt; returned as a byte, then yes it is implied and I agree that R25
&lt;br&gt;&amp;gt; should not be cleared.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;Ah, good - as I hoped. &amp;nbsp;I just wanted to be sure.
&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Is this regression is news to you, I can take it up in the main
&lt;br&gt;&amp;gt;&amp;gt; avr-gcc mailing list and/or a missed optimisation bug report.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Please fill out a bug report. That way it won't get lost.
&lt;br&gt;&lt;br&gt;I've added it to the WinAVR bug tracker:
&lt;br&gt;&amp;lt;&lt;a href=&quot;https://sourceforge.net/tracker/?func=detail&amp;aid=2902772&amp;group_id=68108&amp;atid=520074&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://sourceforge.net/tracker/?func=detail&amp;aid=2902772&amp;group_id=68108&amp;atid=520074&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Hope that helps!
&lt;br&gt;&lt;br&gt;p.s. - I'm looking forward to gcc 4.5 with LTO. &amp;nbsp;For small targets like 
&lt;br&gt;the AVR, that should mean full program optimisation for everything, 
&lt;br&gt;including the libraries.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26487160&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/eeprom_read_byte-and-clr-ret_hi-tp26418032p26487160.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26486911</id>
	<title>RE: binutils 2.20</title>
	<published>2009-11-23T14:00:47Z</published>
	<updated>2009-11-23T14:00:47Z</updated>
	<author>
		<name>Weddington, Eric</name>
	</author>
	<content type="html">&amp;nbsp;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486911&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-gcc-list-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt; [mailto:avr-gcc-list-bounces+eric.weddington=atmel.com@nongnu.
&lt;br&gt;&amp;gt; org] On Behalf Of Rolf Ebert
&lt;br&gt;&amp;gt; Sent: Monday, November 23, 2009 1:46 PM
&lt;br&gt;&amp;gt; To: 'AVR-GCC'
&lt;br&gt;&amp;gt; Subject: [avr-gcc-list] binutils 2.20
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; while building the compiler (gcc-4.3.3) I get the following error:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; checking for avr-nm... 
&lt;br&gt;&amp;gt; k/Data/Development/gcc-cvs/build/gcc-obj/./gcc/nm
&lt;br&gt;&amp;gt; checking for avr-ranlib... /mingw/avr_43_gnat/avr/bin/ranlib
&lt;br&gt;&amp;gt; checking for avr-strip... /mingw/avr_43_gnat/avr/bin/strip
&lt;br&gt;&amp;gt; checking whether ln -s works... yes
&lt;br&gt;&amp;gt; checking for avr-gcc... 
&lt;br&gt;&amp;gt; /k/Data/Development/gcc-cvs/build/gcc-obj/./gcc/xgcc 
&lt;br&gt;&amp;gt; -B/k/Data/Development/gcc-cvs/build/gcc-obj/./gcc/ 
&lt;br&gt;&amp;gt; -B/mingw/avr_43_gnat/avr/bin/ -B/mingw/avr_43_gnat/avr/lib/ -isystem 
&lt;br&gt;&amp;gt; /mingw/avr_43_gnat/avr/include -isystem 
&lt;br&gt;&amp;gt; /mingw/avr_43_gnat/avr/sys-include &amp;nbsp;-mmcu=avrxmega4
&lt;br&gt;&amp;gt; checking for suffix of object files... configure: error: 
&lt;br&gt;&amp;gt; cannot compute 
&lt;br&gt;&amp;gt; suffix of object files: cannot compile
&lt;br&gt;&amp;gt; See `config.log' for more details.
&lt;br&gt;&amp;gt; make[1]: *** [configure-target-libgcc] Error 1
&lt;br&gt;&amp;gt; make[1]: Leaving directory `/k/Data/Development/gcc-cvs/build/gcc-obj'
&lt;br&gt;&amp;gt; make: *** [all] Error 2
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I am using binutils 2.20 unpatched and the gcc-4.3.2 patches as 
&lt;br&gt;&amp;gt; available from the WinAVR CVS repository. &amp;nbsp;The gcc patches apply all 
&lt;br&gt;&amp;gt; cleanly against gcc-4.3.3.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It seams to me that the binutils still don't know about the 
&lt;br&gt;&amp;gt; xmega chips.
&lt;/div&gt;&lt;br&gt;That is correct. You have to use a patched binutils with a patched gcc. The xmega patches have been written by myself and Anatoly Sokolov and I haven't submitted them upstream yet.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-GCC-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26486911&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-GCC-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---gcc-f2010.html&quot; embed=&quot;fixTarget[2010]&quot; target=&quot;_top&quot; &gt;AVR - gcc&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/binutils-2.20-tp26485830p26486911.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26485830</id>
	<title>binutils 2.20</title>
	<published>2009-11-23T12:46:16Z</published>
	<updated>2009-11-23T12:46:16Z</updated>
	<author>
		<name>Rolf Ebert</name>
	</author>
	<content type="html">while building the compiler (gcc-4.3.3) I get the following error:
&lt;br&gt;&lt;br&gt;checking for avr-nm... k/Data/Development/gcc-cvs/build/gcc-obj/./gcc/nm
&lt;br&gt;checking for avr-ranlib... /mingw/avr_43_gnat/avr/bin/ranlib
&lt;br&gt;checking for avr-strip... /mingw/avr_43_gnat/avr/bin/strip
&lt;br&gt;checking whether ln -s works... yes
&lt;br&gt;checking for avr-gcc... 
&lt;br&gt;/k/Data/Development/gcc-cvs/build/gcc-obj/./gcc/xgcc 
&lt;br&gt;-B/k/Data/Development/gcc-cvs/build/gcc-obj/./gcc/ 
&lt;br&gt;-B/mingw/avr_43_gnat/avr/bin/ -B/mingw/avr_43_gnat/avr/lib/ -isystem 
&lt;br&gt;/mingw/avr_43_gnat/avr/include -isystem 
&lt;br&gt;/mingw/avr_43_gnat/avr/sys-include &amp;nbsp;-mmcu=avrxmega4
&lt;br&gt;checking for suffix of object files... configure: error: cannot compute 
&lt;br&gt;suffix of object files: cannot compile
&lt;br&gt;See `config.log' for more details.
&lt;br&gt;make[1]: *** [configure-target-libgcc] Error 1
&lt;br&gt;make[1]: Leaving directory `/k/Data/Development/gcc-cvs/build/gcc-obj'
&lt;br&gt;make: *** [all] Error 2
&lt;br&gt;&lt;br&gt;&lt;br&gt;I am using binutils 2.20 unpatched and the gcc-4.3.2 patches as 
&lt;br&gt;available from the WinAVR CVS repository. &amp;nbsp;The gcc patches apply all 
&lt;br&gt;cleanly against gcc-4.3.3.
&lt;br&gt;&lt;br&gt;It seams to me that the binutils still don't know about the xmega chips.
&lt;br&gt;&lt;br&gt;rolf
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-GCC-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26485830&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-GCC-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---gcc-f2010.html&quot; embed=&quot;fixTarget[2010]&quot; target=&quot;_top&quot; &gt;AVR - gcc&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/binutils-2.20-tp26485830p26485830.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26481275</id>
	<title>RE: Re: eeprom_read_byte and clr ret_hi</title>
	<published>2009-11-23T08:17:00Z</published>
	<updated>2009-11-23T08:17:00Z</updated>
	<author>
		<name>Weddington, Eric</name>
	</author>
	<content type="html">&amp;nbsp;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481275&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu.
&lt;br&gt;&amp;gt; org] On Behalf Of David Brown
&lt;br&gt;&amp;gt; Sent: Monday, November 23, 2009 3:25 AM
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481275&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Subject: [avr-libc-dev] Re: eeprom_read_byte and clr ret_hi
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Weddington, Eric wrote:
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; -----Original Message----- From: 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481275&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu. org]
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; On Behalf Of Dmitry K. Sent: Sunday, November 22, 2009 12:21 AM To:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481275&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt; Subject: Re: [avr-libc-dev]
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; eeprom_read_byte and clr ret_hi
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; eeprom_read_byte returns a uint8_t. Why does it clear r25? 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; eerd_byte.S: clr &amp;nbsp; &amp;nbsp; ret_hi
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; Does the AVR ABI require that r25 be zeroed in a function
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; returning a
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; single byte? If not, this instruction could be removed.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; This is a misty point. Look an example:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; unsigned char foo1 (unsigned char *p) { return *p; }
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; extern unsigned char ext2 (void); int foo2 (void) { return ext2() +
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 1; }
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Old Avr-gcc (3.3 - 4.2) are clear R25 in both cases: foo1() and
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; foo2(). &amp;nbsp;The new Avr-gcc (4.3.3 and 4.4.2) are not clear R25 in
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; foo1().
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Note, the function return value is present only in expression. So
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; it is promoted to integer. So it would be better to clear R25 in
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; foo1() only (at one place).
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I agree that that is the way it should be.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm a little confused by this - I hope this is not implying a 
&lt;br&gt;&amp;gt; return to 
&lt;br&gt;&amp;gt; avr-gcc 4.2 R25 clearing?
&lt;/div&gt;&lt;br&gt;No, that wasn't my intention. I was merely commenting that the return type of the macro/function should not be made int (16-bit), that it should be a byte (uint8_t) as the API name implicates. If it is returned as a byte, then yes it is implied and I agree that R25 should not be cleared.
&lt;br&gt;&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;gt; Is this regression is news to you, I can take it up in the 
&lt;br&gt;&amp;gt; main avr-gcc 
&lt;br&gt;&amp;gt; mailing list and/or a missed optimisation bug report.
&lt;br&gt;&lt;br&gt;Please fill out a bug report. That way it won't get lost.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26481275&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/eeprom_read_byte-and-clr-ret_hi-tp26418032p26481275.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26475688</id>
	<title>Re: eeprom_read_byte and clr ret_hi</title>
	<published>2009-11-23T02:24:38Z</published>
	<updated>2009-11-23T02:24:38Z</updated>
	<author>
		<name>David Brown-4</name>
	</author>
	<content type="html">Weddington, Eric wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; -----Original Message----- From: 
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26475688&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu. org]
&lt;br&gt;&amp;gt;&amp;gt; On Behalf Of Dmitry K. Sent: Sunday, November 22, 2009 12:21 AM To:
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26475688&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt; Subject: Re: [avr-libc-dev]
&lt;br&gt;&amp;gt;&amp;gt; eeprom_read_byte and clr ret_hi
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eeprom_read_byte returns a uint8_t. Why does it clear r25? 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; eerd_byte.S: clr &amp;nbsp; &amp;nbsp; ret_hi
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Does the AVR ABI require that r25 be zeroed in a function
&lt;br&gt;&amp;gt;&amp;gt; returning a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; single byte? If not, this instruction could be removed.
&lt;br&gt;&amp;gt;&amp;gt; This is a misty point. Look an example:
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; unsigned char foo1 (unsigned char *p) { return *p; }
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; extern unsigned char ext2 (void); int foo2 (void) { return ext2() +
&lt;br&gt;&amp;gt;&amp;gt; 1; }
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Old Avr-gcc (3.3 - 4.2) are clear R25 in both cases: foo1() and
&lt;br&gt;&amp;gt;&amp;gt; foo2(). &amp;nbsp;The new Avr-gcc (4.3.3 and 4.4.2) are not clear R25 in
&lt;br&gt;&amp;gt;&amp;gt; foo1().
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Note, the function return value is present only in expression. So
&lt;br&gt;&amp;gt;&amp;gt; it is promoted to integer. So it would be better to clear R25 in
&lt;br&gt;&amp;gt;&amp;gt; foo1() only (at one place).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I agree that that is the way it should be.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;I'm a little confused by this - I hope this is not implying a return to 
&lt;br&gt;avr-gcc 4.2 R25 clearing? &amp;nbsp;With avr-gcc 4.2, foo1() above would clear 
&lt;br&gt;R25 even though it is returning an 8-bit value. &amp;nbsp;This has always been a 
&lt;br&gt;waste of time and space - caller functions make no use of the cleared 
&lt;br&gt;R25, and thus clear it again themselves (such as in foo2() after calling 
&lt;br&gt;ext2()). &amp;nbsp;With avr-gcc 4.3, the extra clear R25 instructions are omitted 
&lt;br&gt;for functions returning 8-bit values. &amp;nbsp;This is the way it should be 
&lt;br&gt;(unless the C standards disagree...), IMHO. &amp;nbsp;But it looks a little like 
&lt;br&gt;you want foo1() to clear R25 here?
&lt;br&gt;&lt;br&gt;&lt;br&gt;Incidentally, avr-gcc 4.2.2 actually produces better code for foo2() 
&lt;br&gt;than avr-gcc 4.3.2.
&lt;br&gt;&lt;br&gt;With 4.2.2, the code is:
&lt;br&gt;foo2:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; call ext2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ldi R25, lo8(0)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adiw r24,1
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret
&lt;br&gt;&lt;br&gt;With 4.3.2 (and 4.3.0), we get:
&lt;br&gt;foo2:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; call ext2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov r18, r24
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ldi r19, lo8(0)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subi r18, lo8(-(1))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sbci r19, hi8(-(1))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; movw r24, r18
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret
&lt;br&gt;&lt;br&gt;Is this regression is news to you, I can take it up in the main avr-gcc 
&lt;br&gt;mailing list and/or a missed optimisation bug report.
&lt;br&gt;&lt;br&gt;mvh.,
&lt;br&gt;&lt;br&gt;David
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; Possibly, it is needed to change eeprom_read_byte() definition to
&lt;br&gt;&amp;gt;&amp;gt; int return value. This can reduce summary size. Opinions?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This does not make sense to me. Eeprom_read_byte() is supposed to
&lt;br&gt;&amp;gt; read, and return, a single byte. So why should it return a 16-bit
&lt;br&gt;&amp;gt; int? In my mind this would just make it more confusing to the end
&lt;br&gt;&amp;gt; user.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26475688&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/eeprom_read_byte-and-clr-ret_hi-tp26418032p26475688.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26473600</id>
	<title>Re: Expanding the ATxmega support in the toolchain</title>
	<published>2009-11-22T23:17:28Z</published>
	<updated>2009-11-22T23:17:28Z</updated>
	<author>
		<name>Erik Walthinsen-4</name>
	</author>
	<content type="html">Weddington, Eric wrote:
&lt;br&gt;&amp;gt; 1. The &amp;quot;architectures&amp;quot; that are listed in the toolchain have absolutely nothing to do with the architectures or families of chips. They are just convenient categories or groups to put chips in that have similar features that the toolchain needs to know about.
&lt;br&gt;Right, they're for things like different instruction availability,
&lt;br&gt;memory sizes, etc. &amp;nbsp;I'm just not seeing any differences between the
&lt;br&gt;architectures as defined in binutils except for the name. &amp;nbsp;Are there
&lt;br&gt;differences buried inside gcc (which I haven't had time yet to look at)?
&lt;br&gt;&lt;br&gt;&amp;gt; 2. Let me know the exact chips you're interested in having support for, and I'll take care of it for you.
&lt;br&gt;Ideally all of the chips they list as available at this point:
&lt;br&gt;&lt;br&gt;64,128,192,256 A1
&lt;br&gt;64,128,192,256 A3
&lt;br&gt;16,32,64,128 A4
&lt;br&gt;&lt;br&gt;The peripherals are identical in each of the A lines, so the headers
&lt;br&gt;should be trivial if they don't already exist, it's just specific
&lt;br&gt;references to most of those combinations that seem to be missing in the
&lt;br&gt;latest patches I can find.
&lt;br&gt;&lt;br&gt;I'm using the 16A4 in lieu of the 128A4 right now because I couldn't
&lt;br&gt;easily find a source of small quantity of the right package. &amp;nbsp;A later
&lt;br&gt;stage of this contract will likely involve an A1 chip.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Omega
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; aka Erik Walthinsen
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26473600&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;omega@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-chat mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26473600&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-chat@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-chat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-chat&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---General-f2011.html&quot; embed=&quot;fixTarget[2011]&quot; target=&quot;_top&quot; &gt;AVR - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Expanding-the-ATxmega-support-in-the-toolchain-tp26471271p26473600.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26472046</id>
	<title>RE: Expanding the ATxmega support in the toolchain</title>
	<published>2009-11-22T18:43:21Z</published>
	<updated>2009-11-22T18:43:21Z</updated>
	<author>
		<name>Weddington, Eric</name>
	</author>
	<content type="html">&lt;br&gt;1. The &amp;quot;architectures&amp;quot; that are listed in the toolchain have absolutely nothing to do with the architectures or families of chips. They are just convenient categories or groups to put chips in that have similar features that the toolchain needs to know about.
&lt;br&gt;&lt;br&gt;2. Let me know the exact chips you're interested in having support for, and I'll take care of it for you.
&lt;br&gt;&lt;br&gt;3. And for support for the ATxmega16A4, I already have it done. The next release of WinAVR will be roughly mid-December. If you need the patches to build a Linux toolchain, I can send them on to you.
&lt;br&gt;&lt;br&gt;Eric Weddington
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26472046&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-chat-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt; [mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26472046&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-chat-bounces+eric.weddington=atmel.com@...&lt;/a&gt;]
&lt;br&gt;&amp;gt; &amp;nbsp;On Behalf Of Erik Walthinsen
&lt;br&gt;&amp;gt; Sent: Sunday, November 22, 2009 5:51 PM
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26472046&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-chat@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Subject: [avr-chat] Expanding the ATxmega support in the toolchain
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I've got boards ready to populate for a [paid] prototyping 
&lt;br&gt;&amp;gt; project that
&lt;br&gt;&amp;gt; are going to be getting ATxmega16a4's (for lack of anybody selling
&lt;br&gt;&amp;gt; 64a4's...). &amp;nbsp;The problem is, even the WinAVR patches don't 
&lt;br&gt;&amp;gt; seem to show
&lt;br&gt;&amp;gt; any support for anything other than the 64a1 and 128a1.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm going to be adding support for the 16a4, and probably every other
&lt;br&gt;&amp;gt; chip actually nominally available at this point, and submitting the
&lt;br&gt;&amp;gt; patches soon (since this is the next roadblock for me to blast through
&lt;br&gt;&amp;gt; on this contract).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; However, I'm *royally* confused by the presence of the avrxmega2-7
&lt;br&gt;&amp;gt; &amp;quot;architectures&amp;quot;. &amp;nbsp;There seems to be no correlation between the arch
&lt;br&gt;&amp;gt; number and the chip it's supposed to represent, as per the table at
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nongnu.org/avr-libc/user-manual/using_tools.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.nongnu.org/avr-libc/user-manual/using_tools.html&lt;/a&gt;&amp;nbsp; Further,
&lt;br&gt;&amp;gt; the table refers to a number of chips that don't even exist 
&lt;br&gt;&amp;gt; (the D* series).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; From my understanding of both Atmel's very clearly stated goal, and a
&lt;br&gt;&amp;gt; lot of time reading the datasheets, there should be *1* &amp;quot;architecture&amp;quot;
&lt;br&gt;&amp;gt; for all the existing chips, that would be the atxmegaA. &amp;nbsp;The 
&lt;br&gt;&amp;gt; only other
&lt;br&gt;&amp;gt; that might make sense could be a &amp;lt;=64KB variant.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Anyone able to shed light on what's up with these architectures and
&lt;br&gt;&amp;gt; whether they actually mean anything, or would it make sense 
&lt;br&gt;&amp;gt; to collapse
&lt;br&gt;&amp;gt; them down as part of adding full support to all the current chips?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; TIA,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Omega
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;aka Erik Walthinsen
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26472046&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;omega@...&lt;/a&gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; AVR-chat mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26472046&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-chat@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-chat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-chat&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-chat mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26472046&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-chat@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-chat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-chat&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---General-f2011.html&quot; embed=&quot;fixTarget[2011]&quot; target=&quot;_top&quot; &gt;AVR - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Expanding-the-ATxmega-support-in-the-toolchain-tp26471271p26472046.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26471271</id>
	<title>Expanding the ATxmega support in the toolchain</title>
	<published>2009-11-22T16:50:39Z</published>
	<updated>2009-11-22T16:50:39Z</updated>
	<author>
		<name>Erik Walthinsen-4</name>
	</author>
	<content type="html">I've got boards ready to populate for a [paid] prototyping project that
&lt;br&gt;are going to be getting ATxmega16a4's (for lack of anybody selling
&lt;br&gt;64a4's...). &amp;nbsp;The problem is, even the WinAVR patches don't seem to show
&lt;br&gt;any support for anything other than the 64a1 and 128a1.
&lt;br&gt;&lt;br&gt;I'm going to be adding support for the 16a4, and probably every other
&lt;br&gt;chip actually nominally available at this point, and submitting the
&lt;br&gt;patches soon (since this is the next roadblock for me to blast through
&lt;br&gt;on this contract).
&lt;br&gt;&lt;br&gt;However, I'm *royally* confused by the presence of the avrxmega2-7
&lt;br&gt;&amp;quot;architectures&amp;quot;. &amp;nbsp;There seems to be no correlation between the arch
&lt;br&gt;number and the chip it's supposed to represent, as per the table at
&lt;br&gt;&lt;a href=&quot;http://www.nongnu.org/avr-libc/user-manual/using_tools.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.nongnu.org/avr-libc/user-manual/using_tools.html&lt;/a&gt;&amp;nbsp; Further,
&lt;br&gt;the table refers to a number of chips that don't even exist (the D* series).
&lt;br&gt;&lt;br&gt;From my understanding of both Atmel's very clearly stated goal, and a
&lt;br&gt;lot of time reading the datasheets, there should be *1* &amp;quot;architecture&amp;quot;
&lt;br&gt;for all the existing chips, that would be the atxmegaA. &amp;nbsp;The only other
&lt;br&gt;that might make sense could be a &amp;lt;=64KB variant.
&lt;br&gt;&lt;br&gt;Anyone able to shed light on what's up with these architectures and
&lt;br&gt;whether they actually mean anything, or would it make sense to collapse
&lt;br&gt;them down as part of adding full support to all the current chips?
&lt;br&gt;&lt;br&gt;TIA,
&lt;br&gt;&amp;nbsp; &amp;nbsp;Omega
&lt;br&gt;&amp;nbsp; &amp;nbsp;aka Erik Walthinsen
&lt;br&gt;&amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26471271&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;omega@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-chat mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26471271&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-chat@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-chat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-chat&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---General-f2011.html&quot; embed=&quot;fixTarget[2011]&quot; target=&quot;_top&quot; &gt;AVR - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Expanding-the-ATxmega-support-in-the-toolchain-tp26471271p26471271.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26470398</id>
	<title>Re: eeprom_read_byte and clr ret_hi</title>
	<published>2009-11-22T14:45:04Z</published>
	<updated>2009-11-22T14:45:04Z</updated>
	<author>
		<name>Dmitry K.</name>
	</author>
	<content type="html">&amp;gt; &amp;gt; Possibly, it is needed to change eeprom_read_byte() definition
&lt;br&gt;&amp;gt; &amp;gt; to int return value. This can reduce summary size. Opinions?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This does not make sense to me. Eeprom_read_byte() is supposed to read, and
&lt;br&gt;&amp;gt; return, a single byte. So why should it return a 16-bit int? In my mind
&lt;br&gt;&amp;gt; this would just make it more confusing to the end user.
&lt;br&gt;&lt;br&gt;Agree, it was a bad idea.
&lt;br&gt;More, the definition of eeprom_read_byte() as int will
&lt;br&gt;decrease performance in cases, where Avr-gcc can omit
&lt;br&gt;integral promotion, for example:
&lt;br&gt;&amp;nbsp; if (eeprom_read_byte(&amp;x) &amp;lt; 10)
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Dmitry.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26470398&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/eeprom_read_byte-and-clr-ret_hi-tp26418032p26470398.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26467394</id>
	<title>Re: stdint.h problem with gcc</title>
	<published>2009-11-22T09:33:02Z</published>
	<updated>2009-11-22T09:33:02Z</updated>
	<author>
		<name>Andrew Hutchinson</name>
	</author>
	<content type="html">I have posted patch to &amp;quot;ignore&amp;quot; gcc stdint test failure due to limit 
&lt;br&gt;range of prtdiff &amp;nbsp;for AVR (c99 wants +-65535)
&lt;br&gt;Though we could use &amp;quot;long&amp;quot; that is pointless with restriction on objects 
&lt;br&gt;being &amp;nbsp;&amp;lt;= 32767 bytes.
&lt;br&gt;&lt;br&gt;There are several errors/problems remaining with avr-libc stdint.h - gcc 
&lt;br&gt;version passes most (all?) tests.
&lt;br&gt;I would be grateful if someone could review this.
&lt;br&gt;&lt;br&gt;Andy
&lt;br&gt;&lt;br&gt;&lt;br&gt;Andrew Hutchinson wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I have been going through the gcc tests for V4.5 and come across some 
&lt;br&gt;&amp;gt; issues with avr-lic stdint.h
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The tests that fails are gcc/gcc/testsuite/gcc.dg/c99-stdint-1.c
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; gcc will create it's own stdint.h and this is fine for V4.5. I have 
&lt;br&gt;&amp;gt; attached this for reference.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The definition of UINT8_MAX is unsigned e.g. 255U - this fails test. 
&lt;br&gt;&amp;gt; 255 is ok
&lt;br&gt;&amp;gt; wchar limits are not defined- ok we dont have wchar.h but we should 
&lt;br&gt;&amp;gt; still define the types.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; There is &amp;nbsp;another issue related to ptrdiff type. This is posted as gcc 
&lt;br&gt;&amp;gt; bug - since it is possible that this particular subtest is 
&lt;br&gt;&amp;gt; inappropriate for avr.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42114&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42114&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; =================================================================
&lt;br&gt;&amp;gt; /* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This file is part of GCC.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; GCC is free software; you can redistribute it and/or modify
&lt;br&gt;&amp;gt; it under the terms of the GNU General Public License as published by
&lt;br&gt;&amp;gt; the Free Software Foundation; either version 3, or (at your option)
&lt;br&gt;&amp;gt; any later version.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; GCC is distributed in the hope that it will be useful,
&lt;br&gt;&amp;gt; but WITHOUT ANY WARRANTY; without even the implied warranty of
&lt;br&gt;&amp;gt; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &amp;nbsp;See the
&lt;br&gt;&amp;gt; GNU General Public License for more details.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Under Section 7 of GPL version 3, you are granted additional
&lt;br&gt;&amp;gt; permissions described in the GCC Runtime Library Exception, version
&lt;br&gt;&amp;gt; 3.1, as published by the Free Software Foundation.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You should have received a copy of the GNU General Public License and
&lt;br&gt;&amp;gt; a copy of the GCC Runtime Library Exception along with this program;
&lt;br&gt;&amp;gt; see the files COPYING3 and COPYING.RUNTIME respectively. &amp;nbsp;If not, see
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://www.gnu.org/licenses/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/licenses/&lt;/a&gt;&amp;gt;. &amp;nbsp;*/
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /*
&lt;br&gt;&amp;gt; * ISO C Standard: &amp;nbsp;7.18 &amp;nbsp;Integer types &amp;nbsp;&amp;lt;stdint.h&amp;gt;
&lt;br&gt;&amp;gt; */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #ifndef _GCC_STDINT_H
&lt;br&gt;&amp;gt; #define _GCC_STDINT_H
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /* 7.8.1.1 Exact-width integer types */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #ifdef __INT8_TYPE__
&lt;br&gt;&amp;gt; typedef __INT8_TYPE__ int8_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __INT16_TYPE__
&lt;br&gt;&amp;gt; typedef __INT16_TYPE__ int16_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __INT32_TYPE__
&lt;br&gt;&amp;gt; typedef __INT32_TYPE__ int32_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __INT64_TYPE__
&lt;br&gt;&amp;gt; typedef __INT64_TYPE__ int64_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINT8_TYPE__
&lt;br&gt;&amp;gt; typedef __UINT8_TYPE__ uint8_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINT16_TYPE__
&lt;br&gt;&amp;gt; typedef __UINT16_TYPE__ uint16_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINT32_TYPE__
&lt;br&gt;&amp;gt; typedef __UINT32_TYPE__ uint32_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINT64_TYPE__
&lt;br&gt;&amp;gt; typedef __UINT64_TYPE__ uint64_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /* 7.8.1.2 Minimum-width integer types */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; typedef __INT_LEAST8_TYPE__ int_least8_t;
&lt;br&gt;&amp;gt; typedef __INT_LEAST16_TYPE__ int_least16_t;
&lt;br&gt;&amp;gt; typedef __INT_LEAST32_TYPE__ int_least32_t;
&lt;br&gt;&amp;gt; typedef __INT_LEAST64_TYPE__ int_least64_t;
&lt;br&gt;&amp;gt; typedef __UINT_LEAST8_TYPE__ uint_least8_t;
&lt;br&gt;&amp;gt; typedef __UINT_LEAST16_TYPE__ uint_least16_t;
&lt;br&gt;&amp;gt; typedef __UINT_LEAST32_TYPE__ uint_least32_t;
&lt;br&gt;&amp;gt; typedef __UINT_LEAST64_TYPE__ uint_least64_t;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /* 7.8.1.3 Fastest minimum-width integer types */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; typedef __INT_FAST8_TYPE__ int_fast8_t;
&lt;br&gt;&amp;gt; typedef __INT_FAST16_TYPE__ int_fast16_t;
&lt;br&gt;&amp;gt; typedef __INT_FAST32_TYPE__ int_fast32_t;
&lt;br&gt;&amp;gt; typedef __INT_FAST64_TYPE__ int_fast64_t;
&lt;br&gt;&amp;gt; typedef __UINT_FAST8_TYPE__ uint_fast8_t;
&lt;br&gt;&amp;gt; typedef __UINT_FAST16_TYPE__ uint_fast16_t;
&lt;br&gt;&amp;gt; typedef __UINT_FAST32_TYPE__ uint_fast32_t;
&lt;br&gt;&amp;gt; typedef __UINT_FAST64_TYPE__ uint_fast64_t;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /* 7.8.1.4 Integer types capable of holding object pointers */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #ifdef __INTPTR_TYPE__
&lt;br&gt;&amp;gt; typedef __INTPTR_TYPE__ intptr_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINTPTR_TYPE__
&lt;br&gt;&amp;gt; typedef __UINTPTR_TYPE__ uintptr_t;
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /* 7.8.1.5 Greatest-width integer types */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; typedef __INTMAX_TYPE__ intmax_t;
&lt;br&gt;&amp;gt; typedef __UINTMAX_TYPE__ uintmax_t;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #if !defined __cplusplus || defined __STDC_LIMIT_MACROS
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /* 7.18.2 Limits of specified-width integer types */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #ifdef __INT8_MAX__
&lt;br&gt;&amp;gt; # undef INT8_MAX
&lt;br&gt;&amp;gt; # define INT8_MAX __INT8_MAX__
&lt;br&gt;&amp;gt; # undef INT8_MIN
&lt;br&gt;&amp;gt; # define INT8_MIN (-INT8_MAX - 1)
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINT8_MAX__
&lt;br&gt;&amp;gt; # undef UINT8_MAX
&lt;br&gt;&amp;gt; # define UINT8_MAX __UINT8_MAX__
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __INT16_MAX__
&lt;br&gt;&amp;gt; # undef INT16_MAX
&lt;br&gt;&amp;gt; # define INT16_MAX __INT16_MAX__
&lt;br&gt;&amp;gt; # undef INT16_MIN
&lt;br&gt;&amp;gt; # define INT16_MIN (-INT16_MAX - 1)
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINT16_MAX__
&lt;br&gt;&amp;gt; # undef UINT16_MAX
&lt;br&gt;&amp;gt; # define UINT16_MAX __UINT16_MAX__
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __INT32_MAX__
&lt;br&gt;&amp;gt; # undef INT32_MAX
&lt;br&gt;&amp;gt; # define INT32_MAX __INT32_MAX__
&lt;br&gt;&amp;gt; # undef INT32_MIN
&lt;br&gt;&amp;gt; # define INT32_MIN (-INT32_MAX - 1)
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINT32_MAX__
&lt;br&gt;&amp;gt; # undef UINT32_MAX
&lt;br&gt;&amp;gt; # define UINT32_MAX __UINT32_MAX__
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __INT64_MAX__
&lt;br&gt;&amp;gt; # undef INT64_MAX
&lt;br&gt;&amp;gt; # define INT64_MAX __INT64_MAX__
&lt;br&gt;&amp;gt; # undef INT64_MIN
&lt;br&gt;&amp;gt; # define INT64_MIN (-INT64_MAX - 1)
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINT64_MAX__
&lt;br&gt;&amp;gt; # undef UINT64_MAX
&lt;br&gt;&amp;gt; # define UINT64_MAX __UINT64_MAX__
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #undef INT_LEAST8_MAX
&lt;br&gt;&amp;gt; #define INT_LEAST8_MAX __INT_LEAST8_MAX__
&lt;br&gt;&amp;gt; #undef INT_LEAST8_MIN
&lt;br&gt;&amp;gt; #define INT_LEAST8_MIN (-INT_LEAST8_MAX - 1)
&lt;br&gt;&amp;gt; #undef UINT_LEAST8_MAX
&lt;br&gt;&amp;gt; #define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
&lt;br&gt;&amp;gt; #undef INT_LEAST16_MAX
&lt;br&gt;&amp;gt; #define INT_LEAST16_MAX __INT_LEAST16_MAX__
&lt;br&gt;&amp;gt; #undef INT_LEAST16_MIN
&lt;br&gt;&amp;gt; #define INT_LEAST16_MIN (-INT_LEAST16_MAX - 1)
&lt;br&gt;&amp;gt; #undef UINT_LEAST16_MAX
&lt;br&gt;&amp;gt; #define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
&lt;br&gt;&amp;gt; #undef INT_LEAST32_MAX
&lt;br&gt;&amp;gt; #define INT_LEAST32_MAX __INT_LEAST32_MAX__
&lt;br&gt;&amp;gt; #undef INT_LEAST32_MIN
&lt;br&gt;&amp;gt; #define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)
&lt;br&gt;&amp;gt; #undef UINT_LEAST32_MAX
&lt;br&gt;&amp;gt; #define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
&lt;br&gt;&amp;gt; #undef INT_LEAST64_MAX
&lt;br&gt;&amp;gt; #define INT_LEAST64_MAX __INT_LEAST64_MAX__
&lt;br&gt;&amp;gt; #undef INT_LEAST64_MIN
&lt;br&gt;&amp;gt; #define INT_LEAST64_MIN (-INT_LEAST64_MAX - 1)
&lt;br&gt;&amp;gt; #undef UINT_LEAST64_MAX
&lt;br&gt;&amp;gt; #define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #undef INT_FAST8_MAX
&lt;br&gt;&amp;gt; #define INT_FAST8_MAX __INT_FAST8_MAX__
&lt;br&gt;&amp;gt; #undef INT_FAST8_MIN
&lt;br&gt;&amp;gt; #define INT_FAST8_MIN (-INT_FAST8_MAX - 1)
&lt;br&gt;&amp;gt; #undef UINT_FAST8_MAX
&lt;br&gt;&amp;gt; #define UINT_FAST8_MAX __UINT_FAST8_MAX__
&lt;br&gt;&amp;gt; #undef INT_FAST16_MAX
&lt;br&gt;&amp;gt; #define INT_FAST16_MAX __INT_FAST16_MAX__
&lt;br&gt;&amp;gt; #undef INT_FAST16_MIN
&lt;br&gt;&amp;gt; #define INT_FAST16_MIN (-INT_FAST16_MAX - 1)
&lt;br&gt;&amp;gt; #undef UINT_FAST16_MAX
&lt;br&gt;&amp;gt; #define UINT_FAST16_MAX __UINT_FAST16_MAX__
&lt;br&gt;&amp;gt; #undef INT_FAST32_MAX
&lt;br&gt;&amp;gt; #define INT_FAST32_MAX __INT_FAST32_MAX__
&lt;br&gt;&amp;gt; #undef INT_FAST32_MIN
&lt;br&gt;&amp;gt; #define INT_FAST32_MIN (-INT_FAST32_MAX - 1)
&lt;br&gt;&amp;gt; #undef UINT_FAST32_MAX
&lt;br&gt;&amp;gt; #define UINT_FAST32_MAX __UINT_FAST32_MAX__
&lt;br&gt;&amp;gt; #undef INT_FAST64_MAX
&lt;br&gt;&amp;gt; #define INT_FAST64_MAX __INT_FAST64_MAX__
&lt;br&gt;&amp;gt; #undef INT_FAST64_MIN
&lt;br&gt;&amp;gt; #define INT_FAST64_MIN (-INT_FAST64_MAX - 1)
&lt;br&gt;&amp;gt; #undef UINT_FAST64_MAX
&lt;br&gt;&amp;gt; #define UINT_FAST64_MAX __UINT_FAST64_MAX__
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #ifdef __INTPTR_MAX__
&lt;br&gt;&amp;gt; # undef INTPTR_MAX
&lt;br&gt;&amp;gt; # define INTPTR_MAX __INTPTR_MAX__
&lt;br&gt;&amp;gt; # undef INTPTR_MIN
&lt;br&gt;&amp;gt; # define INTPTR_MIN (-INTPTR_MAX - 1)
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt; #ifdef __UINTPTR_MAX__
&lt;br&gt;&amp;gt; # undef UINTPTR_MAX
&lt;br&gt;&amp;gt; # define UINTPTR_MAX __UINTPTR_MAX__
&lt;br&gt;&amp;gt; #endif
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #undef INTMAX_MAX
&lt;br&gt;&amp;gt; #define INTMAX_MAX __INTMAX_MAX__
&lt;br&gt;&amp;gt; #undef INTMAX_MIN
&lt;br&gt;&amp;gt; #define INTMAX_MIN (-INTMAX_MAX - 1)
&lt;br&gt;&amp;gt; #undef UINTMAX_MAX
&lt;br&gt;&amp;gt; #define UINTMAX_MAX __UINTMAX_MAX__
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /* 7.18.3 Limits of other integer types */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #undef PTRDIFF_MAX
&lt;br&gt;&amp;gt; #define PTRDIFF_MAX __PTRDIFF_MAX__
&lt;br&gt;&amp;gt; #undef PTRDIFF_MIN
&lt;br&gt;&amp;gt; #define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #undef SIG_ATOMIC_MAX
&lt;br&gt;&amp;gt; #define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
&lt;br&gt;&amp;gt; #undef SIG_ATOMIC_MIN
&lt;br&gt;&amp;gt; #define SIG_ATOMIC_MIN __SIG_ATOMIC_MIN__
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #undef SIZE_MAX
&lt;br&gt;&amp;gt; #define SIZE_MAX __SIZE_MAX__
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #undef WCHAR_MAX
&lt;br&gt;&amp;gt; #define WCHAR_MAX __WCHAR_MAX__
&lt;br&gt;&amp;gt; #undef WCHAR_MIN
&lt;br&gt;&amp;gt; #define WCHAR_MIN __WCHAR_MIN__
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #undef WINT_MAX
&lt;br&gt;&amp;gt; #define WINT_MAX __WINT_MAX__
&lt;br&gt;&amp;gt; #undef WINT_MIN
&lt;br&gt;&amp;gt; #define WINT_MIN __WINT_MIN__
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #undef INT8_C
&lt;br&gt;&amp;gt; #define INT8_C(c) __INT8_C(c)
&lt;br&gt;&amp;gt; #undef INT16_C
&lt;br&gt;&amp;gt; #define INT16_C(c) __INT16_C(c)
&lt;br&gt;&amp;gt; #undef INT32_C
&lt;br&gt;&amp;gt; #define INT32_C(c) __INT32_C(c)
&lt;br&gt;&amp;gt; #undef INT64_C
&lt;br&gt;&amp;gt; #define INT64_C(c) __INT64_C(c)
&lt;br&gt;&amp;gt; #undef UINT8_C
&lt;br&gt;&amp;gt; #define UINT8_C(c) __UINT8_C(c)
&lt;br&gt;&amp;gt; #undef UINT16_C
&lt;br&gt;&amp;gt; #define UINT16_C(c) __UINT16_C(c)
&lt;br&gt;&amp;gt; #undef UINT32_C
&lt;br&gt;&amp;gt; #define UINT32_C(c) __UINT32_C(c)
&lt;br&gt;&amp;gt; #undef UINT64_C
&lt;br&gt;&amp;gt; #define UINT64_C(c) __UINT64_C(c)
&lt;br&gt;&amp;gt; #undef INTMAX_C
&lt;br&gt;&amp;gt; #define INTMAX_C(c) __INTMAX_C(c)
&lt;br&gt;&amp;gt; #undef UINTMAX_C
&lt;br&gt;&amp;gt; #define UINTMAX_C(c) __UINTMAX_C(c)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #endif /* _GCC_STDINT_H */
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26467394&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/stdint.h-problem-with-gcc-tp26437418p26467394.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26465271</id>
	<title>RE: Float equivalents to double functions</title>
	<published>2009-11-22T05:21:16Z</published>
	<updated>2009-11-22T05:21:16Z</updated>
	<author>
		<name>Weddington, Eric</name>
	</author>
	<content type="html">&amp;nbsp;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26465271&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu.
&lt;br&gt;&amp;gt; org] On Behalf Of Dmitry K.
&lt;br&gt;&amp;gt; Sent: Sunday, November 22, 2009 12:23 AM
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26465271&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Subject: Re: [avr-libc-dev] Float equivalents to double functions
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On Sunday 22 November 2009 12:32, Andrew Hutchinson wrote:
&lt;br&gt;&amp;gt; &amp;gt; Could someone add float variations of common functions to avr libc -
&lt;br&gt;&amp;gt; &amp;gt; this would match gcc expectations for available libc functions.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Good observation.
&lt;br&gt;&amp;gt; If no objections, I will do this.
&lt;/div&gt;&lt;br&gt;No objections with me. Sounds like a good idea.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26465271&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Float-equivalents-to-double-functions-tp26462385p26465271.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26465280</id>
	<title>RE: eeprom_read_byte and clr ret_hi</title>
	<published>2009-11-22T05:20:49Z</published>
	<updated>2009-11-22T05:20:49Z</updated>
	<author>
		<name>Weddington, Eric</name>
	</author>
	<content type="html">&amp;nbsp;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26465280&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev-bounces+eric.weddington=atmel.com@...&lt;/a&gt; 
&lt;br&gt;&amp;gt; [mailto:avr-libc-dev-bounces+eric.weddington=atmel.com@nongnu.
&lt;br&gt;&amp;gt; org] On Behalf Of Dmitry K.
&lt;br&gt;&amp;gt; Sent: Sunday, November 22, 2009 12:21 AM
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26465280&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-libc-dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Subject: Re: [avr-libc-dev] eeprom_read_byte and clr ret_hi
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; eeprom_read_byte returns a uint8_t. Why does it clear r25?
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; eerd_byte.S:
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;clr &amp;nbsp; &amp;nbsp; ret_hi
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Does the AVR ABI require that r25 be zeroed in a function 
&lt;br&gt;&amp;gt; returning a
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; single byte? If not, this instruction could be removed.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is a misty point.
&lt;br&gt;&amp;gt; Look an example:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; unsigned char foo1 (unsigned char *p)
&lt;br&gt;&amp;gt; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; return *p;
&lt;br&gt;&amp;gt; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; extern unsigned char ext2 (void);
&lt;br&gt;&amp;gt; &amp;nbsp; int foo2 (void)
&lt;br&gt;&amp;gt; &amp;nbsp; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; return ext2() + 1;
&lt;br&gt;&amp;gt; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Old Avr-gcc (3.3 - 4.2) are clear R25 in both cases: foo1()
&lt;br&gt;&amp;gt; and foo2(). &amp;nbsp;The new Avr-gcc (4.3.3 and 4.4.2) are not
&lt;br&gt;&amp;gt; clear R25 in foo1().
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Note, the function return value is present only in expression.
&lt;br&gt;&amp;gt; So it is promoted to integer. So it would be better to clear
&lt;br&gt;&amp;gt; R25 in foo1() only (at one place).
&lt;/div&gt;&lt;br&gt;I agree that that is the way it should be.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;gt; Possibly, it is needed to change eeprom_read_byte() definition
&lt;br&gt;&amp;gt; to int return value. This can reduce summary size. Opinions?
&lt;br&gt;&lt;br&gt;This does not make sense to me. Eeprom_read_byte() is supposed to read, and return, a single byte. So why should it return a 16-bit int? In my mind this would just make it more confusing to the end user.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26465280&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/eeprom_read_byte-and-clr-ret_hi-tp26418032p26465280.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26463284</id>
	<title>Re: Float equivalents to double functions</title>
	<published>2009-11-21T23:22:28Z</published>
	<updated>2009-11-21T23:22:28Z</updated>
	<author>
		<name>Dmitry K.</name>
	</author>
	<content type="html">On Sunday 22 November 2009 12:32, Andrew Hutchinson wrote:
&lt;br&gt;&amp;gt; Could someone add float variations of common functions to avr libc -
&lt;br&gt;&amp;gt; this would match gcc expectations for available libc functions.
&lt;br&gt;&lt;br&gt;Good observation.
&lt;br&gt;If no objections, I will do this.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Dmitry.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26463284&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Float-equivalents-to-double-functions-tp26462385p26463284.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26463279</id>
	<title>Re: eeprom_read_byte and clr ret_hi</title>
	<published>2009-11-21T23:21:07Z</published>
	<updated>2009-11-21T23:21:07Z</updated>
	<author>
		<name>Dmitry K.</name>
	</author>
	<content type="html">&amp;gt; &amp;gt; eeprom_read_byte returns a uint8_t. Why does it clear r25?
&lt;br&gt;&amp;gt; &amp;gt; eerd_byte.S:
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;clr &amp;nbsp; &amp;nbsp; ret_hi
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Does the AVR ABI require that r25 be zeroed in a function returning a
&lt;br&gt;&amp;gt; &amp;gt; single byte? If not, this instruction could be removed.
&lt;br&gt;&lt;br&gt;This is a misty point.
&lt;br&gt;Look an example:
&lt;br&gt;&lt;br&gt;&amp;nbsp; unsigned char foo1 (unsigned char *p)
&lt;br&gt;&amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; return *p;
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; extern unsigned char ext2 (void);
&lt;br&gt;&amp;nbsp; int foo2 (void)
&lt;br&gt;&amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; return ext2() + 1;
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;Old Avr-gcc (3.3 - 4.2) are clear R25 in both cases: foo1()
&lt;br&gt;and foo2(). &amp;nbsp;The new Avr-gcc (4.3.3 and 4.4.2) are not
&lt;br&gt;clear R25 in foo1().
&lt;br&gt;&lt;br&gt;Note, the function return value is present only in expression.
&lt;br&gt;So it is promoted to integer. So it would be better to clear
&lt;br&gt;R25 in foo1() only (at one place).
&lt;br&gt;&lt;br&gt;Possibly, it is needed to change eeprom_read_byte() definition
&lt;br&gt;to int return value. This can reduce summary size. Opinions?
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Dmitry.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26463279&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/eeprom_read_byte-and-clr-ret_hi-tp26418032p26463279.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26462385</id>
	<title>Float equivalents to double functions</title>
	<published>2009-11-21T18:32:48Z</published>
	<updated>2009-11-21T18:32:48Z</updated>
	<author>
		<name>Andrew Hutchinson</name>
	</author>
	<content type="html">Could someone add float variations of common functions to avr libc - 
&lt;br&gt;this would match gcc expectations for available libc functions.
&lt;br&gt;&lt;br&gt;As float == double there is little effort required.
&lt;br&gt;&lt;br&gt;Also I note that this and similar functions would &amp;nbsp;avoids this hack on 
&lt;br&gt;TI benchmark, so it has practical use in code compatibility.
&lt;br&gt;&lt;br&gt;#include &amp;lt;math.h&amp;gt;
&lt;br&gt;&lt;br&gt;#ifdef	__AVR__
&lt;br&gt;# define atanf(x) atan(x)
&lt;br&gt;# define cosf(x) &amp;nbsp;cos(x)
&lt;br&gt;# define expf(x) &amp;nbsp;exp(x)
&lt;br&gt;# define logf(x) &amp;nbsp;log(x)
&lt;br&gt;# define sinf(x) &amp;nbsp;sin(x)
&lt;br&gt;# define sqrtf(x) sqrt(x)
&lt;br&gt;#endif
&lt;br&gt;&lt;br&gt;&lt;br&gt;Andy
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26462385&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Float-equivalents-to-double-functions-tp26462385p26462385.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26458648</id>
	<title>New AVR Dragon software (Studio 4.18rc4) won't cooperate</title>
	<published>2009-11-21T09:41:34Z</published>
	<updated>2009-11-21T09:41:34Z</updated>
	<author>
		<name>hcz-2</name>
	</author>
	<content type="html">&lt;br&gt;AVR Studio 4.18 comes with AVR Dragon software which removes the 32k
&lt;br&gt;debugging barrier. So I happily installed AVR Studio 4.18 Release
&lt;br&gt;Candidate 4 from &lt;a href=&quot;http://www.atmel.no/beta_ware/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atmel.no/beta_ware/&lt;/a&gt;&amp;nbsp;on a Windows machine
&lt;br&gt;and updated my 2 Dragons.
&lt;br&gt;&lt;br&gt;The result was: they cooperated neither with avrdude nor with avarice
&lt;br&gt;any more, reporting wrong device IDs (avarice: 0xffff for both
&lt;br&gt;ATmega32 and ATmega644, avrdude: 0x70febb instead of 0x139307 for an
&lt;br&gt;ATmega8). I had to reinstall an older version of AVR Studio and
&lt;br&gt;downgrade the Dragons using it to get them into a usable state again.
&lt;br&gt;&lt;br&gt;Did anybody encounter the same issue? Or is an updated version of
&lt;br&gt;these tools available or planned?
&lt;br&gt;&lt;br&gt;&lt;br&gt;Heike
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-chat mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26458648&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-chat@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-chat&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-chat&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---General-f2011.html&quot; embed=&quot;fixTarget[2011]&quot; target=&quot;_top&quot; &gt;AVR - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/New-AVR-Dragon-software-%28Studio-4.18rc4%29-won%27t-cooperate-tp26458648p26458648.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26457803</id>
	<title>[bug #28066] dragon_jtag and atxmega128A1 fails chip erase</title>
	<published>2009-11-21T07:54:51Z</published>
	<updated>2009-11-21T07:54:51Z</updated>
	<author>
		<name>Sylvain Beucler-4</name>
	</author>
	<content type="html">&lt;br&gt;Follow-up Comment #1, bug #28066 (project avrdude):
&lt;br&gt;&lt;br&gt;Some more data
&lt;br&gt;&lt;br&gt;Added usb messages sniffed from AVR Studio 4.18 (b684) pressing the &amp;quot;erase
&lt;br&gt;device&amp;quot; button; grouped by sequence numbers.
&lt;br&gt;&lt;br&gt;It seems to be an undocumented command, 0x34 (sequence number 0x17 in the usb
&lt;br&gt;dump).
&lt;br&gt;&lt;br&gt;(file #19100)
&lt;br&gt;&amp;nbsp; &amp;nbsp; _______________________________________________________
&lt;br&gt;&lt;br&gt;Additional Item Attachment:
&lt;br&gt;&lt;br&gt;File name: usb-dump-avrstudio.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Size:0 KB
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; _______________________________________________________
&lt;br&gt;&lt;br&gt;Reply to this item at:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;lt;&lt;a href=&quot;http://savannah.nongnu.org/bugs/?28066&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://savannah.nongnu.org/bugs/?28066&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;&amp;nbsp; Message sent via/by Savannah
&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://savannah.nongnu.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://savannah.nongnu.org/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;avrdude-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26457803&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avrdude-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---AVRdude---Dev-f2009.html&quot; embed=&quot;fixTarget[2009]&quot; target=&quot;_top&quot; &gt;AVR - AVRdude - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-bug--28066--dragon_jtag-and-atxmega128A1-fails-chip-erase-tp26451841p26457803.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26451841</id>
	<title>[bug #28066] dragon_jtag and atxmega128A1 fails chip erase</title>
	<published>2009-11-20T15:19:43Z</published>
	<updated>2009-11-20T15:19:43Z</updated>
	<author>
		<name>Sylvain Beucler-4</name>
	</author>
	<content type="html">&lt;br&gt;URL:
&lt;br&gt;&amp;nbsp; &amp;lt;&lt;a href=&quot;http://savannah.nongnu.org/bugs/?28066&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://savannah.nongnu.org/bugs/?28066&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Summary: dragon_jtag and atxmega128A1 fails chip erase
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Project: AVR Downloader/UploaDEr
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Submitted by: None
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Submitted on: Fri 20 Nov 2009 11:19:41 PM UTC
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Category: None
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Severity: 3 - Normal
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: 5 - Normal
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Item Group: None
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status: None
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Privacy: Public
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Assigned to: None
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Originator Name: Andreas
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Originator Email: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26451841&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alohre@...&lt;/a&gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Open/Closed: Open
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Discussion Lock: Any
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; _______________________________________________________
&lt;br&gt;&lt;br&gt;Details:
&lt;br&gt;&lt;br&gt;Programmer: dragon_jtag
&lt;br&gt;Part: ATXMEGA128A1
&lt;br&gt;avrdude svnrev: 879
&lt;br&gt;&lt;br&gt;commandline: avrdude -vvvvvv -c dragon_jtag -p x128a1 -P usb -e 2&amp;gt;
&lt;br&gt;full-output.log
&lt;br&gt;&lt;br&gt;error message:
&lt;br&gt;jtagmkII_chip_erase(): bad response to chip erase command:
&lt;br&gt;RSP_ILLEGAL_COMMAND
&lt;br&gt;For full output see attached logfile.
&lt;br&gt;&lt;br&gt;The dragon is running latest firmware, upgraded in AVR Studio 4.18 (b684) the
&lt;br&gt;firmwareversion reported in the sign-on message is 6.04
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; _______________________________________________________
&lt;br&gt;&lt;br&gt;File Attachments:
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------
&lt;br&gt;Date: Fri 20 Nov 2009 11:19:42 PM UTC &amp;nbsp;Name: full-output.log &amp;nbsp;Size: 30kB &amp;nbsp;
&lt;br&gt;By: None
&lt;br&gt;&lt;br&gt;&amp;lt;&lt;a href=&quot;http://savannah.nongnu.org/bugs/download.php?file_id=19096&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://savannah.nongnu.org/bugs/download.php?file_id=19096&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; _______________________________________________________
&lt;br&gt;&lt;br&gt;Reply to this item at:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;lt;&lt;a href=&quot;http://savannah.nongnu.org/bugs/?28066&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://savannah.nongnu.org/bugs/?28066&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;&amp;nbsp; Message sent via/by Savannah
&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://savannah.nongnu.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://savannah.nongnu.org/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;avrdude-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26451841&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avrdude-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---AVRdude---Dev-f2009.html&quot; embed=&quot;fixTarget[2009]&quot; target=&quot;_top&quot; &gt;AVR - AVRdude - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-bug--28066--dragon_jtag-and-atxmega128A1-fails-chip-erase-tp26451841p26451841.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26451482</id>
	<title>Re: dragon_jtag and atxmega128A1 fails on chip erase</title>
	<published>2009-11-20T14:48:03Z</published>
	<updated>2009-11-20T14:48:03Z</updated>
	<author>
		<name>Joerg Wunsch</name>
	</author>
	<content type="html">As Andreas Løhre wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; When trying to erase and program the ATXMEGA128A1 with latest svn
&lt;br&gt;&amp;gt; (rev. 879) using dragon_jtag:
&lt;br&gt;&lt;br&gt;I haven't been able to test a Dragon firmware that supports the Xmega.
&lt;br&gt;Quite possible there are still bugs with that.
&lt;br&gt;&lt;br&gt;Please file a bug tracker for this.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;cheers, J&amp;quot;org &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .-.-. &amp;nbsp; --... ...-- &amp;nbsp; -.. . &amp;nbsp;DL8DTL
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.sax.de/~joerg/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sax.de/~joerg/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NIC: JW11-RIPE
&lt;br&gt;Never trust an operating system you don't have sources for. ;-)
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;avrdude-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26451482&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avrdude-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---AVRdude---Dev-f2009.html&quot; embed=&quot;fixTarget[2009]&quot; target=&quot;_top&quot; &gt;AVR - AVRdude - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/dragon_jtag-and-atxmega128A1-fails-on-chip-erase-tp26450872p26451482.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26451467</id>
	<title>Re: Re: jtagmkII_close(): bad response to GO command: RSP_ILLEGAL_EMULATOR_MODE</title>
	<published>2009-11-20T14:47:09Z</published>
	<updated>2009-11-20T14:47:09Z</updated>
	<author>
		<name>Joerg Wunsch</name>
	</author>
	<content type="html">As Shaun Jackman wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; My target is the AT90PWM316, which supports ISP and DebugWire, but
&lt;br&gt;&amp;gt; not JTAG. I believe I'm operating in ISP mode and not DebugWire
&lt;br&gt;&amp;gt; mode. &amp;nbsp;Shouldn't this command be supported in this configuration?
&lt;br&gt;&lt;br&gt;No, ISP mode doesn't know a &amp;quot;GO&amp;quot; command, because it is not a
&lt;br&gt;debugging mode. &amp;nbsp;It asserts /RESET all the time anyway, and as soon as
&lt;br&gt;you leave ISP mode, the target is supposed to start, as /RESET is
&lt;br&gt;being deasserted.
&lt;br&gt;&lt;br&gt;In contrast, the debugging modi (JTAG or debugWIRE) can arbitrarily
&lt;br&gt;stop and resume CPU operation; the latter is what CMND_GO is intended
&lt;br&gt;for.
&lt;br&gt;&lt;br&gt;The attempt to send a CMND_GO command even in ISP mode is a benign bug
&lt;br&gt;that slipped in somehow in one of the recent releases.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;cheers, J&amp;quot;org &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .-.-. &amp;nbsp; --... ...-- &amp;nbsp; -.. . &amp;nbsp;DL8DTL
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.sax.de/~joerg/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sax.de/~joerg/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NIC: JW11-RIPE
&lt;br&gt;Never trust an operating system you don't have sources for. ;-)
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;avrdude-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26451467&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avrdude-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---AVRdude---Dev-f2009.html&quot; embed=&quot;fixTarget[2009]&quot; target=&quot;_top&quot; &gt;AVR - AVRdude - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/jtagmkII_close%28%29%3A-bad-response-to-GO-command%3A-RSP_ILLEGAL_EMULATOR_MODE-tp26395240p26451467.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26450934</id>
	<title>Internal oscillator calibration</title>
	<published>2009-11-20T13:56:58Z</published>
	<updated>2009-11-20T13:56:58Z</updated>
	<author>
		<name>Shaun Jackman</name>
	</author>
	<content type="html">I'm attempting to use the AVR JTAG ICE mkII to calibrate the internal
&lt;br&gt;8 MHz oscillator of the AT90PWM316. I downloaded the source code that
&lt;br&gt;runs on the target device from application note AVR0053 and compiled
&lt;br&gt;it using the open source assembler avra. I flashed the target device
&lt;br&gt;using avrdude and set its fuses to use the internal 8 MHz RC
&lt;br&gt;oscillator (lfuse=0xa2). I then ran avrdude -O to start the
&lt;br&gt;calibration, which is intended to store the result in EEPROM. However,
&lt;br&gt;afterwards the EEPROM is still empty.
&lt;br&gt;&lt;br&gt;Has anyone successfully used the OSCCAL calibration routine specified
&lt;br&gt;in AVR053 with avrdude?
&lt;br&gt;&lt;br&gt;The man page should mention that the target device requires special
&lt;br&gt;firmware to be able to use the OSCCAL feature. The man page makes it
&lt;br&gt;sound as though the programmer does it all automagically with no help
&lt;br&gt;from the target.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Shaun
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;avrdude-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26450934&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avrdude-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---AVRdude---Dev-f2009.html&quot; embed=&quot;fixTarget[2009]&quot; target=&quot;_top&quot; &gt;AVR - AVRdude - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Internal-oscillator-calibration-tp26450934p26450934.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26450872</id>
	<title>dragon_jtag and atxmega128A1 fails on chip erase</title>
	<published>2009-11-20T13:52:32Z</published>
	<updated>2009-11-20T13:52:32Z</updated>
	<author>
		<name>Andreas Løhre</name>
	</author>
	<content type="html">Hello
&lt;br&gt;&lt;br&gt;When trying to erase and program the ATXMEGA128A1 with latest svn
&lt;br&gt;(rev. 879) using dragon_jtag:
&lt;br&gt;avrdude -vvvvv -c dragon_jtag -p x128a1 -P usb -e -U flash:w:testing.hex
&lt;br&gt;it errs out with the error below.
&lt;br&gt;&lt;br&gt;There is no problem programming the part without the erase option.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;avrdude: erasing chip
&lt;br&gt;avrdude: jtagmkII_chip_erase(): Sending chip erase command:
&lt;br&gt;avrdude: jtagmkII_send(): sending 1 bytes
&lt;br&gt;avrdude: Sent: . [1b] . [16] . [00] . [01] . [00] . [00] . [00] . [0e]
&lt;br&gt;. [13] . [a9] . [e2]
&lt;br&gt;avrdude: jtagmkII_recv():
&lt;br&gt;avrdude: Recv: . [1b]
&lt;br&gt;avrdude: Recv: . [16]
&lt;br&gt;avrdude: Recv: . [00]
&lt;br&gt;avrdude: Recv: . [01]
&lt;br&gt;avrdude: Recv: . [00]
&lt;br&gt;avrdude: Recv: . [00]
&lt;br&gt;avrdude: Recv: . [00]
&lt;br&gt;avrdude: Recv: . [0e]
&lt;br&gt;avrdude: Recv: . [aa]
&lt;br&gt;avrdude: Recv: . [e3]
&lt;br&gt;avrdude: Recv: . [ca]
&lt;br&gt;&lt;br&gt;avrdude: jtagmkII_recv(): Got message seqno 22 (command_sequence == 22)
&lt;br&gt;&lt;br&gt;Raw message:
&lt;br&gt;0xaa
&lt;br&gt;Illegal command
&lt;br&gt;&lt;br&gt;avrdude: jtagmkII_chip_erase(): bad response to chip erase command:
&lt;br&gt;RSP_ILLEGAL_COMMAND
&lt;br&gt;avrdude: jtagmkII_program_disable(): Sending leave progmode command:
&lt;br&gt;avrdude: jtagmkII_send(): sending 1 bytes
&lt;br&gt;avrdude: Sent: . [1b] . [17] . [00] . [01] . [00] . [00] . [00] . [0e]
&lt;br&gt;. [15] &amp;nbsp; [20] . [06]
&lt;br&gt;avrdude: jtagmkII_recv():
&lt;br&gt;avrdude: Recv: . [1b]
&lt;br&gt;avrdude: Recv: . [17]
&lt;br&gt;avrdude: Recv: . [00]
&lt;br&gt;avrdude: Recv: . [01]
&lt;br&gt;avrdude: Recv: . [00]
&lt;br&gt;avrdude: Recv: . [00]
&lt;br&gt;avrdude: Recv: . [00]
&lt;br&gt;avrdude: Recv: . [0e]
&lt;br&gt;avrdude: Recv: . [80]
&lt;br&gt;avrdude: Recv: . [04]
&lt;br&gt;avrdude: Recv: . [c5]
&lt;br&gt;&lt;br&gt;avrdude: jtagmkII_recv(): Got message seqno 23 (command_sequence == 23)
&lt;br&gt;&lt;br&gt;Raw message:
&lt;br&gt;0x80
&lt;br&gt;OK
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Dragon info:
&lt;br&gt;&lt;br&gt;JTAG clock &amp;nbsp; &amp;nbsp; &amp;nbsp;: 891.7 kHz (1.1 us)
&lt;br&gt;JTAG ICE mkII sign-on message:
&lt;br&gt;Communications protocol version: 1
&lt;br&gt;M_MCU:
&lt;br&gt;&amp;nbsp; boot-loader FW version: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;255
&lt;br&gt;&amp;nbsp; firmware version: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6.04
&lt;br&gt;&amp;nbsp; hardware version: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1
&lt;br&gt;S_MCU:
&lt;br&gt;&amp;nbsp; boot-loader FW version: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;255
&lt;br&gt;&amp;nbsp; firmware version: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6.04
&lt;br&gt;&amp;nbsp; hardware version: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7
&lt;br&gt;Serial number: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 00:a2:00:00:77:21
&lt;br&gt;Device ID: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AVRDRAGON
&lt;br&gt;&lt;br&gt;&lt;br&gt;.Andreas
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;avrdude-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26450872&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avrdude-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---AVRdude---Dev-f2009.html&quot; embed=&quot;fixTarget[2009]&quot; target=&quot;_top&quot; &gt;AVR - AVRdude - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/dragon_jtag-and-atxmega128A1-fails-on-chip-erase-tp26450872p26450872.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26450815</id>
	<title>Re: jtagmkII_close(): bad response to GO command:  RSP_ILLEGAL_EMULATOR_MODE</title>
	<published>2009-11-20T13:47:45Z</published>
	<updated>2009-11-20T13:47:45Z</updated>
	<author>
		<name>Shaun Jackman</name>
	</author>
	<content type="html">2009/11/17 Shaun Jackman &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26450815&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sjackman@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt; I am using a Atmel JTAG ICE mkII with a AT90PWM316. Whenever avrdude
&lt;br&gt;&amp;gt; exits, it prints the following error message:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; avrdude: jtagmkII_close(): bad response to GO command:
&lt;br&gt;&lt;br&gt;RSP_ILLEGAL_EMULATOR_MODE
&lt;br&gt;The application note AVR067 says that
&lt;br&gt;&lt;br&gt;CMND_GO
&lt;br&gt;RSP_ILLEGAL_EMULATOR_MODE
&lt;br&gt;The operation cannot be performed in this emulator mode. (JTAG / DebugWire).
&lt;br&gt;&lt;br&gt;My target is the AT90PWM316, which supports ISP and DebugWire, but not
&lt;br&gt;JTAG. I believe I'm operating in ISP mode and not DebugWire mode.
&lt;br&gt;Shouldn't this command be supported in this configuration?
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Shaun
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;avrdude-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26450815&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avrdude-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avrdude-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---AVRdude---Dev-f2009.html&quot; embed=&quot;fixTarget[2009]&quot; target=&quot;_top&quot; &gt;AVR - AVRdude - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/jtagmkII_close%28%29%3A-bad-response-to-GO-command%3A-RSP_ILLEGAL_EMULATOR_MODE-tp26395240p26450815.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26444816</id>
	<title>RE: How to move VTABLE to FLASH?</title>
	<published>2009-11-20T07:02:49Z</published>
	<updated>2009-11-20T07:02:49Z</updated>
	<author>
		<name>Stu Bell</name>
	</author>
	<content type="html">&amp;gt; As you know when programming in C++ on AVR the gcc puts the 
&lt;br&gt;&amp;gt; class VTABLE in SRAM, that is ok, but wastes precious space. 
&lt;br&gt;&amp;gt; VTABLE is generated during compilation and is constant during 
&lt;br&gt;&amp;gt; program execution, so I think it is better to put it into 
&lt;br&gt;&amp;gt; FLASH memory. Of course to do that I need to patch gcc, and 
&lt;br&gt;&amp;gt; here is my problem. I'm just beginner and making such 
&lt;br&gt;&amp;gt; modifications in gcc is just beyond my skills. So maybe 
&lt;br&gt;&amp;gt; someone can do that, or give me some clues how to start? I 
&lt;br&gt;&amp;gt; know that I need to change some insns, but how to start?
&lt;br&gt;&lt;br&gt;After you've read the tutorial on C++ and GCC:
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;t=59453&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;t=59453&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;check out the huge list of links for newbies:
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;t=70673&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;t=70673&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Best regards, 
&lt;br&gt;&lt;br&gt;Stu Bell 
&lt;br&gt;DataPlay (DPHI, Inc.) 
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-GCC-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26444816&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-GCC-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---gcc-f2010.html&quot; embed=&quot;fixTarget[2010]&quot; target=&quot;_top&quot; &gt;AVR - gcc&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/How-to-move-VTABLE-to-FLASH--tp26444373p26444816.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26441420</id>
	<title>Re: assembly-c mix and interrupts</title>
	<published>2009-11-20T02:47:45Z</published>
	<updated>2009-11-20T02:47:45Z</updated>
	<author>
		<name>David Brown-4</name>
	</author>
	<content type="html">Julius Luukko wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; (note to the list: Alexander replied me off-list but I am replying to the list 
&lt;br&gt;&amp;gt; also)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On Thursday 19 November 2009, you wrote:
&lt;br&gt;&amp;gt;&amp;gt; Thanks for your reply,
&lt;br&gt;&amp;gt;&amp;gt; I understand that it is VERY important to store/restore the SREG in an
&lt;br&gt;&amp;gt;&amp;gt; interrupt function. Can you please confirm for me that the ISR() c macro
&lt;br&gt;&amp;gt;&amp;gt; does this for me and also, does your advice extend to functions outside the
&lt;br&gt;&amp;gt;&amp;gt; interrupt routine? I have found reference material stating which registers
&lt;br&gt;&amp;gt;&amp;gt; should be stored, but none of them mention the SREG in any way.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;The register set is divided into &amp;quot;volatile&amp;quot; or &amp;quot;call-used&amp;quot; registers, 
&lt;br&gt;&amp;quot;non-volatile&amp;quot; or &amp;quot;call-saved&amp;quot; registers, and fixed-function registers. 
&lt;br&gt;&amp;nbsp; This division is chosen by avr-gcc - it is not hardware dependent. 
&lt;br&gt;When working with assembly, you can make up your own rules, but this is 
&lt;br&gt;how things interact with C code.
&lt;br&gt;&lt;br&gt;When the compiler is generated code for a function, it can assume that 
&lt;br&gt;it can do as it likes for the call-used registers, but if it uses the 
&lt;br&gt;call-saved registers it must preserve them at the entry to the function, 
&lt;br&gt;and restore them on exit. &amp;nbsp;Similarly, it can assume that whenever it 
&lt;br&gt;calls another function, the call-used registers will be trashed but the 
&lt;br&gt;call-saved registers will be preserved.
&lt;br&gt;&lt;br&gt;R0 is used as a temporary register - individual instruction sequences 
&lt;br&gt;will use it freely. &amp;nbsp;R1 is assumed to be always 0, although some code 
&lt;br&gt;sequences will use it temporarily (and restore it to 0 afterwards). &amp;nbsp;The 
&lt;br&gt;SREG is considered a &amp;quot;call-used&amp;quot; register.
&lt;br&gt;&lt;br&gt;So any function generated by the compiler, or compatible functions 
&lt;br&gt;written in assembly by hand, can freely use the call-used registers 
&lt;br&gt;(SREG, r18-r27, r30-r31) without preserving or restoring them. &amp;nbsp;But if 
&lt;br&gt;it wants to use the call-saved registers (r2-r17, r28-r29), it must save 
&lt;br&gt;them on entry and restore them on exit.
&lt;br&gt;&lt;br&gt;An interrupt routine must also preserve any call-used registers it 
&lt;br&gt;needs, including SREG and r0. &amp;nbsp;It must also preserve the current r1 and 
&lt;br&gt;set it to 0 before certain compiler-generated code is executed. &amp;nbsp;If the 
&lt;br&gt;interrupt routine is going to call other functions, it must preserve 
&lt;br&gt;/all/ the call-used registers, since the other functions may trash them. 
&lt;br&gt;&amp;nbsp; On the other hand, it does not need to preserve any of the call-saved 
&lt;br&gt;registers, as the called function will preserve these as needed.
&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I can't provide you with a reference but AFAIK this is done on the gcc level 
&lt;br&gt;&amp;gt; (which I know nothing about). The actual definition in the avr-libc source 
&lt;br&gt;&amp;gt; does not show it:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://cvs.savannah.gnu.org/viewvc/avr-libc/include/avr/interrupt.h?revision=1.25.2.1&amp;root=avr-libc&amp;view=markup&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://cvs.savannah.gnu.org/viewvc/avr-libc/include/avr/interrupt.h?revision=1.25.2.1&amp;root=avr-libc&amp;view=markup&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;(Always put links inside &amp;lt; and &amp;gt; brackets - that way email programs 
&lt;br&gt;won't mangle them by splitting the line.)
&lt;br&gt;&lt;br&gt;&amp;gt; Anyway, SREG should always be stored to the stack when using the ISR() macro. 
&lt;br&gt;&amp;gt; Maybe someone can provide with a reference to prove this.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;It is, as you say, done at the gcc level. &amp;nbsp;The provided ISR macros are 
&lt;br&gt;wrappers that give the function the &amp;quot;signal&amp;quot; attribute, which causes gcc 
&lt;br&gt;to preserve SREG and all the volatile call-used registers (if they are 
&lt;br&gt;used), and to use the &amp;quot;rti&amp;quot; instruction at the end.
&lt;br&gt;&lt;br&gt;The compiler gets this stuff right (if it didn't, someone would have 
&lt;br&gt;noticed before now!) - it is much easier to rely on the compiler to 
&lt;br&gt;generate correct code here from an ISR written in C, than to try and 
&lt;br&gt;write it by hand in assembly.
&lt;br&gt;&lt;br&gt;mvh.,
&lt;br&gt;&lt;br&gt;David
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; An excerpt from a C generated ISR () shows an example (I don't remember which 
&lt;br&gt;&amp;gt; version of gcc or avr-libc was used, this was just easily found):
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 00000108 &amp;lt;__vector_18&amp;gt;:
&lt;br&gt;&amp;gt; &amp;nbsp;108: &amp;nbsp; 1f 92 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r1
&lt;br&gt;&amp;gt; &amp;nbsp;10a: &amp;nbsp; 0f 92 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r0
&lt;br&gt;&amp;gt; &amp;nbsp;10c: &amp;nbsp; 0f b6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in &amp;nbsp; &amp;nbsp; &amp;nbsp;r0, 0x3f &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; 63
&lt;br&gt;&amp;gt; &amp;nbsp;10e: &amp;nbsp; 0f 92 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r0
&lt;br&gt;&amp;gt; &amp;nbsp;110: &amp;nbsp; 11 24 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eor &amp;nbsp; &amp;nbsp; r1, r1
&lt;br&gt;&amp;gt; &amp;nbsp;112: &amp;nbsp; 8f 93 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r24
&lt;br&gt;&amp;gt; &amp;nbsp;114: &amp;nbsp; 9f 93 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r25
&lt;br&gt;&amp;gt; &amp;nbsp;116: &amp;nbsp; ef 93 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r30
&lt;br&gt;&amp;gt; &amp;nbsp;118: &amp;nbsp; ff 93 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r31
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; SREG is memory mapped to 0x3f. As you can see, you can't push SREG directly, 
&lt;br&gt;&amp;gt; you must use a register for that and therefore you must push the register 
&lt;br&gt;&amp;gt; first.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; One thing to note also in the excerpt is the clearing of r1 (eor r1, r1). If 
&lt;br&gt;&amp;gt; you intend to call C functions from your assembly ISR, you must do this also. 
&lt;br&gt;&amp;gt; This might provide you with some more information
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nongnu.org/avr-libc/user-manual/inline_asm.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.nongnu.org/avr-libc/user-manual/inline_asm.html&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Julius
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26441420&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Julius.Luukko@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26441420&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-gcc-list@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Subject: Re: [avr-gcc-list] assembly-c mix and interrupts
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Date: Thu, 19 Nov 2009 15:34:16 +0200
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; CC: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26441420&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;zhpctw3dash@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; On Thursday 19 November 2009, darkschine wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Before I continue, I would like to suggest a resolution to my problem.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I am using the ATmega328P
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; My assembly code follows a standard that ALL registers used are pushed
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and popped from the stack. However, my assembly code does NOT store the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; SREG. Could this be causing my problems?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; You can do next to nothing without modifying the SREG. Why don't you add
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; pushing the SREG also to the stack. I wouldn't dare to not to save it.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; --
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Julius
&lt;br&gt;&amp;gt;&amp;gt; _________________________________________________________________
&lt;br&gt;&amp;gt;&amp;gt; Looking for a date? View photos of singles in your area!
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://clk.atdmt.com/NMN/go/150855801/direct/01/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clk.atdmt.com/NMN/go/150855801/direct/01/&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-GCC-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26441420&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-GCC-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---gcc-f2010.html&quot; embed=&quot;fixTarget[2010]&quot; target=&quot;_top&quot; &gt;AVR - gcc&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/assembly-c-mix-and-interrupts-tp26421328p26441420.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26441192</id>
	<title>[bug #28058] parameter checking in pgm_read_xxx()</title>
	<published>2009-11-20T02:32:07Z</published>
	<updated>2009-11-20T02:32:07Z</updated>
	<author>
		<name>Sylvain Beucler-4</name>
	</author>
	<content type="html">&lt;br&gt;URL:
&lt;br&gt;&amp;nbsp; &amp;lt;&lt;a href=&quot;http://savannah.nongnu.org/bugs/?28058&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://savannah.nongnu.org/bugs/?28058&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Summary: parameter checking in pgm_read_xxx()
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Project: AVR C Runtime Library
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Submitted by: wek
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Submitted on: Fri 20 Nov 2009 10:32:06 AM GMT
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Category: Feature Request
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Severity: 3 - Normal
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: 5 - Normal
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Item Group: Header files
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status: None
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Percent Complete: 0%
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Assigned to: None
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Open/Closed: Open
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Discussion Lock: Any
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Release: Any
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Fixed Release: None
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; _______________________________________________________
&lt;br&gt;&lt;br&gt;Details:
&lt;br&gt;&lt;br&gt;The pgm_read_xxx() functions in &amp;lt;avr/pgmspace.h&amp;gt; are currently implemented as
&lt;br&gt;macros, casting the parameter to (uint16_t). 
&lt;br&gt;&lt;br&gt;While the parameter is supposed to be a pointer, this enables to use any
&lt;br&gt;garbage (read: non-pointer expression used by error) quietly.
&lt;br&gt;&lt;br&gt;Opposed to this are the similar accessing functions in eeprom.h. 
&lt;br&gt;&lt;br&gt;It is therefore suggested, that these macros to be replaced by the following
&lt;br&gt;constructions:
&lt;br&gt;&lt;br&gt;// #define pgm_read_byte(address_short) &amp;nbsp; &amp;nbsp;pgm_read_byte_near(address_short)
&lt;br&gt;__attribute__((__always_inline__)) static uint8_t pgm_read_byte(const PROGMEM
&lt;br&gt;uint8_t *);
&lt;br&gt;static uint8_t pgm_read_byte(const PROGMEM uint8_t *addr) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; return __LPM((uint16_t)(addr));
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;&lt;br&gt;// #define pgm_read_word(address_short) &amp;nbsp; &amp;nbsp;pgm_read_word_near(address_short)
&lt;br&gt;__attribute__((__always_inline__)) static uint16_t pgm_read_word(const
&lt;br&gt;PROGMEM uint16_t *);
&lt;br&gt;static uint16_t pgm_read_word(const PROGMEM uint16_t *addr) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; return __LPM_word((uint16_t)(addr));
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;&lt;br&gt;// #define pgm_read_dword(address_short) &amp;nbsp;
&lt;br&gt;pgm_read_dword_near(address_short)
&lt;br&gt;__attribute__((__always_inline__)) static uint32_t pgm_read_dword(const
&lt;br&gt;PROGMEM uint32_t *);
&lt;br&gt;static uint32_t pgm_read_dword(const PROGMEM uint32_t *addr) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; return __LPM_dword((uint16_t)(addr));
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;I am not expert enough to judge whether the functions may be tagged also with
&lt;br&gt;the __pure__ attribute.
&lt;br&gt;&lt;br&gt;A discussion on the topic is on
&lt;br&gt;&lt;a href=&quot;http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;t=85490&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;t=85490&lt;/a&gt;&amp;nbsp;.
&lt;br&gt;&lt;br&gt;Jan Waclawek
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; _______________________________________________________
&lt;br&gt;&lt;br&gt;Reply to this item at:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;lt;&lt;a href=&quot;http://savannah.nongnu.org/bugs/?28058&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://savannah.nongnu.org/bugs/?28058&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;&amp;nbsp; Message sent via/by Savannah
&lt;br&gt;&amp;nbsp; &lt;a href=&quot;http://savannah.nongnu.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://savannah.nongnu.org/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26441192&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-bug--28058--parameter-checking-in-pgm_read_xxx%28%29-tp26441192p26441192.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26440659</id>
	<title>Re: assembly-c mix and interrupts</title>
	<published>2009-11-20T01:41:58Z</published>
	<updated>2009-11-20T01:41:58Z</updated>
	<author>
		<name>Julius Luukko</name>
	</author>
	<content type="html">(note to the list: Alexander replied me off-list but I am replying to the list 
&lt;br&gt;also)
&lt;br&gt;&lt;br&gt;On Thursday 19 November 2009, you wrote:
&lt;br&gt;&amp;gt; Thanks for your reply,
&lt;br&gt;&amp;gt; I understand that it is VERY important to store/restore the SREG in an
&lt;br&gt;&amp;gt; interrupt function. Can you please confirm for me that the ISR() c macro
&lt;br&gt;&amp;gt; does this for me and also, does your advice extend to functions outside the
&lt;br&gt;&amp;gt; interrupt routine? I have found reference material stating which registers
&lt;br&gt;&amp;gt; should be stored, but none of them mention the SREG in any way.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;I can't provide you with a reference but AFAIK this is done on the gcc level 
&lt;br&gt;(which I know nothing about). The actual definition in the avr-libc source 
&lt;br&gt;does not show it:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://cvs.savannah.gnu.org/viewvc/avr-&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://cvs.savannah.gnu.org/viewvc/avr-&lt;/a&gt;&lt;br&gt;libc/include/avr/interrupt.h?revision=1.25.2.1&amp;root=avr-libc&amp;view=markup
&lt;br&gt;&lt;br&gt;Anyway, SREG should always be stored to the stack when using the ISR() macro. 
&lt;br&gt;Maybe someone can provide with a reference to prove this.
&lt;br&gt;&lt;br&gt;An excerpt from a C generated ISR () shows an example (I don't remember which 
&lt;br&gt;version of gcc or avr-libc was used, this was just easily found):
&lt;br&gt;&lt;br&gt;00000108 &amp;lt;__vector_18&amp;gt;:
&lt;br&gt;&amp;nbsp;108: &amp;nbsp; 1f 92 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r1
&lt;br&gt;&amp;nbsp;10a: &amp;nbsp; 0f 92 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r0
&lt;br&gt;&amp;nbsp;10c: &amp;nbsp; 0f b6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in &amp;nbsp; &amp;nbsp; &amp;nbsp;r0, 0x3f &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; 63
&lt;br&gt;&amp;nbsp;10e: &amp;nbsp; 0f 92 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r0
&lt;br&gt;&amp;nbsp;110: &amp;nbsp; 11 24 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eor &amp;nbsp; &amp;nbsp; r1, r1
&lt;br&gt;&amp;nbsp;112: &amp;nbsp; 8f 93 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r24
&lt;br&gt;&amp;nbsp;114: &amp;nbsp; 9f 93 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r25
&lt;br&gt;&amp;nbsp;116: &amp;nbsp; ef 93 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r30
&lt;br&gt;&amp;nbsp;118: &amp;nbsp; ff 93 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push &amp;nbsp; &amp;nbsp;r31
&lt;br&gt;&lt;br&gt;SREG is memory mapped to 0x3f. As you can see, you can't push SREG directly, 
&lt;br&gt;you must use a register for that and therefore you must push the register 
&lt;br&gt;first.
&lt;br&gt;&lt;br&gt;One thing to note also in the excerpt is the clearing of r1 (eor r1, r1). If 
&lt;br&gt;you intend to call C functions from your assembly ISR, you must do this also. 
&lt;br&gt;This might provide you with some more information
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.nongnu.org/avr-libc/user-manual/inline_asm.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.nongnu.org/avr-libc/user-manual/inline_asm.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;Julius
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26440659&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Julius.Luukko@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26440659&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avr-gcc-list@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;gt; Subject: Re: [avr-gcc-list] assembly-c mix and interrupts
&lt;br&gt;&amp;gt; &amp;gt; Date: Thu, 19 Nov 2009 15:34:16 +0200
&lt;br&gt;&amp;gt; &amp;gt; CC: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26440659&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;zhpctw3dash@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; On Thursday 19 November 2009, darkschine wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Before I continue, I would like to suggest a resolution to my problem.
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; I am using the ATmega328P
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; My assembly code follows a standard that ALL registers used are pushed
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; and popped from the stack. However, my assembly code does NOT store the
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; SREG. Could this be causing my problems?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; You can do next to nothing without modifying the SREG. Why don't you add
&lt;br&gt;&amp;gt; &amp;gt; pushing the SREG also to the stack. I wouldn't dare to not to save it.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; --
&lt;br&gt;&amp;gt; &amp;gt; Julius
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _________________________________________________________________
&lt;br&gt;&amp;gt; Looking for a date? View photos of singles in your area!
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://clk.atdmt.com/NMN/go/150855801/direct/01/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clk.atdmt.com/NMN/go/150855801/direct/01/&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;D.Sc. Julius Luukko
&lt;br&gt;Laboratory of Control Engineering and Digital Systems
&lt;br&gt;Lappeenranta University of Technology, FINLAND
&lt;br&gt;phone:+358-5-621 6713, fax:+358-5-621 6799, www: &lt;a href=&quot;http://www.ee.lut.fi&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ee.lut.fi&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-GCC-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26440659&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-GCC-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---gcc-f2010.html&quot; embed=&quot;fixTarget[2010]&quot; target=&quot;_top&quot; &gt;AVR - gcc&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/assembly-c-mix-and-interrupts-tp26421328p26440659.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26439509</id>
	<title>Re: assembly-c mix and interrupts</title>
	<published>2009-11-19T23:41:26Z</published>
	<updated>2009-11-19T23:41:26Z</updated>
	<author>
		<name>Erik Christiansen-2</name>
	</author>
	<content type="html">On Thu, Nov 19, 2009 at 05:08:45AM -0800, darkschine wrote:
&lt;br&gt;&amp;gt; My assembly code follows a standard that ALL registers used are pushed and
&lt;br&gt;&amp;gt; popped from the stack. However, my assembly code does NOT store the SREG.
&lt;br&gt;&amp;gt; Could this be causing my problems?
&lt;br&gt;&lt;br&gt;If it is in the interrupt routine that cpu status is not preserved, then
&lt;br&gt;it must be obvious that execution of any interrupted code with a
&lt;br&gt;condition test at the return point will at times be corrupted. And that
&lt;br&gt;can of course be anywhere in the code.
&lt;br&gt;&lt;br&gt;If the assembler code is only reached by call and return, then I expect
&lt;br&gt;your problem lies elsewhere, unless you're modifying r1, and not leaving
&lt;br&gt;it cleared on return.
&lt;br&gt;&lt;br&gt;Also, there is limited merit in preserving any register that your code
&lt;br&gt;does not use, or the volatile registers: r18-r27, r30-r31.
&lt;br&gt;&lt;br&gt;&amp;gt; I am coming across a problem in a fairly large project where the system
&lt;br&gt;&amp;gt; seems to display incorrect data on the LCD screen and eventually reset
&lt;br&gt;&amp;gt; itself. Other symptoms include displaying incorrect data when string
&lt;br&gt;&amp;gt; constants are transfered to the LCD. The worst case of the problem has been
&lt;br&gt;&amp;gt; uninitiated transfer to a part in the program requiring text input from the
&lt;br&gt;&amp;gt; user. 
&lt;br&gt;&lt;br&gt;That could perhaps be stack corruption. Have you triple checked the
&lt;br&gt;number and order of every assembler push and pop, using three different
&lt;br&gt;people?
&lt;br&gt;&lt;br&gt;&amp;gt; The problem has proved very difficult to debug since modifying the code can
&lt;br&gt;&amp;gt; cause unpredictable behaviour of the error.
&lt;br&gt;&lt;br&gt;But what happened when the SREG was pushed, to see if that would help?
&lt;br&gt;&lt;br&gt;&amp;gt; I believe that the problem first appeared as a global variable changing its
&lt;br&gt;&amp;gt; value for no reason. The problem was corrected by declaring the global
&lt;br&gt;&amp;gt; variable as static which I then considered to be the standard, but am now
&lt;br&gt;&amp;gt; thinking it only masked the problem by storing the variable in a different
&lt;br&gt;&amp;gt; location or modifying the compilation structure.
&lt;br&gt;&lt;br&gt;It is good to see you're recovering from the denial of clear evidence of
&lt;br&gt;deeper problems. The system will never be reliable until the underlying
&lt;br&gt;problem is found and removed.
&lt;br&gt;&lt;br&gt;&amp;gt; Now, all functions seem to be operating correctly and all unit tests pass,
&lt;br&gt;&amp;gt; until interrupt routines are enabled.
&lt;br&gt;&lt;br&gt;If it is in the interrupt routine that cpu status is not preserved, then
&lt;br&gt;it must be obvious that execution of any interrupted code with a
&lt;br&gt;condition test at the return point will at times be corrupted.
&lt;br&gt;&lt;br&gt;&amp;gt; Can anyone provide any insight into this problem or provide some debugging
&lt;br&gt;&amp;gt; techniques to help identify it?
&lt;br&gt;&lt;br&gt;If the &amp;quot;uninitiated transfer&amp;quot; occurs repeatedly, then displaying the
&lt;br&gt;return address found on the stack reveals where the &amp;quot;uninitiated transfer&amp;quot;
&lt;br&gt;occurred. If there is no call there, then it is likely that you returned
&lt;br&gt;to the start of the input routine, perhaps using a data value as return
&lt;br&gt;address. 
&lt;br&gt;&lt;br&gt;It is often necessary to fix the biggest bug in order to spot the
&lt;br&gt;smaller ones hiding behind it. Attacked methodically, it can be quite
&lt;br&gt;gratifying, though mostly when it's over, I must admit. :-)
&lt;br&gt;&lt;br&gt;Erik
&lt;br&gt;&lt;br&gt;P.S. I've written all my ISRs in assembler, on a variety of 8 and 32 bit
&lt;br&gt;platforms, and it is not intrinsically risky, but if the absolutely
&lt;br&gt;essential need to save cpu status is not immediately clear, then writing
&lt;br&gt;them in C could be a wise alternative, which simultaneously eliminates
&lt;br&gt;any push-pop mismatch issues.
&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-GCC-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26439509&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-GCC-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---gcc-f2010.html&quot; embed=&quot;fixTarget[2010]&quot; target=&quot;_top&quot; &gt;AVR - gcc&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/assembly-c-mix-and-interrupts-tp26421328p26439509.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26437418</id>
	<title>stdint.h problem with gcc</title>
	<published>2009-11-19T18:11:30Z</published>
	<updated>2009-11-19T18:11:30Z</updated>
	<author>
		<name>Andrew Hutchinson</name>
	</author>
	<content type="html">I have been going through the gcc tests for V4.5 and come across some 
&lt;br&gt;issues with avr-lic stdint.h
&lt;br&gt;&lt;br&gt;The tests that fails are gcc/gcc/testsuite/gcc.dg/c99-stdint-1.c
&lt;br&gt;&lt;br&gt;gcc will create it's own stdint.h and this is fine for V4.5. I have 
&lt;br&gt;attached this for reference.
&lt;br&gt;&lt;br&gt;The definition of UINT8_MAX is unsigned e.g. 255U - this fails test. 255 
&lt;br&gt;is ok
&lt;br&gt;wchar limits are not defined- ok we dont have wchar.h but we should 
&lt;br&gt;still define the types.
&lt;br&gt;&lt;br&gt;There is &amp;nbsp;another issue related to ptrdiff type. This is posted as gcc 
&lt;br&gt;bug - since it is possible that this particular subtest is inappropriate 
&lt;br&gt;for avr.
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42114&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42114&lt;/a&gt;&lt;br&gt;&lt;br&gt;=================================================================
&lt;br&gt;/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
&lt;br&gt;&lt;br&gt;This file is part of GCC.
&lt;br&gt;&lt;br&gt;GCC is free software; you can redistribute it and/or modify
&lt;br&gt;it under the terms of the GNU General Public License as published by
&lt;br&gt;the Free Software Foundation; either version 3, or (at your option)
&lt;br&gt;any later version.
&lt;br&gt;&lt;br&gt;GCC is distributed in the hope that it will be useful,
&lt;br&gt;but WITHOUT ANY WARRANTY; without even the implied warranty of
&lt;br&gt;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &amp;nbsp;See the
&lt;br&gt;GNU General Public License for more details.
&lt;br&gt;&lt;br&gt;Under Section 7 of GPL version 3, you are granted additional
&lt;br&gt;permissions described in the GCC Runtime Library Exception, version
&lt;br&gt;3.1, as published by the Free Software Foundation.
&lt;br&gt;&lt;br&gt;You should have received a copy of the GNU General Public License and
&lt;br&gt;a copy of the GCC Runtime Library Exception along with this program;
&lt;br&gt;see the files COPYING3 and COPYING.RUNTIME respectively. &amp;nbsp;If not, see
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.gnu.org/licenses/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/licenses/&lt;/a&gt;&amp;gt;. &amp;nbsp;*/
&lt;br&gt;&lt;br&gt;/*
&lt;br&gt;&amp;nbsp;* ISO C Standard: &amp;nbsp;7.18 &amp;nbsp;Integer types &amp;nbsp;&amp;lt;stdint.h&amp;gt;
&lt;br&gt;&amp;nbsp;*/
&lt;br&gt;&lt;br&gt;#ifndef _GCC_STDINT_H
&lt;br&gt;#define _GCC_STDINT_H
&lt;br&gt;&lt;br&gt;/* 7.8.1.1 Exact-width integer types */
&lt;br&gt;&lt;br&gt;#ifdef __INT8_TYPE__
&lt;br&gt;typedef __INT8_TYPE__ int8_t;
&lt;br&gt;#endif
&lt;br&gt;#ifdef __INT16_TYPE__
&lt;br&gt;typedef __INT16_TYPE__ int16_t;
&lt;br&gt;#endif
&lt;br&gt;#ifdef __INT32_TYPE__
&lt;br&gt;typedef __INT32_TYPE__ int32_t;
&lt;br&gt;#endif
&lt;br&gt;#ifdef __INT64_TYPE__
&lt;br&gt;typedef __INT64_TYPE__ int64_t;
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINT8_TYPE__
&lt;br&gt;typedef __UINT8_TYPE__ uint8_t;
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINT16_TYPE__
&lt;br&gt;typedef __UINT16_TYPE__ uint16_t;
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINT32_TYPE__
&lt;br&gt;typedef __UINT32_TYPE__ uint32_t;
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINT64_TYPE__
&lt;br&gt;typedef __UINT64_TYPE__ uint64_t;
&lt;br&gt;#endif
&lt;br&gt;&lt;br&gt;/* 7.8.1.2 Minimum-width integer types */
&lt;br&gt;&lt;br&gt;typedef __INT_LEAST8_TYPE__ int_least8_t;
&lt;br&gt;typedef __INT_LEAST16_TYPE__ int_least16_t;
&lt;br&gt;typedef __INT_LEAST32_TYPE__ int_least32_t;
&lt;br&gt;typedef __INT_LEAST64_TYPE__ int_least64_t;
&lt;br&gt;typedef __UINT_LEAST8_TYPE__ uint_least8_t;
&lt;br&gt;typedef __UINT_LEAST16_TYPE__ uint_least16_t;
&lt;br&gt;typedef __UINT_LEAST32_TYPE__ uint_least32_t;
&lt;br&gt;typedef __UINT_LEAST64_TYPE__ uint_least64_t;
&lt;br&gt;&lt;br&gt;/* 7.8.1.3 Fastest minimum-width integer types */
&lt;br&gt;&lt;br&gt;typedef __INT_FAST8_TYPE__ int_fast8_t;
&lt;br&gt;typedef __INT_FAST16_TYPE__ int_fast16_t;
&lt;br&gt;typedef __INT_FAST32_TYPE__ int_fast32_t;
&lt;br&gt;typedef __INT_FAST64_TYPE__ int_fast64_t;
&lt;br&gt;typedef __UINT_FAST8_TYPE__ uint_fast8_t;
&lt;br&gt;typedef __UINT_FAST16_TYPE__ uint_fast16_t;
&lt;br&gt;typedef __UINT_FAST32_TYPE__ uint_fast32_t;
&lt;br&gt;typedef __UINT_FAST64_TYPE__ uint_fast64_t;
&lt;br&gt;&lt;br&gt;/* 7.8.1.4 Integer types capable of holding object pointers */
&lt;br&gt;&lt;br&gt;#ifdef __INTPTR_TYPE__
&lt;br&gt;typedef __INTPTR_TYPE__ intptr_t;
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINTPTR_TYPE__
&lt;br&gt;typedef __UINTPTR_TYPE__ uintptr_t;
&lt;br&gt;#endif
&lt;br&gt;&lt;br&gt;/* 7.8.1.5 Greatest-width integer types */
&lt;br&gt;&lt;br&gt;typedef __INTMAX_TYPE__ intmax_t;
&lt;br&gt;typedef __UINTMAX_TYPE__ uintmax_t;
&lt;br&gt;&lt;br&gt;#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
&lt;br&gt;&lt;br&gt;/* 7.18.2 Limits of specified-width integer types */
&lt;br&gt;&lt;br&gt;#ifdef __INT8_MAX__
&lt;br&gt;# undef INT8_MAX
&lt;br&gt;# define INT8_MAX __INT8_MAX__
&lt;br&gt;# undef INT8_MIN
&lt;br&gt;# define INT8_MIN (-INT8_MAX - 1)
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINT8_MAX__
&lt;br&gt;# undef UINT8_MAX
&lt;br&gt;# define UINT8_MAX __UINT8_MAX__
&lt;br&gt;#endif
&lt;br&gt;#ifdef __INT16_MAX__
&lt;br&gt;# undef INT16_MAX
&lt;br&gt;# define INT16_MAX __INT16_MAX__
&lt;br&gt;# undef INT16_MIN
&lt;br&gt;# define INT16_MIN (-INT16_MAX - 1)
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINT16_MAX__
&lt;br&gt;# undef UINT16_MAX
&lt;br&gt;# define UINT16_MAX __UINT16_MAX__
&lt;br&gt;#endif
&lt;br&gt;#ifdef __INT32_MAX__
&lt;br&gt;# undef INT32_MAX
&lt;br&gt;# define INT32_MAX __INT32_MAX__
&lt;br&gt;# undef INT32_MIN
&lt;br&gt;# define INT32_MIN (-INT32_MAX - 1)
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINT32_MAX__
&lt;br&gt;# undef UINT32_MAX
&lt;br&gt;# define UINT32_MAX __UINT32_MAX__
&lt;br&gt;#endif
&lt;br&gt;#ifdef __INT64_MAX__
&lt;br&gt;# undef INT64_MAX
&lt;br&gt;# define INT64_MAX __INT64_MAX__
&lt;br&gt;# undef INT64_MIN
&lt;br&gt;# define INT64_MIN (-INT64_MAX - 1)
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINT64_MAX__
&lt;br&gt;# undef UINT64_MAX
&lt;br&gt;# define UINT64_MAX __UINT64_MAX__
&lt;br&gt;#endif
&lt;br&gt;&lt;br&gt;#undef INT_LEAST8_MAX
&lt;br&gt;#define INT_LEAST8_MAX __INT_LEAST8_MAX__
&lt;br&gt;#undef INT_LEAST8_MIN
&lt;br&gt;#define INT_LEAST8_MIN (-INT_LEAST8_MAX - 1)
&lt;br&gt;#undef UINT_LEAST8_MAX
&lt;br&gt;#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
&lt;br&gt;#undef INT_LEAST16_MAX
&lt;br&gt;#define INT_LEAST16_MAX __INT_LEAST16_MAX__
&lt;br&gt;#undef INT_LEAST16_MIN
&lt;br&gt;#define INT_LEAST16_MIN (-INT_LEAST16_MAX - 1)
&lt;br&gt;#undef UINT_LEAST16_MAX
&lt;br&gt;#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
&lt;br&gt;#undef INT_LEAST32_MAX
&lt;br&gt;#define INT_LEAST32_MAX __INT_LEAST32_MAX__
&lt;br&gt;#undef INT_LEAST32_MIN
&lt;br&gt;#define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)
&lt;br&gt;#undef UINT_LEAST32_MAX
&lt;br&gt;#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
&lt;br&gt;#undef INT_LEAST64_MAX
&lt;br&gt;#define INT_LEAST64_MAX __INT_LEAST64_MAX__
&lt;br&gt;#undef INT_LEAST64_MIN
&lt;br&gt;#define INT_LEAST64_MIN (-INT_LEAST64_MAX - 1)
&lt;br&gt;#undef UINT_LEAST64_MAX
&lt;br&gt;#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
&lt;br&gt;&lt;br&gt;#undef INT_FAST8_MAX
&lt;br&gt;#define INT_FAST8_MAX __INT_FAST8_MAX__
&lt;br&gt;#undef INT_FAST8_MIN
&lt;br&gt;#define INT_FAST8_MIN (-INT_FAST8_MAX - 1)
&lt;br&gt;#undef UINT_FAST8_MAX
&lt;br&gt;#define UINT_FAST8_MAX __UINT_FAST8_MAX__
&lt;br&gt;#undef INT_FAST16_MAX
&lt;br&gt;#define INT_FAST16_MAX __INT_FAST16_MAX__
&lt;br&gt;#undef INT_FAST16_MIN
&lt;br&gt;#define INT_FAST16_MIN (-INT_FAST16_MAX - 1)
&lt;br&gt;#undef UINT_FAST16_MAX
&lt;br&gt;#define UINT_FAST16_MAX __UINT_FAST16_MAX__
&lt;br&gt;#undef INT_FAST32_MAX
&lt;br&gt;#define INT_FAST32_MAX __INT_FAST32_MAX__
&lt;br&gt;#undef INT_FAST32_MIN
&lt;br&gt;#define INT_FAST32_MIN (-INT_FAST32_MAX - 1)
&lt;br&gt;#undef UINT_FAST32_MAX
&lt;br&gt;#define UINT_FAST32_MAX __UINT_FAST32_MAX__
&lt;br&gt;#undef INT_FAST64_MAX
&lt;br&gt;#define INT_FAST64_MAX __INT_FAST64_MAX__
&lt;br&gt;#undef INT_FAST64_MIN
&lt;br&gt;#define INT_FAST64_MIN (-INT_FAST64_MAX - 1)
&lt;br&gt;#undef UINT_FAST64_MAX
&lt;br&gt;#define UINT_FAST64_MAX __UINT_FAST64_MAX__
&lt;br&gt;&lt;br&gt;#ifdef __INTPTR_MAX__
&lt;br&gt;# undef INTPTR_MAX
&lt;br&gt;# define INTPTR_MAX __INTPTR_MAX__
&lt;br&gt;# undef INTPTR_MIN
&lt;br&gt;# define INTPTR_MIN (-INTPTR_MAX - 1)
&lt;br&gt;#endif
&lt;br&gt;#ifdef __UINTPTR_MAX__
&lt;br&gt;# undef UINTPTR_MAX
&lt;br&gt;# define UINTPTR_MAX __UINTPTR_MAX__
&lt;br&gt;#endif
&lt;br&gt;&lt;br&gt;#undef INTMAX_MAX
&lt;br&gt;#define INTMAX_MAX __INTMAX_MAX__
&lt;br&gt;#undef INTMAX_MIN
&lt;br&gt;#define INTMAX_MIN (-INTMAX_MAX - 1)
&lt;br&gt;#undef UINTMAX_MAX
&lt;br&gt;#define UINTMAX_MAX __UINTMAX_MAX__
&lt;br&gt;&lt;br&gt;/* 7.18.3 Limits of other integer types */
&lt;br&gt;&lt;br&gt;#undef PTRDIFF_MAX
&lt;br&gt;#define PTRDIFF_MAX __PTRDIFF_MAX__
&lt;br&gt;#undef PTRDIFF_MIN
&lt;br&gt;#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
&lt;br&gt;&lt;br&gt;#undef SIG_ATOMIC_MAX
&lt;br&gt;#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
&lt;br&gt;#undef SIG_ATOMIC_MIN
&lt;br&gt;#define SIG_ATOMIC_MIN __SIG_ATOMIC_MIN__
&lt;br&gt;&lt;br&gt;#undef SIZE_MAX
&lt;br&gt;#define SIZE_MAX __SIZE_MAX__
&lt;br&gt;&lt;br&gt;#undef WCHAR_MAX
&lt;br&gt;#define WCHAR_MAX __WCHAR_MAX__
&lt;br&gt;#undef WCHAR_MIN
&lt;br&gt;#define WCHAR_MIN __WCHAR_MIN__
&lt;br&gt;&lt;br&gt;#undef WINT_MAX
&lt;br&gt;#define WINT_MAX __WINT_MAX__
&lt;br&gt;#undef WINT_MIN
&lt;br&gt;#define WINT_MIN __WINT_MIN__
&lt;br&gt;&lt;br&gt;#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
&lt;br&gt;&lt;br&gt;#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
&lt;br&gt;&lt;br&gt;#undef INT8_C
&lt;br&gt;#define INT8_C(c) __INT8_C(c)
&lt;br&gt;#undef INT16_C
&lt;br&gt;#define INT16_C(c) __INT16_C(c)
&lt;br&gt;#undef INT32_C
&lt;br&gt;#define INT32_C(c) __INT32_C(c)
&lt;br&gt;#undef INT64_C
&lt;br&gt;#define INT64_C(c) __INT64_C(c)
&lt;br&gt;#undef UINT8_C
&lt;br&gt;#define UINT8_C(c) __UINT8_C(c)
&lt;br&gt;#undef UINT16_C
&lt;br&gt;#define UINT16_C(c) __UINT16_C(c)
&lt;br&gt;#undef UINT32_C
&lt;br&gt;#define UINT32_C(c) __UINT32_C(c)
&lt;br&gt;#undef UINT64_C
&lt;br&gt;#define UINT64_C(c) __UINT64_C(c)
&lt;br&gt;#undef INTMAX_C
&lt;br&gt;#define INTMAX_C(c) __INTMAX_C(c)
&lt;br&gt;#undef UINTMAX_C
&lt;br&gt;#define UINTMAX_C(c) __UINTMAX_C(c)
&lt;br&gt;&lt;br&gt;#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
&lt;br&gt;&lt;br&gt;#endif /* _GCC_STDINT_H */
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-libc-dev mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26437418&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-libc-dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-libc-dev&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---Libc---Dev-f2012.html&quot; embed=&quot;fixTarget[2012]&quot; target=&quot;_top&quot; &gt;AVR - Libc - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/stdint.h-problem-with-gcc-tp26437418p26437418.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26435960</id>
	<title>Re: assembly-c mix and interrupts</title>
	<published>2009-11-19T15:19:26Z</published>
	<updated>2009-11-19T15:19:26Z</updated>
	<author>
		<name>David Brown-40</name>
	</author>
	<content type="html">darkschine wrote:
&lt;br&gt;&amp;gt; Before I continue, I would like to suggest a resolution to my problem. I am
&lt;br&gt;&amp;gt; using the ATmega328P
&lt;br&gt;&amp;gt; My assembly code follows a standard that ALL registers used are pushed and
&lt;br&gt;&amp;gt; popped from the stack. However, my assembly code does NOT store the SREG.
&lt;br&gt;&amp;gt; Could this be causing my problems?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;We can't say for sure if this is /the/ cause of your problems, but we 
&lt;br&gt;can pretty much guarantee that it will lots of problems. &amp;nbsp;Make sure you 
&lt;br&gt;save the SREG.
&lt;br&gt;&lt;br&gt;A far better solution in most cases would be to re-write the interrupt 
&lt;br&gt;routine in C. &amp;nbsp;The compiler will then make sure that all necessary 
&lt;br&gt;registers, including SREG, are saved and restored properly. &amp;nbsp;The days of 
&lt;br&gt;having to write interrupt routines in assembly are far in the past, 
&lt;br&gt;except for very exceptional cases.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;AVR-GCC-list mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26435960&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;AVR-GCC-list@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.nongnu.org/mailman/listinfo/avr-gcc-list&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/AVR---gcc-f2010.html&quot; embed=&quot;fixTarget[2010]&quot; target=&quot;_top&quot; &gt;AVR - gcc&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/assembly-c-mix-and-interrupts-tp26421328p26435960.html" />
</entry>

</feed>
