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 7.6 linker error

Other Parts Discussed in Thread: CC2430, CC2530, Z-STACK, MSP430F249

I am a beginner using the trial version of IAR 7.6. I follow the example in CC2430 Development Kit User's Guide to create the example blicky.c. But I got the error below:

Changed settings forces a full rebuild...
Building configuration: test
Updating build tree...
 
3  file(s) deleted.
Updating build tree...
main.c 
Linking
Internal Error: In function: 
Diagnostic: Value is too large to be represented as a unsigned 32-bit quantity.
P0: 0    P1: 0
Error while running Linker

Can anyone help?

Ng

  • P0: and P1: are probably not valid unless being used to override the default display format,  without seeing a few lines of code it is hard to tell.

    Try

    P0 = 0;
    P1 = 0;

  • By trial and error, I found that it was my mistake in using the wrong linker file. I used to one without a "b"!.

    Thanks for the reply anyway.

  •  

    If you use CC2430F128 you need to use the linker file named b. It reflects banked mode for the IAR EW8051

    LPRF Rocks the World

     

  • I have a CC2530DK (the dev kit), featuring the wonderful TI CC2530 (256).  My working linker file was at

    C:\Program Files\IAR Systems\Embedded Workbench 5.4 Evaluation\8051\config\devices\Texas Instruments\lnk51ew_cc2530F256.xcl

  •  I encountered the same problem, would you please give more details about how to deal with it? Thank you.

  • To change the linker file:

    -Right click on the top level project file in the 'Workspace' window

    -Select 'Options'

    -From the 'Category' box on the left, select 'Linker'

    -Select the 'Config' tab

    -In the 'Linker command file' box, make sure 'Override defaults' is checked

    -Choose the proper linker file

     

    For me (SmartRF05EB, rev 1.8), the proper linker file was

    C:\Program Files\IAR Systems\Embedded Workbench 5.4 Evaluation\8051\config\devices\Texas Instruments\lnk51ew_cc2531F256.xcl

  • , thank you for your quick response.

    I change the linker file to "$TOOLKIT_DIR$\config\devices\Texas Instruments\lnk51ew_cc2530F256.xcl", and it works! 

     

    I use IAR 7.60.1 to rebuild a project which goes on well with IAR 7.51A, then the above problem occurs.

    Now it can be compiled without any error or warning after changing the linker file. (Thanks again.) But the running result is not correct.  The alert below pops up while debugging:

    Warning: Possible IDATA stack overflow detected. Reset target to re-enable overflow check.

    I guess there may be something wrong with the "options"... I'm not sure how to set. Are there any documents about the "options“ settings?

     

  • Sorry, the alert "Warning: Possible IDATA stack overflow detected. Reset target to re-enable overflow check." may be a debug interface connection problem.

    The result is still not correct. Debugging now...

  • Under the general options / Stack Heap tab, you can set the size  of the stacks and heaps. The default for IDATA generally comes up as 0x40 which is too small. I set it to 0x80.

  • I just want to clarify a couple of things related to the problem reported in the first message in this thread.

    IAR did a few modifications in the linker and linker files from rev 7.51 to 7.60 of the tool chain. Basically, the linker files now contain fewer "dummy" options that were historically required by the linker, and several values needed by the linker are now set on the command line when calling the linker. It's the IDE that determines what values to set depending on the project options.

    More specifically, when using BANKED code model, the two values CODEBANK_START and CODEBANK_END are defined on the command line, and the values depend on the device. However, when using NEAR code mode, these two values are set to 0.

    The reported problem arises when you have selected the NEAR code model but use a linker file that is supposed to be used for BANKED code model. You'll see in the linker files for banked code model that e.g. the value (_CODEBANK_START - 1) is being used to determine some ranges etc. So if CODEBANK_START has the value 0, the linker will have serious problems understanding what's going on and returns the "Internal Error" message.

    The same construct was not used in the linker files in v7.51, so you don't have the same problem there.

    Anyway - the clear recommendation is to use different linker files for BANKED code model and NEAR code model. Default linker files (both BANKED and NEAR) are provided with the tool.Thus, for e.g. CC2530F256:

    When using BANKED code model, the tool will automatically select the linker file $TOOLKIT_DIR$\config\devices\Texas Instruments\lnk51ew_CC2530F256_banked.xcl

    When using NEAR code model, the tool will automatically select the linker file $TOOLKIT_DIR$\config\devices\Texas Instruments\lnk51ew_CC2530F256.xcl

    (note that auto selection of linker files has improved since v7.51)

    You can of course override which linker file you want to use (which we e.g. do for Z-Stack), but then you just need to be aware of the things mentioned above.

    Note that IAR themselves may be able to provide more insight into this matter, as the above only refers to my own analysis of the problem. I would anyway recommend that you read the IAR "Linker and Library Tools reference Guide" (included with IAR) to get an even better understanding of all of this.

  • I am a bit confused here. I have cc2530ZDK and saw exact same error. I see config file located at two different places.

    1. $TOOLKIT_DIR$\config\devices\Texas Instruments\lnk51ew_cc2530F64.xcl

    2. $TOOLKIT_DIR$\config\*.xcl   which one is ideal? Also ZDK doesnt mention cc2530 is F64/32/128? for now I could resolve the errr by chosing 1.

  • Please only use the files in $TOOLKIT_DIR$\config\devices\Texas Instruments. The ones in $TOOLKIT_DIR$\config are old/legacy files.

    We use the CC2530F256 device in all of our CC2530 based kits, so you would want to use the 256 kB version of the linker file. You can of course also use the other linker files for the smaller memory size models of the chip

  • Hello, i have the same problem, but when i change the linker by :

    C:\Program Files\IAR Systems\Embedded Workbench 5.4 Evaluation\8051\config\devices\Texas Instruments\lnk51ew_cc2530F256.xcl

    I have this error :

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

    So, what is mean please ?How can i do to resolve this problem ?

    I use IAR 7.60 for programming the µC CC2530ZDK.

    Thanks in advance,

     

  • If you try to compile the Z-Stack, please use the linker files included with the Z-Stack.

    On a general basis:

    • For compilation of code where you have enabled the banked code model, you need to use the linker file called lnk51ew_cc2530F256_banked.xcl.
    • The IDE will choose the correct file automatically if you *do not* select the "Override default" option in the Linker --> Config options (see screenshot).

  • Hi M,

    I tried to change the linker file with lnk51ew_cc2530F256_banked.xcl but i haved another problem :

    Error[e46]: Undefined external "fopen::?relay" referred in basic_rf ( D:\IAR Embedded Workbench\CC2530ZDK\CC2530-Software Examples (Rev. B)\ide\srf05_cc2530\iar\temp\per_test\basic_rf.r51 )
    Error[e46]: Undefined external "fprintf::?relay" referred in basic_rf ( D:\IAR Embedded Workbench\CC2530ZDK\CC2530-Software Examples (Rev. B)\ide\srf05_cc2530\iar\temp\per_test\basic_rf.r51 )
    Error[e46]: Undefined external "fclose::?relay" referred in basic_rf ( D:\IAR Embedded Workbench\CC2530ZDK\CC2530-Software Examples (Rev. B)\ide\srf05_cc2530\iar\temp\per_test\basic_rf.r51 )
    Error while running Linker

    Because, I wrote a function in "appTransmitter" to recover the random data in to a file (.bin or .txt ...) and i have these problems !!!

    Can you tell me why please ?

    Thanks again,

  • As you have probably figured out by now, you need to have some kind of file system support to use the fopen/fclose/fprintf functions. You will need to develop such file system yourself or find suitable software in some open source file system or OS project.

    If you only want to write data to non-volatile storage, a plain buffer in flash may be all that you need.

  • Thanks M for reply,

    i'am new with IAR, Zigbee ... i don't know how can i do ...

    So, i'll search to do this.

    Thanks again,

    Br,

     

  • hi,

         i am first time going to use IAR for programming msp430f249 and i am getting the error ...

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

    please help me out

  • What code are you trying to compile?

    PS: Please also start new threads when you have questions that are not directly related to older threads.