Hi, I'm programming for a Cypress EZ-USB FX2 platform, and I'm adding onto the default firmware. I'm having some problems compiling some code, and I'm wondering if I'm running into space limitations already.
First of all, I get warnings when I try to initialize the I2C interface by calling
EZUSB_InitI2C();
I get the warning message
*** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _EZUSB_WAITFOREEPROMWRITE/I2C *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _EZUSB_WRITEI2C_?I2C *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _EZUSB_READI2C_?I2C Program Size: data=112.4 xdata=6830 const=216 code=8870
Next, when I try to add in another for loop as below
for (i=0;i<16;i++) EZUSB_ReadI2C(ZTBL_ADDR+i, 0x01, z_table[i]);
I am unable to compile. I get the following error messages on top of the warning message
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?L?COM001A LENGTH: 00000BH *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?L?COM0022 LENGTH: 000009H *** ERROR L138: CODE GENERATION: PROBLEM WHEN PROCESSING INSTRUCTIONS CAUSE: JUMP TARGET OUT OF RANGE ADDRESS: 0750H *** ERROR L138: CODE GENERATION: PROBLEM WHEN PROCESSING INSTRUCTIONS CAUSE: JUMP TARGET OUT OF RANGE ADDRESS: 0761H *** ERROR L138: CODE GENERATION: PROBLEM WHEN PROCESSING INSTRUCTIONS CAUSE: JUMP TARGET OUT OF RANGE ADDRESS: 0785H *** ERROR L138: CODE GENERATION: PROBLEM WHEN PROCESSING INSTRUCTIONS CAUSE: JUMP TARGET OUT OF RANGE ADDRESS: 07B0H Program Size: data=112.4 xdata=6830 const=216 code=8993 Target not created
Have I run out of space already?
Thanks!
See: http://www.keil.com/product/devproc.asp?t=c51&h=1
Program Size: data=112.4 xdata=6830 const=216 code=8870
That tells you how much CODE space you are using.
How much code space do you have? And, more importantly, how much have you configured for your project?
"I am unable to compile."
The messages you show are from the Linker - not the compiler; again, see: http://www.keil.com/product/devproc.asp?t=c51&h=1
"Have I run out of space already?"
Yes, that is what "Address space Overflow" means!
http://www.keil.com/support/man/docs/bl51/bl51_l107.htm http://www.keil.com/support/man/docs/lx51/lx51_l107.htm
Yes I sorta figured that out after reading some more. This is my first time working with the Cypress/Keil platform so please bear with me.
I have in fact read the 1st overflow link, as well as this one- http://www.keil.com/support/docs/1481.htm which tells me to either reduce my code size(gonna be tough) or increase the XDATA/CODE spaces.
The chip I'm using(CY7C68013) has 16KB internal RAM. How can I increase the XDATA/CODE spaces? I read this link - http://www.keil.com/support/docs/1450.htm but still don't know where to change the values(which file or menu dialog?) I'm using µVision2 and under View->Options I couldn't find any "Target" page. I only see 3 tabs - Editor, Colors & Fonts and Shortcut Keys.
Are there also any compiler optimization flags that I can set to optimize for code size? If so where can I change them?
"This is my first time working with the Cypress/Keil platform"
So start here: http://www.keil.com/support/man/docs/uv3/
And, in particular, here: http://www.keil.com/support/man/docs/uv3/uv3_examples.htm
"The chip I'm using(CY7C68013) has 16KB internal RAM. How can I increase the XDATA/CODE spaces?"
Do you understand the distinction between CODE and XDATA in the 8051 architecture?
Does this chip allow that 16K of RAM to be used as CODE space?
"still don't know where to change the values(which file or menu dialog?)"
So start here: http://www.keil.com/support/man/docs/uv3/uv3_examples.htm - it walks you through the whole process of creating a project, setting options, and debugging...
View all questions in Keil forum