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.

RF430FRL15x Project example code for IAR

The RF430FRL15x example projects use #pragma RETAIN( ) and #pragma CODE_SECTION statements not recognized by IAR EW 6.30.2. There is mention in the firmware users' guide that these are for CCS so I suppose this is not a complete surprise, however odd.

Are there not also examples available that will compile under IAR?

Is it indeed possible to say to IAR what needs to be said in these examples?

  • We have an IAR example that is for SensorHub.  It is attached.

    The other projects are portable or express able in IAR, however this has not been done yet.  Perhaps the attached project can be used as an example of how to do that.

    /cfs-file/__key/communityserver-discussions-components-files/667/RF430FRL152H_5F00_SensorHub_5F00_IAR_5F00_6_5F00_2.zip

    For example in CCS:

    #pragma RETAIN(variable)

    for IAR this would be translated to:

    __root int variable;  

    This is used to force the compiler to include the variable in the program.  This is needed when the variable is not referenced by the program but the memory needs to be allocated.

    CODE_SECTION is used to constrain the placement of a function to a specific region of memory.

    Further information on these compiler symbols can be found here for CCS:

    http://www.ti.com/lit/ug/slau132j/slau132j.pdf

    for IAR the pertinent documentation would be in the IAR installed directory, Embedded Workbench Ver/430/doc and one of the files that is useful is EW430_CompilerReference.pdf

  • The sample project you offer is very instructive and I thank you for it. 

    But it, too, fails to build.

    IAR 6.30.2 doesn't like the project file and supplies one in its own new format. That is automatic and not a problem.

    During link I got a "cannot open.. .xcl" complaint.  Changing the path in the loader configuration override option so it points to where that custom file is in my folder hierarchy instead of to where it was in the original one fixed that complaint.

    But now during link I have Fatal Error [e72] at line 111 in the custom .xcl file that was supplied as part of the project.  The line is -QCODE_I=CODE_ID, and the complaint is that CODE_ID has not been defined in a -Z, -b, or -P statement. And indeed it has not.

    It does not look like the project depends in any way on that means of "placing functions in read/write memory" so I suppose I could just remove the line, but this is a custom file offered as a correct example so I am reluctant to do that.

    What is the intent there?

  • OK. I see the intent.  The error is flagged on line 111; Line 151 is where the missing symbol used to be defined. That line has been commented out, presumably to clean things up in an application that does not use the storage type. Whoever did that forgot to also comment out line 111, and apparently did not rebuild to make sure it would all work.  I commented out line 111 and it all links now.

    Thanks again for the sample project. Now I see most of what I need to know, and can experiment to learn the  rest.

    Phil