Part Number: MSP430FR5994
Tool/software:
Hello,
I have (had...) a project working flawlessly with DSPLib (using LEA for FFT calculations).
I decided to move DSPLib to a static library project and link to it.
Now, during execution, at different locations into the DSPLib code now linked into my application, a memory violation is generated.
It is a violation on a segment protected from execution.
I can always trace to the exact line that causes the violation. It is a CALLA to a valid address (0x39xxx) well outside the protected segment where the violation occurs (0x10000-0x16000).
Weird enough, the violation is not triggered on the same CALLA everytime but always on a CALLA. Always.
Each and everytime, the call address shown in the disassembly window, just before the violation occurs, is perfectly legal and valid. It is actually very close to the PC since that's a call from somewhere in the lib to elsewhere into the lib.
In the NMI, I have some code that inspects the stack to retrieve the called address and the expected return address upon an execution violation. This code has been working very well for a some time so I tend to trust the retrieved data. The called adress is 0x10000 which is the exact start of the protected segment being violated. So, that definitely looks like a real violation. However, the return address is absolutely invalid, way outside valid memory range.
Searching the binary file, I can find a the whole bunch of CALLA, perfectly valid, that apparently generate the violation. However, there is no CALLA to 0x10000. So it ought to be some indirect call ending at 0x10000... But tracing the code always show a valid CALLA as the last instruction being executed before the NMI. Always.
What is going on here???
It is very likely related to linking with a library but I realy can't explain nor fix it.
Regards,
Frederic