kevin johnson
2010-12-02
I am getting two errors. the first is
syntax error: token -> '0xE400' ; column 50
the second is keyword xdata is deprecated, use '__xdata' isntead.
The reason these are frustrating is that it is from an example project that I was hoping to just compile and it would work. Any help would be greatly appreciated.
I have the file and a screen capture of the error but not sure how to add them yet.
kevin johnson
2010-12-02
The file the errors are in is called fx2regs.h and was downloaded from the cypress site. This site only seems to enable me to add links to a file so I am not sure where an appropriate place is to load the files. Any recommendations would be appreciated.
kevin johnson
2010-12-02
COMPILE STATEMENTS
sdcc -mmcs51 -c extr_intr.c
sdcc -mmcs51 -c isr.c
sdcc -mmcs51 -c i2c_rw.c
sdcc -mmcs51 -c i2c.c
sdcc -mmcs51 epromProg.c extr_intr.rel isr.rel i2c_rw.rel i2c.rel
OUTPUT after compiling
kevinjohnsonsmacbook:epromProg kevinjohnson$ ./make.sh
fx2regs.h:42: warning 197: keyword 'xdata' is deprecated, use '__xdata' instead
fx2regs.h:42: syntax error: token -> '0xE400' ; column 50
fx2regs.h:42: warning 197: keyword 'xdata' is deprecated, use '__xdata' instead
fx2regs.h:42: syntax error: token -> '0xE400' ; column 50
fx2regs.h:42: warning 197: keyword 'xdata' is deprecated, use '__xdata' instead
fx2regs.h:42: syntax error: token -> '0xE400' ; column 50
fx2regs.h:42: warning 197: keyword 'xdata' is deprecated, use '__xdata' instead
fx2regs.h:42: syntax error: token -> '0xE400' ; column 50
fx2regs.h:42: warning 197: keyword 'xdata' is deprecated, use '__xdata' instead
fx2regs.h:42: syntax error: token -> '0xE400' ; column 50
kevinjohnsonsmacbook:epromProg kevinjohnson$ sdcc -version
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 3.0.1 #6044 (Nov 2 2010) (Mac OS X i386)
kevinjohnsonsmacbook:epromProg kevinjohnson$
Lines from file with error
//---------------------------------------------------
// File: FX2regs.h
// Contents: EZ-USB FX2/FX2LP/FX1 register declarations and bit mask definitions.
//
// $Archive: /USB/Target/Inc/fx2regs.h $
// $Date: 4/13/05 4:29p $
// $Revision: 42 $
//
//
// Copyright (C) 2005 Cypress Semiconductor, All rights reserved
//---------------------------------------------------
#ifndef FX2REGS_H /* Header Sentry */
#define FX2REGS_H
//---------------------------------------------------
// FX2/FX2LP/FX1 Related Register Assignments
//---------------------------------------------------
// The Ez-USB FX2/FX2LP/FX1 registers are defined here. We use fx2regs.h for register
// address allocation by using "#define ALLOCATE_EXTERN".
// When using "#define ALLOCATE_EXTERN", you get (for instance):
// xdata volatile BYTE OUT7BUF _at_ 0x7B40;
// Such lines are created from FX2.h by using the preprocessor.
// Incidently, these lines will not generate any space in the resulting hex
// file; they just bind the symbols to the addresses for compilation.
// You just need to put "#define ALLOCATE_EXTERN" in your main program file;
// i.e. fw.c or a stand-alone C source file.
// Without "#define ALLOCATE_EXTERN", you just get the external reference:
// extern xdata volatile BYTE OUT7BUF ;// 0x7B40;
// This uses the concatenation operator "##" to insert a comment "//"
// to cut off the end of the line, "_at_ 0x7B40;", which is not wanted.
#ifdef ALLOCATE_EXTERN
#define EXTERN
#define _AT_ _at_
#else
#define EXTERN extern
#define _AT_ ;
#endif
EXTERN xdata volatile BYTE GPIF_WAVE_DATA _AT_ 0xE400;
EXTERN xdata volatile BYTE RES_WAVEDATA_END _AT_ 0xE480;
// General Configuration
EXTERN xdata volatile BYTE CPUCS _AT_ 0xE600; // Control & Status
EXTERN xdata volatile BYTE IFCONFIG _AT_ 0xE601; // Interface Configuration
EXTERN xdata volatile BYTE PINFLAGSAB _AT_ 0xE602; // FIFO FLAGA and FLAGB Assignments
EXTERN xdata volatile BYTE PINFLAGSCD _AT_ 0xE603; // FIFO FLAGC and FLAGD Assignments
EXTERN xdata volatile BYTE FIFORESET _AT_ 0xE604; // Restore FIFOS to default state
EXTERN xdata volatile BYTE BREAKPT _AT_ 0xE605; // Breakpoint
EXTERN xdata volatile BYTE BPADDRH _AT_ 0xE606; // Breakpoint Address H
EXTERN xdata volatile BYTE BPADDRL _AT_ 0xE607; // Breakpoint Address L
EXTERN xdata volatile BYTE UART230 _AT_ 0xE608; // 230 Kbaud clock for T0,T1,T2
EXTERN xdata volatile BYTE FIFOPINPOLAR _AT_ 0xE609; // FIFO polarities
EXTERN xdata volatile BYTE REVID _AT_ 0xE60A; // Chip Revision
EXTERN xdata volatile BYTE REVCTL _AT_ 0xE60B; // Chip Revision Control
kevin johnson
2010-12-02
I just did a search and replace of all xdata with __xdata and now the error message has changed to:
kevinjohnsonsmacbook:epromProg kevinjohnson$ ./make.sh
fx2regs.h:42: syntax error: token -> 'volatile' ; column 22
fx2regs.h:42: syntax error: token -> 'volatile' ; column 22
fx2regs.h:42: syntax error: token -> 'volatile' ; column 22
fx2regs.h:42: syntax error: token -> 'volatile' ; column 22
fx2regs.h:42: syntax error: token -> 'volatile' ; column 22
kevinjohnsonsmacbook:epromProg kevinjohnson$
Maarten Brock
2010-12-03
Kevin,
Forget this file from Cypress. It is not for SDCC and uses a syntax that is not compatible with SDCC.
I suggest to look at https://sourceforge.net/projects/fx2lib/
Or here https://github.com/trygvis/fx2lib/tree/master/
Maarten
kevin johnson
2010-12-07
Thank you. I was able to files here as well: http://www.danielclemente.com/placa_pi/index.en.html
They still required some modification because they were old. The sites you listed are EXTREMELY HELPFUL.
Thanks
Kevin