Discussion in "8051 Discussion Forum" started by    scorcho    Oct 3, 2007.
Wed Oct 03 2007, 04:18 AM

I'm trying to modify the Cypress EZ-USB firmware for some added
functionality, but I'm having some problems regarding running out of
code space. It seems that when I call some of the EZUSB I2C library
functions, my code space balloons by quite a bit. For example
EZUSB_InitI2C would increase my code space by 500bytes. The default
firmware already uses up over 6KB, which leaves me with about 1KB+ to
play with, so 500 bytes is a lot to be just calling an initialize
function. Has anyone experienced similar problems? Is there any way of
solving this?

btw I'm using Keil uVision2 with the Cypress CY3686 EZUSB NX2 LP-FLEX

Tags cypress ez-usbCypress CY3686 EZUSB NX2 LP-FLEX DVK
Wed Oct 03 2007, 04:49 AM
I don't get it.. why calling a routine increases so much code space?
is the program written in C or assembly? I guess its C where you have least control on the code size...
A suggestion i can give is.. use the optimization methods.. maybe that help to reduce the code size.. try it and tell me..
Wed Oct 03 2007, 05:47 AM
I don't know why, I don't have access to the function definitions since they are part of a library. Anyway, is it possible to add external RAM for code space for 8051 MCUs?
Wed Oct 03 2007, 05:55 AM
try the optimization of the code in keil.. and tell me the results..
here is how you do it..
go to target options->C51 tab -> Code optimization level -> from dropdown select emphasis size..
check if you get some optimization..

and i think you will not be able to make any change in the circuit of programmer, if you can.. then try replacing the controller with higher onchip FLASH. As interfacing a separate ROM with controller in not a good idea.. too much hectic... first try the optimization..
Wed Oct 03 2007, 06:07 AM
I've already tried the optimization before. It's done on file level so I applied it for every .c file I have. It didn't do much...I gained <100 bytes with this...
Wed Oct 03 2007, 07:55 AM
hmm... can you tell me what you are adding in your EZ-USB?
Wed Oct 03 2007, 11:08 AM
Just some changes to LUN behavior as well as trying to access an external EEPROM.

Get Social


Powered by e107 Forum System


No messages yet.



Thu Jun 25 2020, 03:46 PM
Mon Jun 22 2020, 03:03 PM
Tue Jun 16 2020, 05:10 PM
Sat Jun 13 2020, 09:43 PM
Thu May 21 2020, 12:44 PM
Thu May 21 2020, 01:28 AM
Wed May 20 2020, 07:05 PM
Wed May 20 2020, 11:52 AM


Guests: 173, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123