Discussion Forum

[C51] OVERLAY between MAIN and ISR

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

DetailsMessage
Read-Only
Author
Nicolas Dries
Posted
20-Nov-2009 10:11 GMT
Toolset
C51
New! [C51] OVERLAY between MAIN and ISR

I have an issue with overlayed variables.

Some locals variables function used within the MAIN call tree context are overlayed with local variables used within ISRs call tree context.

So, when ISR is executed, main local variables are corrupted...

how can I prevent this overlay within the linker file ?

Any ideas ?
Thanks for your support !

Read-Only
Author
Christoph Franck
Posted
20-Nov-2009 10:15 GMT
Toolset
C51
New! RE: [C51] OVERLAY between MAIN and ISR

how can I prevent this overlay within the linker file ?

Are you calling functions from both main and the isr? In that case, you may have to declare them as reentrant, or include two copies of the same function, one for calling from main and one for calling from the isr.

Read-Only
Author
Nicolas Dries
Posted
20-Nov-2009 10:22 GMT
Toolset
C51
New! RE: [C51] OVERLAY between MAIN and ISR

no, functions are only called either within the main or ISR, but never both.

This is also well analyzed within the map file, where differents call tree are shown.

Read-Only
Author
Hans-Bernhard Broeker
Posted
20-Nov-2009 15:36 GMT
Toolset
C51
New! RE: [C51] OVERLAY between MAIN and ISR

how can I prevent this overlay within the linker file ?

You should never have to --- the linker does call tree analysis to be able to prevent this without your help.

So unless you broke it explicitly (e.g. by using the linker's call tree modification instructions), this can't happen. We'll need a more concrete description of what you're doing. A minimal example with the actual compiler and linker options would be helpful.

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