djmuhlestein / fx2lib

Library routines for creating firmware for the Cypress FX2 (CY7C68013 and variants) with SDCC
GNU Lesser General Public License v3.0
138 stars 83 forks source link

syntax error token 'at' #6

Closed zansibar closed 2 years ago

zansibar commented 11 years ago

Can anyone help with this. What am I missing here?

make -C lib sdcc -mmcs51 -I../include -c serial.c -o serial.rel ../include/fx2regs.h:43: syntax error: token -> 'at' ; column 8 make[1]: * [serial.rel] Error 1 make: * [all] Error 2

sdcc: SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.0 #8008 (Feb 26 2013) (Mac OS X x86_64)

djmuhlestein commented 11 years ago

Do you have access to a different system. I'm not familiar with sdcc on mac. Not that is should be any different. But fx2regs.h:43 is the same for the last multiple years. Seems like a setup issue with the compiler somehow. Seems like the -mmcs51 isn't working right or something so it doesn't know what the xdata at syntax means.

makestuff commented 11 years ago

I think the most likely cause is the sdcc version: you're using 3.2.0 whereas fx2lib expects 2.9.0.

DanielO commented 11 years ago

On 27/02/2013, at 9:54, Dennis Muhlestein notifications@github.com wrote:

Do you have access to a different system. I'm not familiar with sdcc on mac. Not that is should be any different. But fx2regs.h:43 is the same for the last multiple years. Seems like a setup issue with the compiler somehow. Seems like the -mmcs51 isn't working right or something so it doesn't know what the xdata at syntax means.

I've used sdcc 3.0.0 on a mac (via macports) with no problems (although I did submit a patch to fix a bunch of deprecation warnings ages ago).

Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

djmuhlestein commented 11 years ago

I wondered about that. Should there be a port of fx2lib for newer sdcc versions? It appears they don't like that syntax any more. I haven't been following at all to know what would be the correct way to upgrade the library though.

Honestly, I'm still using fx2lib firmware a project I'm working on but it's been so stable that I hardly even know it's there. I just leave it as is and worry about higher level stuff.

zansibar commented 11 years ago

I tried to compile sdcc 2.9.0 but it failed with getline redefinition. sdcc 3.0.0 compiled ok but a new error showed up compiling fx2lib:

asx8051 -logs usbav.a51 make[1]: asx8051: No such file or directory make[1]: * [usbav.rel] Error 1 make: * [all] Error 2

I did ln -s sdas8051 asx8051, make again and no complaints this time.

That's it, I will see if it works on a board, thanks.

djmuhlestein commented 11 years ago

Sounds like fx2lib might need a little bit of a makefile and perhaps header upgrade for newer sdcc builds. I checked the sdcc manual and didn't see anything that talked about a change in syntax but I didn't search for a long time.

signal64 commented 11 years ago

I can confirm the issue occurs with sdcc 3.2.0. The only reason I can find is that sdcc now "requires compiler directives to be prefixed with two underscores to comply with C standards".

And it becomes a bit more obvious when you use sdcc 3.0.0 and get the warnings: ../include/fx2regs.h:43: warning 197: keyword 'xdata' is deprecated, use 'xdata' instead ../include/fx2regs.h:43: warning 197: keyword 'at' is deprecated, use 'at' instead

Example: xdata at 0xE400 volatile BYTE GPIF_WAVE_DATA;

Change to: xdata at 0xE400 volatile BYTE GPIF_WAVE_DATA;

I ran into the same isue with the Cypress examples as well.

djmuhlestein commented 11 years ago

When I get a moment I'll update all the headers. Seems the older versions have always supported the underscore versions so I don't think any problem. One shortcut in the mean time #define xdata xdata #define at at?

DanielO commented 11 years ago

On 20/03/2013, at 1:02, signal64 notifications@github.com wrote:

I can confirm the issue occurs with sdcc 3.2.0. The only reason I can find is that sdcc now "requires compiler directives to be prefixed with two underscores to comply with C standards".

And it becomes a bit more obvious when you use sdcc 3.0.0 and get the warnings: ../include/fx2regs.h:43: warning 197: keyword 'xdata' is deprecated, use 'xdata' instead ../include/fx2regs.h:43: warning 197: keyword 'at' is deprecated, use 'at' instead

Example: xdata at 0xE400 volatile BYTE GPIF_WAVE_DATA;

Change to: xdata at 0xE400 volatile BYTE GPIF_WAVE_DATA;

I ran into the same isue with the Cypress examples as well.

I have a pull request to fix these.. https://github.com/mulicheng/fx2lib/pull/1

Specifically.. https://github.com/DanielO/fx2lib/commit/3071389d9a868ed553b84809b399008648536fcf

Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

djmuhlestein commented 11 years ago

Ok, we can close this if there wasn't any issues with the pull request.

makestuff commented 11 years ago

It's a minor point (certainly not worth reverting) but following the merge it's necessary to do "make AS8051=asx8051" if you're still on SDCC 2.9.0.