AnsweredAssumed Answered

Problem calling static class-function from interrupt (ADSP-21469)

Question asked by Daniel_Sch_ISEA on Mar 18, 2015
Latest reply on Nov 15, 2016 by Kader.M



I encountered a strange problem using VisualDSP++ (v5.0.10.0) to develop code for SHARC ADSP-21469.

I have a working project file with all my code files, which includes, amongst others, an interrupt function serving a DAI falling-edge interrupt. This function reads the corresponding interrupt latch register and then executes a function,


that is defined to be static in the class "classA":


               static void IRQhandler();


               void CAN::IRQhandler(){

                    // some code


This function serves as an "interrupt handler" to do some tasks (communication with an external IC connected via AMI, data access (read/write) on a std::map, that is a static member variable of the class).


Everything worked fine until i decided to restructure the project. I created a second project, moved quite a lot of the code into the second project. I created a project group in VisualDSP++, added both projects and set the new project to create a "Library file" (*.dlb) in the project options. This file is included in the first project's "Linker Files" folder and there is a link to the second project as project dependency.

Everything compiles fine, but the IRQhandler() function does not work anymore when calles from within the interrupt function.

The make it more specific: the interrupt itself is still there, but the function call seems not to work properly.

For testing, i calles the function IRQhandler() in the main-function of my project and there it is called without any problems.


I also used the asm("nop; mark_xxx:"); command to set marks at different positions in the code. I then loaded the program in the VisualDSP++ simulator and searched for the marks in the disassembled code. The calls (cjump) to the functions are there in both cases, function call in interrupt and function call in main, but unfortunately, the function seems not to "work" in the interrupt.


I'm preparing some additional code to monitor, if the function is even successfully called and will report here. However, maybe someone encountered a similiar problem and found a solution to this.


Thanks in advance and best regards,