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.

MSP430-GCC-OPENSOURCE: Discrepancy of attribute "interrupt" between Official GNU Doc and Mitto GCC:

Part Number: MSP430-GCC-OPENSOURCE
Other Parts Discussed in Thread: MSP430G2553

GNU GCC official Document indicates that attribute "interrupt" takes VECTOR SLOT NUMBER as argument, while Mitto GCC takes VECTOR OFFSET.  Take NMI & MSP430G2553 for example: official GNU doc suggests __attribute__((interrupt(30))), while SLAU646F suggests __attribute__((interrupt(NMI_VECTOR))), while NMI_VECTOR = 15 in msp430g2553.h.

Is it possible to make Mitto GCC into mainline verion and rewrite official GCC document?


https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/MSP430-Function-Attributes.html#MSP430-Function-Attributes

"... If the argument is a number it indicates the slot in the interrupt vector table (0 - 31) ... nmi for vector 30."


SLAU646F & MSP430x2xx(MSP430G2553) header files & SLAU144J

SLAU646F MSP430 GCC User's Guide (Rev. F) - TI.com


interrupt(x)

Make the function an interrupt service routine for interrupt"x".

MSP430g2553.h
* Interrupt Vectors (offset from 0xFFE0)
#define NMI_VECTOR              (15)                     /* 0xFFFC Non-maskable */

SLAU144J - MSP430x2xx Family User's Guide (Rev. J)


[Edited] SLAU646E -> SLAU646F(blame Bing search engine)

  • I'm not quite sure what your concern is. Is it the discrepancy between "slot number" (index) and "offset"?

    I'm not sure "offset" is strictly incorrect, but I suppose it could be read that way. That definition of NMI_VECTOR is clearly an index. I would say that if one were to choose, "slot number" (index) is more correct.

    The word "offset" doesn't appear in my copy of SLAU646F (I don't have Rev E). Section 5.1.1 doesn't use either term.

    [Edit: I think I see what you mean -- " nmi for vector 30" is part of the text, not your commentary. This section should not attempt to give any examples, since the vector numbers are (in general) different on each device. NMI is vector 30 on, e.g. the F2619, but on the F2012 it's vector 14. I would vote for throwing out that entire sentence.]

  • In SLAU144J (for entire MSP430x2xx series, comprising F2619 and F2012), NMI priority = 30, and offset(from 0xFFE0) = 15. SLAU646F doesn't mention what actually argument "interrupt" takes but in header files NMI_VECTOR = 15.

    Official GNU doc suggests __attribute__((interrupt(30))) for NMI, while SLAU646E & header files suggests __attribute__((interrupt(15))).

  • Thanks for pointing this out, indeed since the vector table numbers are different on each device, the documentation should not attempt to specify any default values.

    I'll get that documentation updated.

  • It is clear that official/mainline GCC support for MSP430 is very outdated. Please consider patching to mainline GCC.

  • Chapter 9 of SLAU646F suggests that reader "Refer to the MSP430 Options section" of  https://gcc.gnu.org/onlinedocs/gcc.pdf but it is outdated. -minrt is deprecated, attribute "interrupt" doesn't take SLOT NUMBER anymore, ...

**Attention** This is a public forum