The prog I've attached reads a dword from SAM9260's DBGU
port and echoes it back.
First it calls RecvDword, which calls RecvByte 4 times,
then SendDword, which calls SendByte 4 times.
The SEND side works, READ side has problems.
Start the make.bat then inspect src.lss and you will see
that RecvByte is called only once.
Now, either add 'volatile' to line 15 of src.c
or change -Os to -O3 in make.bat
and RecvByte will be called 4 times.
I've tested this with real hardware,
not just by looking into src.lss.
If I send (with another comp) 0x12345678,
I get back 0x78787878, i.e. only the first byte sent.
I'm still a bit new to c language,
but this is a GCC bug, right?
I'm using yagarto (GCC 4.5.0)