This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Library containing an ISR

Hello,

Let me start by saying that I have solved the problem I will describe below in what I consider a not so elegant way. I am curious to know why previous attempt I have made failed so here I am.
I have 2 executables - A and B. I want to add B to A as a library (hoping to reuse B later for similar processors...). B contains an ISR that I prefer keeping in B. When I build B as a library and resolve all the obvious issues after inserting into A (SysTick, configuration etc.) I see that A fails. The map file of A indicates why: the ISR contained in B remained unresolved but linking succeeds because it is a weak function. I tried to explicitly import it to no avail.
What I did not try it remapping the vector table and changing the cell dedicated to the IRQ in question to contain the address of the handler in B. What I did try and works was build the ISR into A and call an API in B to handle it.
I wonder why ISR names cannot be resolve during link time - or maybe the toolchain can do that but I missed the method?

Thanks in advance.

Parents Reply Children