I have four functions that the linker gives me the warning:
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?UART_RX_ISR_STUB?ISR *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?TIMER0_ISR_STUB?ISR *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?TIMER2_ISR_STUB?ISR *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?ASDC0_ISR_STUB?ISR
Steve, Maybe you could try forcing the functions into the overlay map by putting in dummy calls in a conditional block: if(0) { a(); b(); c(); d(); } If the compiler optimises it all out, do: unsigned char volatile x=0; if(x) etc Stefan
"Maybe you could try forcing the functions into the overlay map by putting in dummy calls in..." Better to do it with the appropriate Linker directives? Have a search through the knowledgebase; a look at the stuff on function pointers might also help?
The way C51 does its work, it has to know about all possible execution paths. This means that calls into the compiled code from out of the blue, which the compiler knows nothing about, are essentially forbidden. You have to tell the compiler about those functions being called from elsewhere. That's where the OVERLAY linker control enters the game. Use it.
"That's where the OVERLAY linker control enters the game. Use it." Yes - that's what I was thinking!
Okay I'm now using the OVERLAY directive for this. Works well, thank you. One more question ... say for example I didn't want my project to have a main(). The reason is, the app is launched from my bootloader code which lives at 0000H. My app lives at 0C00H and doesn't need a main(). Without a main(), the project cannot be compiled because overlaying does not occur and overflow happens. Instead of specifying the OVERLAY directive for every single function in my project, can I specify the OVERLAY directive for the entire project?
What linker actually looks for, is segment ?C_C51STARTUP. Usually it is defined in startup.a51 but you can define it in your custom startup code.
Can you give me some clues as to where to look on how to do that?
There's nothing that forces you to use OVERLAY directives for "every single function in your project". You should only have to do that for a small number of functions that are actually called from outside the project. You have to help the linker, but you don't have to do all of its work yourself. Another possible way out might be to link your boot loader into the app. Then cut it out of the .hex file before downloading that into the chip.
Yeah... But, why should I have to use the OVERLAY directive for ISRs in which the C51 compiler generates the interrupt vectors? Using INTVECTOR=0x8000... Ref.---------- linking... *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?RESUME_ISR?FW
"Yeah... But, why should I have to use the OVERLAY directive for ISRs in which the C51 compiler generates the interrupt vectors?" You don't, and that wasn't the subject of the original post. The original post was talking about calls from a separate Project (a boot loader, in fact).