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.

Compiler/CC2538EMK: While compiling in IAR getting assertion failed error

Part Number: CC2538EMK
Other Parts Discussed in Thread: CC2538, Z-STACK

Tool/software: TI C/C++ Compiler

Hello,

We are trying to run example zstack.3.0 projects in cc2538 using SmartRF06 Evaluation board. We are getting below error.

Internal Error: [Front end]: assertion failed at: "Z:\Platforms\BaronBosse1\core\translator\compiler_core\src\parser\edg\interpret.c", line 1837
Error while running C/C++ Compiler

How to solve this problem, for your reference i have attached the screen shot

  • Hi,

    Have you made any modifications to the software? This error doesn't seem to be related to Z-Stack, what IAR version are you using?
  • Hi JasonB,

    We have not modified anything. We are just using the example project.

    We are using IAR Embedded Workbench for ARM Version - 8.11.2.13606

    IAR Embedded Workbench shared components Version 8.0.8.4892

    In this same IAR version, Z-Stack 1.2.2a worked. But now it's not working.In some other system also It's not working. We checked after the freshly installed. 

    Z-Stack 3.0 always giving this error. I don't know its respect to the IAR or Z-Stack. But we didn't change any code or anything.

    Thanks shiva.

  • Try to use IAR EWARM 7.70.1 to build CC2538 examples in Z-Stack 3.0

  • Thanks YiKai Chen,
    Can you send me that link? if you dont mine
  • You can download it from www.iar.com/.../
  • thank you YK Chen,

    Now its working fine.
  • Hi again,

    For anyone else coming across this issue, there is a known bug in the IAR ARM 8.11.2 release that causes this error. My recommendation would be to downgrade your IAR version to 8.11.1 since this is the version that Z-Stack 3.0.1 was tested with, but there is also a workaround available for 8.11.2. I have also received word from IAR that this issue will be resolved in the IAR 8.2.x release, set to release later this year.

    The commented out lines below is the original code, and the corresponding lines below that are the fixes.

    Change the following in OnBoard.h:

    // #define CSTACK_END ((uint8 const *)(_Pragma("segment=\"CSTACK\"") __segment_end("CSTACK"))-1)
    #define CSTACK_END ((uint8 const *)(_Pragma("segment=\"CSTACK\"") __segment_end("CSTACK")))
    

    Change the following in OnBoard.c:

    //for (ptr = CSTACK_END; ptr > CSTACK_BEG; ptr--)
      for (ptr = CSTACK_END, ptr--; ptr > CSTACK_BEG; ptr--)
      {
        if (STACK_INIT_VALUE == *ptr)
        {
          if (++cnt >= MIN_RAM_INIT)
          {
            ptr += MIN_RAM_INIT;
            break;
          }
        }
        else
        {
          cnt = 0;
        }
      }
    
    //return (uint16)(CSTACK_END - ptr + 1);
      return (uint16)(CSTACK_END - ptr);

  • Hi Jason ,
    I as facing the same problem and I have tried your suggested solution but its not working ,
    its showing more errors- unrecognized token


    I have made changes in OnBoard.c as shown below-
    ___________________________________________________________________________
    uint16 OnBoard_stack_used(void)
    {
    uint8 const *ptr;
    uint8 cnt = 0;

    //change made to avoid tool internal error
    //--------------------------------------------------------------------------------------------
    /*
    for (ptr = CSTACK_END; ptr > CSTACK_BEG; ptr--)
    {
    if (STACK_INIT_VALUE == *ptr)
    {
    if (++cnt >= MIN_RAM_INIT)
    {
    ptr += MIN_RAM_INIT;
    break;
    }
    }
    else
    {
    cnt = 0;
    }
    }

    return (uint16)(CSTACK_END - ptr + 1);
    */
    //--------------------------------------------------------------------------------------------

    for (ptr = CSTACK_END, ptr--; ptr > CSTACK_BEG; ptr--)
      {
        if (STACK_INIT_VALUE == *ptr)
        {
          if (++cnt >= MIN_RAM_INIT)
          {
            ptr += MIN_RAM_INIT;
            break;
          }
        }
        else
        {
          cnt = 0;
        }
      }
      return (uint16)(CSTACK_END - ptr);
    }
    __________________________________________________________________________________________

    I have made changes in OnBoard.h as shown below-


    //#define CSTACK_END ((uint8 const *)(_Pragma("segment=\"CSTACK\"") __segment_end("CSTACK"))-1) //change made to avoid tool internal error
    #define CSTACK_END ((uint8 const *)(_Pragma("segment=\"CSTACK\"") __segment_end("CSTACK")))
  • Which IAR version do you use? IAR EWARM 8.11.1 or 8.11.2?
  • m using IAR EWARM 8.11.2
  • You should use 8.11.1 to fix the issue.