Discussion Forum

too many Warnings and errors after file implementation

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Alli Bas
Posted
11-Mar-2007 12:13 GMT
Toolset
C51
New! too many Warnings and errors after file implementation

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

Read-Only
Author
Alli Bas
Posted
11-Mar-2007 12:30 GMT
Toolset
C51
New! RE: too many Warnings and errors after file implementation

Hi,

After changing path of header file I have other results but again errors. Another Error L107: Address space overflow.

-My option configurations:

My memory model is : Large variable in XDATA
Code Ram size : Large 64 K program
Operating system : none

-Part of the output is:

LENGTH: 0030H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?_TEA6320_WRITE_BYTE?I2C LENGTH: 0027H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?_EEP2408_WRITE_BYTE?I2C LENGTH: 0027H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?FAT_FEOF?FAT LENGTH: 0027H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?PUTCHAR?PUTCHAR LENGTH: 0027H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?COMMANDE_DE_LED?ADC LENGTH: 0025H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?_FILE_ENTRY_DIR?FILE LENGTH: 0025H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?FAT_SAVE_CLUSTER_INFO?FAT LENGTH: 0025H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?_PCF8574_WRITE_BYTE?I2C LENGTH: 0024H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?_EEP2408_READ_BYTE?I2C LENGTH: 0024H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?MAIN?MAIN LENGTH: 001FH
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?MP3_INIT?DONG2 LENGTH: 001CH
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?WATCH_DOG?ADC LENGTH: 001BH
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?FAT_FCLOSE?FAT LENGTH: 001BH
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?INIT_I2C?I2C LENGTH: 0018H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?START_TIMER?I2C LENGTH: 0016H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?IDE_READ_8_DATAWORD?IDE_DRV LENGTH: 0016H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?GETCHAR?GETCHAR LENGTH: 0014H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?_ISSPACE?ISSPACE LENGTH: 0014H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?GETCHAR0?ADC LENGTH: 0011H
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?AUDIO_INIT?AUD LENGTH: 0010H .....
.....
...
..

thank you

Read-Only
Author
Drew Davis
Posted
11-Mar-2007 20:40 GMT
Toolset
C51
New! RE: too many Warnings and errors after file implementation

"Uncalled segment" means that your files contain code that is not used in your project. This code takes up space, and what is often worse, serves as another root for the call tree for parameter and local variable overlay. You should avoid linking unneeded code into your project. Also, see the REMOVEUNUSED linker directive.

"Address space overflow" means that your code does not fit into the available memory. You've got more than 64KB of code, and so something has to go. You can try higher levels of optimization, emphasizing space. But you might have to roll up your sleeves and rewrite some code to do the same job in less space. Alternatively, you need to use more memory (and since you've reached the 64KB limit, that means bank switching, which may mean hardware changes for the banking logic in addition to a larger RAM).

Read-Only
Author
Ali Bas
Posted
30-Mar-2007 13:48 GMT
Toolset
C51
New! RE: too many Warnings and errors after file implementation

Hi,

Now I have too many warnings L118 but again ERROR L107 address space overflow in space code, this error has occur when I remove the #if 0 #endif from a big function.

How can I do to resolve this problem, it's very hard to find a solution to this ?

Thank you

Read-Only
Author
Andy Neil
Posted
30-Mar-2007 13:56 GMT
Toolset
C51
New! First things first!

"ERROR L107 address space overflow in space code, this error has occur when I remove the #if 0 #endif from a big function."

So, you add a large amount of code (a "big function"), and then your code space overflows - why would that be a surprise to you?

Once you've had an error like that, it is likely to cause errors in everything else the Linker subsequently does!

Therefore, you need to fix the first error, then rebuild and see how many are left...

Read-Only
Author
erik malund
Posted
30-Mar-2007 14:19 GMT
Toolset
C51
New! RE: too many Warnings and errors after file implementation

Now I have too many warnings L118 but again ERROR L107 address space overflow in space code, this error has occur when I remove the #if 0 #endif from a big function.

How can I do to resolve this problem, it's very hard to find a solution to this ?

Not very hard, reduce the size of your code or increase the size of your code memory (if you are below 64k)

A one gallon bucket can not hold two gallons of water.

Are you using a small derivative and have specified the max code size to match, or are you overflowing 64k?

Erik

Read-Only
Author
Andy Neil
Posted
30-Mar-2007 16:31 GMT
Toolset
C51
New! Overflow just keeps happening!

"A one gallon bucket can not hold two gallons of water."

