hi everybody.
I've been trying the latest buildroot from http://atmel.no/buildroot.
All of the previous apps worked except from one. Looking for the problematic line or a possible mistake I found that, given the conditions, a function like:
void myfunc( unsigned char c ) { printf("%u\n", (unsigned int) c ); }
would return values greater than 255. In fact, I get values near 0xFFFFFFFF which means that the parameter is probably getting passed the wrong way.
I found that adding a simple nop for loop after calling myfunc() can fix things. I still don't know if it is a bug or not, but the program runs alright on the pc or an older toolchain).
I did the listings and it looks as if gcc forgets to add a castu.b before passing the parameter to myfunc(). A full word OR is done with negative values before calling it, so that explains why.
Here I attach a test case.
'make' makes the target for the avr32, 'make host' makes it for the host.
I don't know if there is a newer toolchain however nor if the same problem applies, I hope this helps.
By default the avr32 version should reproduce the error ( with gcc v4.2.2-atmel.1.0.8 ). To make it go right line 78 on lcd.c should be commented and line 74 uncommented (see the comments nearby, there are other ways to make it work too).
thanks
Carlos