This is a strange thing. The vector-pragma should tell compiler and linker implicitly that the code needs to be placed in the lower text, as there cannot be any 20 bit vector. Teh CODE_SECTIONS pragma tells the linker that the code has to be placed in the _isr part of t .text (which is always in lower 64k). But without the vector pragma, nobody knows that an interrupt vcector should point to it. The warnings for undefined sections are strange. It seems that the code (or rather, the linker script) in your project doesn't really match the way interrupt vectors are handle dby your current IDE. This may happen when you have old projects and update the IDE. If it were for the wrong placement of code, th elinker would complain for overfull section (trying to put a 20 bit address into a 16 bit verctor section. Now you say you use a proxy vector table. If you do, then the 16 bit vectors point into the table, and the table contains the real ISR address - which can very well be 20 bit. In this case, the real ISR can be located anywher ein memory, only the proxy table (or the jumptable) needs to contain (jump instructions with) 20/32 bit address of the ISR. In any case, the compiler needs to know that the function is an ISR. Else the compiler doesn't know that it has to end with an RTI instruction and that R12-R15 need to be preserved. The __interrupt keyword does this.
↧