Hi,
I have an existing project which contains my code and code of a library and I would add again a little part from this same library (Atmel) 3 new files ( file.c, fs_varaiable.c and fat.c) at this project but after adding the fat.c file I have receive too many errors and warning. For a segment (function) there are too many differents warning but which one is the first and so?
Can you advice me to best implement a part of a library?
The output file is:
Sequences of warnings (LX) and errors (Error LX)
L16 24 x L15 1 x ERROR L107 30 x L1 6 x Error L105 1x Error L120 1x Error L118 1 x Error L105 7x Error L120 10x Error L105 4x Error L120 2x Error L118 12x Error L120 1x Error L118 2x Error L120 1x Error L118 1x Error L120 1x Error L118 24x Error L105 1x Error L120 1x Error L118 84x Error L105 2x Error L120 2x Error L105 1x Error L120 2x Error L105 1x Error L118 20x Error L120 1x Error L118 14x Error L105 1x Error L118 22x Error L120 1x L1 2x Error L105 1x L2 2x Error L120 1x L1 12x Error L105 7x Error L120 1x L2 46x Error L120 1x L2 93x Error L120 1x L2 30x Error L120 3x L2 18x Error L118 2x Error L105 1x Error L118 4x Error L105 1x Error L120 1x Error L105 1x Error L120 1x Error L105 1x Error L120 1x
////////////////////////////////
Build target 'Target 1' compiling main.c... compiling I2C.c... compiling ADC.c... compiling AUD.c... compiling DAC.c... compiling MICRO2.c... compiling DONG2.c... assembling STARTUP.A51... compiling variable.c... compiling ide_drv.c... compiling C_Flash.c... compiling CF_oper.c... compiling cf_drv_.c... compiling ata.c... compiling file.c... compiling fs_variable.c... compiling fat.c... linking... *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?CAG?ADC *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?MICRO?MICRO2 *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?CO?VARIABLE *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_FILE_SEEK_PREV?FILE *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_FILE_SEEK_NEXT?FILE *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_FILE_ENTRY_DIR?FILE *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS .... ... ... ..
Can you help me please?
Thank you
Thanks Neil, and everyone here
Sorry for my English. So I try what you say and I think this is very good because my code size is getting more light.
But I see in View -> Source Browse that there is data, macro , typedef, function Classes. Me I change xdata space from data classes so it's correct but can I do something for other classes ?
And when a data class is a code space can I change it to data ?
for example : MyArray1 data array code 5 MyArray1 data array code 2 MyArray1 data array xdata 2
I just forget to ask an important question: When I change the xdata variables to data variables depending of types and uses of variables can it be some problem in my program?
For example I have a CompactFlash ide device in my PCB, the registers of this CF must be xdata type, and what about any others variables which must be xdata are there any or not?
Why must the registers of the CF be xdata type? Do you mean that you have mapped the CF to your XDATA space? If so,you surely couldn't change them from xdata to data.The access to data doesn't make the 8051 chip outputting any signal.
Ali Bas is back again!
"And when a data class is a code space can I change it to data ?"
Usually, if "data" is stored in CODE space, that's because it's constant. If you did move such variables into a "data" space, something would still have to load the constant values into them at runtime - this would require some code. Since the object of the exercise is to reduce your code size, this would be a Bad Thing!
But the LX51 Linker does allow you to place constants into XDATA space, assuming that your hardware can map some ROM into XDATA space
See: http://www.keil.com/support/man/docs/c51/c51_xcrom.htm http://www.keil.com/support/man/docs/c51/c51_le_const.htm http://www.keil.com/forum/docs/thread6231.asp
Obviously, if there are specific reasons why a variable needs to be in XDATA - then it must stay in XDATA!
eg, memory-mapped peripherals (your CF card, perhaps?) must remain in XDATA (unless you have some very special derivative that allows you to map them to an "internal" space).
Any variable that is too big to fit into DATA or IDATA will have to stay in XDATA.
However, you might be able to gain some advantage from "cacheing" data internally; ie: 1. read from XDATA into DATA; 2. process in DATA; 3. write results back to XDATA.
Only you can tell whether this might be worthwhile in some particular instances in your specific application.
You should probably look at the other options for code-reduction first (optimising your code).
If you have exceeded the CODE memory physically available (or addressable) on you target, then it will require significant hardware changes to increase it.
Moving to code banking may also require you to make extensive code changes.
Therefore now might be a good time to review whether the 8051 is really the right choice for this project. Would you not be better choosing another family (eg, ARM) without such a code space limitation...?
Switching architectures is non-trivial - but it may be worth it in the long run!
This time,
I would be Sems Gencay and till I'm in Keil Forum :) I used Ali Bas because I don't remember my first log in registered in Keil.
Thanks, I would consider to map code (constant) to XDATA but for switching the hardware it's to late because other functionnalities are all OK and the PCB are fonctionnel except for the moment the read of mp3 file because I have implement the Atmel library for my µC AT89C51SNDC1 which include an mp3 decoder.
I have already implement the Atmel library for read of the Compactflash of my PCB.
The idea is to read depending on conditions one of the mp3 files present in the CF.
Thanks But
So now I have small numbers of warnings but now I have my CODE which is more big is limited and I have heard that the code size must be 1K under the limit.
Program Size: data=160.0 xdata=1787 code=65155
For implmeneting more files in my projetc I have changed xdata's data on data's data. But how can I reduce the code memory size because this is generally for functions ?
"Program Size: data=160.0 xdata=1787 code=65155"
In other words, your CODE space is 99.4% full!
And you still say you want to add more functions!! :-0
Do you have any idea how much more code you need to add?
"how can I reduce the code"
The first step must be to ensure that your code is as efficient as possible for the 8051 and C51
See: http://www.keil.com/support/man/docs/c51/c51_xc.htm
And read the thread I mentioned earlier: http://www.keil.com/forum/docs/thread1082.asp
Next, consider what compiler Optimisation setting you're using.
No, in fact I will not add others functions, it's enough but I Think that I must reduce te code space memory but I don't know how? So I think to use Banking code and I look at this page http://www.keil.com/support/docs/1314.htm
But I don't understand vey well the next steps :
2)Select the number of code banks from the Banks drop down.
3)Enter the starting and ending addresses of the code banking area in the Bank Area input boxes.
which number I must choose? And the starting address and ending address how I determine it?
Thank yo
"I Think that I must reduce te code space memory"
Why? Your code fits; only just, but it does fit!
"but I don't know how?"
Have you actually read any of the suggestions that I've given you?
"So I think to use Banking code"
That will not reduce the size of your code!
Banking is a way to gain access to >64K code space. Do you actually have >64K of CODE memory? Do you have the hardware necessary to do bank switching?
As I said before, moving to code banking is not a trivial exercise!
Ok so I'll not use code banking. yes my program fit but can it be
Do you actually have >64K of CODE memory? Do you have the hardware necessary to do bank switching?
I think that I have 64 Kbytes limited because my µC is an Atmel AT89C51SNDC1 with 64KB.
I have another problem, my project has bugs and I will see where it's bugging in my code so when I launch de debug and when it comes to a printf the debug stopped and I can't debug my program for resolving So I have used that :
#ifdef DEBUG_ME printf functions #endif
And in a config.h file I define or not to use the debug. If I write this line : #define DEBUG_ME in the config.h file my code size become 58150 , so it's cool for debugging
But anyway I launch the debug it is running but nothing happens when I push F5 o F10, I can't follow the sequence of my program in my files? Could you help me for how to use the debug?
Thanks
"I think that I have 64 Kbytes limited because my µC is an Atmel AT89C51SNDC1 with 64KB."
You think?!
This is the kind of thing that you really need to know!!
:-0
Yes 64Kbytes but I can maybe increase this size because the specifications of this µC :
• 64K Bytes of Code Memory – Flash (100K Erase/Write Cycles) • 4K Bytes of Boot Flash Memory (AT89C51SND1C) – ISP: Download from USB or UART
Can I use maybe 4K bytes of boot Flash like code Memory , I don't know ?
And about debugging can you said me why my debug is stopping when in a line I have printf instruction ?