Hi,
I have multiple L15 link warning (MULTIPLE CALL TO SEGMENT).
Referred to:
http://www.keil.com/support/docs/805.htm and fixed one. But how do i fix the rest.
When I use the OVERLAY command in a linker control file, or directly under BL51 Misc, I am not able to add more than one. I tried comma, semi-colon etc but nothing works.
How do I use the command - OVERLAY (sfname ! *), for multiple functions that I need to remove from overlay.
Thanks
Regards, R
if so, you can do it inside multiple souce files why not use optimize 2
Erik
Thanks for the reply.
I am referring to C codes. I get multiple warnings like below:
***WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?_WRITE_GMVLX1_REG?D_GMVLX1 CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP
***WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?_SPI_SEND_WORD?D_SPI CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP
***WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?SPI_RECEIVE_WORD?D_SPI CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP
So I need to overlay all the 3 functions (all called in background potentially by radio interrupt)
It is very clear to me when you say "inside multiple source files". Can you explain further.
Also I need to use Optimize 8 to achieve my size target.
Thanks R
In C51, calling functions from both main (or "startup", as the Linker sees it) & interrupts is best avoided.
Do you really need to do this?
Overlays and interrupts are not something you would like.
Just as calling a function both from main() and from an ISR.
All functions called from an ISR really should be available at all times. And you can make duplicate copies of functions that you really do need to call from an ISR. So one do_xx() and one do_xx_from_isr(). Then you can have the do_xx_from_isr() together with the ISR make use of a separate register bank. And the compiler/linker will not have to try to figure out how any local variables upgraded into constantly reused global variables will be accessed by the ISR.
Calling functions (marked reentrant) from both main and its children and an ISR is possible, yes ... but I guess that doing so is asking for something that will take an awful lot of thought to believe safe as well as, most likely, causing a "dumb little nagging very rarely occurring bug".
I have had experiences with the result of this (done by others) and have thus established a "personal rule": "functions may under no circumstances be called from main and ISR".
With assembler code, the coder can see all code and know what happens.
With C code and the C compiler needing helper functions and playing around with auto variables upgraded to global variables, it really isn't obvious what happens when having an 8051 function shared between ISR and main loop. So best to avoid it.
With assembler code, the coder can see all code and know what happens. actually one of the cases I mentioned above was written in asssembler.