From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RIQPQ-00051n-8v for garchives@archives.gentoo.org; Mon, 24 Oct 2011 19:42:08 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0829121C044; Mon, 24 Oct 2011 19:41:55 +0000 (UTC) Received: from mail-iy0-f181.google.com (mail-iy0-f181.google.com [209.85.210.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 09E9D21C033 for ; Mon, 24 Oct 2011 19:41:42 +0000 (UTC) Received: by iahk25 with SMTP id k25so10316239iah.40 for ; Mon, 24 Oct 2011 12:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=TQYZhbvgAdNIJ0HBXl5OljbErWANXjOFVWZwAMoa1aU=; b=b5+9sbNOaqhI1oe37E4Ih380pc+o7Y7am4BcAnPvugq3SMX/dT1GoR3CbkaTB/nroJ EZf7Ybwne3z6RV9Ovk8hapxpqtquLk0DWRa2npJ/Vr82spRkmdlGAAkTX8R7uT/IdNoZ 85iFn5/UbnuqE/MeXBtz6412ysePyt6Xbdrj4= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-embedded@lists.gentoo.org Reply-to: gentoo-embedded@lists.gentoo.org MIME-Version: 1.0 Received: by 10.42.155.70 with SMTP id t6mr2902617icw.38.1319485302464; Mon, 24 Oct 2011 12:41:42 -0700 (PDT) Received: by 10.42.167.4 with HTTP; Mon, 24 Oct 2011 12:41:42 -0700 (PDT) Date: Mon, 24 Oct 2011 21:41:42 +0200 Message-ID: Subject: [gentoo-embedded] Atmega issue since reinstallation of cross-avr/gcc From: Jean-Marc Beaune To: gentoo-embedded@lists.gentoo.org Content-Type: multipart/alternative; boundary=90e6ba1eff4abd5f4704b0109c3c X-Archives-Salt: X-Archives-Hash: d688aff991ee0f64e5f744d6f7997087 --90e6ba1eff4abd5f4704b0109c3c Content-Type: text/plain; charset=ISO-8859-1 Hi, Not easy to explain but I'll gi ve a go. I programed an atmega328p to read temperature and send it via USART. That worked fine untill I changed my laptop. After changing my computer (and therefore reinstalling cross-avr/gcc), then a part of a function used to read the temperature doesn't work anymore, i.e. it compiles fine but the atmega doesn't send anything via USART, the program dumps. I narrowed down the problem and it seems to be a problem when doing some calculation in a function: All variables below are declared as uint8_t The return statement below causes the program to crash: return (double) temp_LSB - 0.25 + (double)(count_per_c - count_remain) / count_per_c; The return statement below causes the program to crash also: return (double) temp_LSB - 0.25; The return statement below is OK: return (double)(count_per_c - count_remain) / count_per_c; Since it coincides with a change of computer used to compile the program I wonder if it could be a missing flag/option for cross-avr/gcc? Any advice appriciated, Thank you -- Jean-Marc --90e6ba1eff4abd5f4704b0109c3c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

Not easy to explain but I'll gi ve a go.

I programed an atmega328p to read temperature and send it= via USART. That worked fine untill I changed my laptop.

After changing my computer (and therefore reinstalling cross-avr/gcc),= then a part of a function used to read the temperature doesn't work an= ymore, i.e. it compiles fine but the atmega doesn't send anything via U= SART, the program dumps.

I narrowed down the problem and it seems to be a proble= m when doing some calculation in a function:

All v= ariables below are declared as uint8_t

The re= turn statement below causes the program to crash:
return (double) temp_LSB - 0.25 + (double)(count_per_c - count_remain)= / count_per_c;

The return statement below causes = the program to crash also:
return (double) temp_LSB - 0.25;

The return statement below is OK:
return =A0(= double)(count_per_c - count_remain) / count_per_c;

Since it coincides with a change of computer used to compile the program I= wonder if it could be a missing flag/option for cross-avr/gcc?

Any advice appriciated,
Thank you
<= br>
--
Jean-Marc
--90e6ba1eff4abd5f4704b0109c3c--