And every single extra cup you try to put in will each cause further overflow!

Read-Only
Author
Sems Gencay
Posted
31-Mar-2007 22:38 GMT
Toolset
C51
New! RE: Overflow just keeps happening!

Thanks,

It's my code Rom which is overflowed

Are you using a small derivative and have specified the max code size to match, or are you overflowing 64k?

I use in options target in target tab :

Memory model : Large variables in XDATA
code Rom size: Large 64 K program
Operating system : None

I think it is otpimal memory sizing, can I do anything else to grow up my rom size

Read-Only
Author
Andy Neil
Posted
31-Mar-2007 23:37 GMT
Toolset
C51
New! Why the change of name?

What happened to Ali Bas?

"It's my code Rom which is overflowed"

Not quite.

The Linker doesn't know anything about your hardware - all it knows about is 8051 address spaces.
It is telling you that the 8051 CODE address space has overflowed.
(that may happen to be mapped to your ROM, but the Linker doesn't know that)

"I use in options target in target tab :

Memory model : Large variables in XDATA
code Rom size: Large 64 K program
Operating system : None"

So you've told the Linker that you have 64K of CODE space available. The Linker is telling you that your code will use more than that available space.

"I think it is otpimal memory sizing"

Why do you say that?
Does it actually reflect the amount of memory available on your target?

"can I do anything else to grow up my rom size"

The 8051 architecture is inherently limited to 64K of CODE space - because the address bus has 16 bits.

So your only options to increase CODE space are:
1. Use Banking (or "paging");
2. Use an extended 8051 derivative with >16 address bits.

The other approach is to reduce the size of your code to fit into the available space.

See http://www.keil.com/forum/docs/thread1082.asp for some tips

What optimisation level are you using?

Using XDATA for variables can use a lot of code space - because of all the loading & reloading of the 16-bit DPTR. Moving your most-used variables to DATA (preferably) or IDATA could significantly reduce code size - I have seen a reduction of several K bytes by doing this!

You can identify your most-used variables by using the uVision Source Browser:
http://www.keil.com/support/man/docs/uv3/uv3_ut_sourcebrowser.htm
Click on the title of the 'Uses' column to sort by the number of times a symbol is referenced...

Read-Only
Author
Ali Bas
Posted
1-Apr-2007 13:24 GMT
Toolset
C51
New! RE: Why the change of name?

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

Thank you

Read-Only
Author
Ali Bas
Posted
1-Apr-2007 13:31 GMT
Toolset
C51
New! RE: Why the change of name?

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?

Thank you

Read-Only
Author
ninja Z
Posted
2-Apr-2007 04:28 GMT
Toolset
C51
New! RE: Why the change of name?

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.

Read-Only
Author
Andy Neil
Posted
2-Apr-2007 07:03 GMT
Toolset
C51
New! Some variables must be in XDATA

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).

Read-Only
Author
Andy Neil
Posted
2-Apr-2007 06:55 GMT
Toolset
C51
New! Why the change of name - again?!

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

Read-Only
Author
Andy Neil
Posted
2-Apr-2007 07:10 GMT
Toolset
C51
New! Reconsider use of 8051?

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!

Read-Only
Author
Sems Gencay
Posted
2-Apr-2007 08:39 GMT
Toolset
C51
New! RE: Reconsider use of 8051?

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

Read-Only
Author
Sems Gencay
Posted
3-Apr-2007 09:05 GMT
Toolset
C51
New! RE: Reconsider use of 8051?

Hi,

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 ?

Read-Only
Author
Andy Neil
Posted
3-Apr-2007 09:47 GMT
Toolset
C51
New! Reducing code size

"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.

Read-Only
Author
Sems Gencay
Posted
3-Apr-2007 12:17 GMT
Toolset
C51
New! RE: Reducing code size

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

Read-Only
Author
Andy Neil
Posted
3-Apr-2007 13:13 GMT
Toolset
C51
New! RE: Reducing code size

"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!

Read-Only
Author
Sems Gencay
Posted
3-Apr-2007 16:24 GMT
Toolset
C51
New! RE: Reducing code size

Thank you

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

Read-Only
Author
Andy Neil
Posted
3-Apr-2007 16:41 GMT
Toolset
C51
New! Know your target!

"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

Read-Only
Author
Sems Gencay
Posted
4-Apr-2007 07:51 GMT
Toolset
C51
New! RE: Know your target!

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 ?

Thank you

Next Thread | Thread List | Previous Thread Start a Thread | Settings