Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Embedded (http://www.linux-archive.org/gentoo-embedded/)
-   -   Atmega issue since reinstallation of cross-avr/gcc (http://www.linux-archive.org/gentoo-embedded/590875-atmega-issue-since-reinstallation-cross-avr-gcc.html)

Jean-Marc Beaune 10-24-2011 07:41 PM

Atmega issue since reinstallation of cross-avr/gcc
 
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


All times are GMT. The time now is 02:38 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.