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!
To be honest I'm not 100% sure. There seems to be 2 modes that the chip can operate at. I quote from the datasheet
3.9.2 Internal Code Memory, EA = 0 This mode implements the internal eight-kbyte block of RAM (starting at 0) as combined code and data memory. When external RAM or ROM is added, the external read and write strobes are suppressed for memory spaces that exist inside the chip. This allows the user to connect a 64-kbyte memory without requiring address decodes to keep clear of internal memory spaces. Only the internal eight kbytes and scratch pad 0.5 kbytes RAM spaces have the following access: • USB download • USB upload • Setup data pointer • I2C-compatible interface boot load. 3.9.3 External Code Memory, EA = 1 The bottom eight kbytes of program memory is external, and therefore the bottom eight kbytes of internal RAM is accessible only as data memory.
The default firmware uses EA = 1.
Anyway, is there any reason why calling a simple I2C init function would make the code ballon by over 500 bytes? It doesn't make sense to me...
"is there any reason why calling a simple I2C init function would make the code ballon by over 500 bytes?"
How do you know that it is "simple"...?
Interesting concept. I stand corrected :)