This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using #pragma vector with MSP432

Expert 1635 points

Hi,

I am currently evaluating the MSP432 both for new designs and as a possible port for MSP430-based designs.  As part of the evaluation and as a way to compare apples to apples I have ported parts of projects and compared some parameters of interest.

A problem arose when I was trying to do ISRs the MSP430 way instead of the new table approach, which is OK and it works but imposes in C++ projects with ISRs defined as static members of a class the overhead of having to wrap them in a function to be able to include them in the table.

So the problem is that if I do, for example:

#pragma vector = 0x60u

__interrupt void my_class::my_isr( void )            // A static member of my_class

{                                                                        // This is line 652

...

}

I get:

>> Compilation failure

INTERNAL ERROR: /home/swdev/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armacpia experienced a segmentation fault while processing function (unknown or file scope) file ../stim.cpp line 652

This is caused by a defect in the compiler itself. TI Customer Support may be able to suggest a workaround to avoid this.

The same code (without using #pragma and __interrupt), but using a wrapper instead: 

void c_my_ISR( void ) { my_class::my_isr(); }   // a friend of my_class

compiles and works fine.  Any explanation for this?

Thanks,

Pibe

  • Unfortunately, you have uncovered a bug in the TI ARM compiler.  I can reproduce it.  I filed SDSCM00052565 in the SDOWP system to have this investigated.  Feel free to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • Thanks. I hope this gets fixed soon.
  • Hi Pibe,
    you might already know this, but for the benefit of everyone who might stumble upon this thread trying to resolve the same issue:
    Until the fix is available, in the meanwhile you can still use the ARM-style interrupt vector declaration using the startup_msp432p401r.{c/s} where you have to manually plug all interrupt service routines. Assuming you are using CCS, you should be able to get the stock file when creating a new MSP432 project.
    Example: this file has the port 1 ISR plugged into the interrupt vector table.

    main.c only needs to refer to the port 1 ISR as a regular function.
    dev.ti.com/.../

    ~Dung
  • Dung,
    Your links do not point to any specific file. Do you mean if I have used the standard method of populating the table contained in msp432_startup_ccs.c? As I said in my post, I did and it works fine, but it is not good enough for the case I mentioned.
    Pibe