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)
Please add the LSS file. Do not expect others to have the exactly same compiler version.
Indeed it looks like a compiler bug. gcc 4.3.2 and 4.4.1 from codesourcery are fine though.
Besides 4.5.0, I also have yagarto with GCC 4.4.2. and it works fine, but using -Os has no effect (at least not with this example). If someone has the energy to fight with the bugzilla report, please do so.
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
Log in with Google account
No account? Register here.