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.

IAR Tools Migration Problem

All:

I am trying to migrate F5528 code from IAR Tools 5.51.6 to 6.10.2

I get a fatal linker error that I do not understand:

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

 

However, if I look at the existing linker command file, DATA16_SEGMENT1 is defined:

-Z(CONST) DATA16_SEGMENT1=4600-47FF

 

I tried to change (CONST) to (CODE), but that did not get rid of the error. Has anyone seen an error like this when migrating?

  • By the way, the code that references segment 1 looks like this:

    #pragma constseg=DATA16_SEGMENT1

    const char segment1[FLASH_SEGMENT_SIZE];

     

    The linker error appears to be pointing at the usage and saying it is not defined, but this construct worked on 5.51.6, and does not work on 6.10.2 - and I am not finding anything in the release notes that tells me what I need to change...

  • Todd Anderson78572 said:
    ...However, if I look at the existing linker command file, DATA16_SEGMENT1 is defined:...

    Is that existing linker command file actually being used by the linker in your project?

  • Thank you for pointing that out...on to the next error, which has nothing to do with the linker...

  • I would like to get more information on the following:

    "Version 5.52 adds improved optimizations, new Call Graph and Macro Quicklaunch windows, project connection functionality and improved Source Browser performance."

    It looks like a major improvement is going to MSP430 base instead of MSP430x...

    I have one routine that puts an 8-bit value onto a port address, then toggles an I/O to allow that value to be written to external flash memory. On past IAR tools, (v. 5.51.6) I measured the pulse width at ~640 usec (or 5 cycles at 8 MHz).

    With version 6.10, I measured the saem pulse width - now ~310 usec. So, my takeaway is that the optimizer has been able to invoke the MSP430 base on those instructions rather than the MSP430x base.

  • Todd Anderson78572 said:

    I have one routine that puts an 8-bit value onto a port address, then toggles an I/O to allow that value to be written to external flash memory. On past IAR tools, (v. 5.51.6) I measured the pulse width at ~640 usec (or 5 cycles at 8 MHz).

    With version 6.10, I measured the saem pulse width - now ~310 usec. So, my takeaway is that the optimizer has been able to invoke the MSP430 base on those instructions rather than the MSP430x base.

    Are you sure you are using 8 MHz MCLK?

    It is not possible for either MSP430 or MSP430X to toggle a Port pin in ~310 usec with 8 MHz MCLK.

    Why don't you use the disassemble to examine the machine code generated by both versions to toggle that Port pin?  

  • Sorry, I mistook ~310 usec as ~310 nsec.

    5 cycles at 8 MHz is 625 nsec

  • OCY:

    yes, you are correct. It should be nsec, not usec.

    Is it possible that the change was made with the JTAG download?

    I noticed that the IAR 5.51 uses an earlier supported JTAG; when I go to IAR 6.10, the JTAG gets updated.

    We have some code that offloads an external flash memory and sends it to the host via USB.

    With IAR 6.10, that mechanism runs twice as fast as it did with IAR 5.51 - same code, same optimizations, but

    the differences are 1) Obviously different compiler version.  2) Updated JTAG software.

    So far, it looks really good!

**Attention** This is a public forum