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.

Fatal Error ALTVECT_ID in IAR

Other Parts Discussed in Thread: MSP430F5438

I'm starting to work on an old project originally compiled on some past version of IAR workbench. I've brought the code into ver 6.50.2 of the software and when I rebuild it I get a fatal error as follows:

Fatal Error[e72]: Segment ALTVECT_ID must be defined in a segment definition option (-Z, -b or -P)

Using a Find in Files search for any instance of ALTVECT_ID results in the following code sections within a file called cstartup.s43.

section1:

//
// Ensure that this is build with the same "positions independent
// code" settings as the compiler uses.
//

        XPICRTMODEL


//
// Forward declarations of segments.
//

        RSEG    HEAP:DATA:NOROOT(1)

        RSEG    CSTACK:DATA:NOROOT
        RSEG    DATA16_Z:DATA:NOROOT
        RSEG    DATA16_I:DATA:NOROOT
        RSEG    DATA16_ID:CONST:NOROOT

        RSEG    CODE_I:DATA:NOROOT
        RSEG    CODE_ID:CONST:NOROOT

#if __CORE__==__430X_CORE__
        RSEG    DATA20_Z:DATA:NOROOT
        RSEG    DATA20_I:DATA:NOROOT
        RSEG    DATA20_ID:CONST:NOROOT
#endif
        
        RSEG    TLS16_I:DATA:NOROOT
        RSEG    TLS16_ID:CONST:NOROOT
        RSEG    ALTVECT_ID:CONST:ROOT
        RSEG    ALTVECT_I:DATA:ROOT
        
        RSEG    IMAGE_END:CONST:ROOT

section2:

?cstart_altvect_copy:
        MOV     #SFE(ALTVECT_I-0x80),  CW0        // dest
        XMOVROPIADDR SFB ALTVECT_ID, CW1          // src
        MOV     #sizeof ALTVECT_ID, CW2           // len
        XXCALL  __data16_memcpy

I'm out of my element as I'm not familiar with the machinations of the cstartup.s43 file's purpose and how to correct the error as such.

  • Hi Kevin,

    The command linker file must have been updated between IAR versions and the segment definition for CONST:ROOT no longer exists. You can try changing to CONST:NOROOT (as this segment appear to be defined) or alter your .xcl file to your preference. The same issue will probably occur for IMAGE_END as it is defined in the same non-existent segment.

    Regards,
    Ryan
  • This is a good argument for copying the linker command file (.xcl file in the case of IAR) into your project directory and changing the project settings to use that instead of the toolchain default.

    Do you have any idea what older version of IAR this project was originally developed on? What MSP430 device are you using. I may be able to help with the .xcl file contents (this is the toolchain I use).
  • IAR also has a support line https://www.iar.com/support/ that you can ask where to find the old .xcl file for the device.

    Another option would be to get the old installation CD from your company's internal Software CM Repository and install that on a VM and extract the file you need.
  • Thanks for the replies.

    We're using the MSP430F5438.

    I actually have the original install CDs sitting next to my monitor as I type this, so that's certainly a feasible option. According to the sales paperwork it looks like the install version was originally v5.52. I think the trick is that the software was originally written by an outside contractor and we purchased the code from them after-the-fact. If my memory serves me correctly I have compiled the code on the CD software version without any conflicts on an older version of IAR but it's been ages since I've done so. I'll go back and create a VM or grab another box that I can install the original software on, grab that file you speak of  and see how it goes.

  • Interesting. I have 5.50.1 version (among others) installed on my PC, and I find no reference to the ALTVECTOR_ID keyword in any of the source/include/command files in the installation.

    Are you sure that this wasn't something custom added to your code base and you are either a) missing the .xcl file, or b) it's there but the project settings aren't set to use it?

**Attention** This is a public forum