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.

Problem Linker IAR

Other Parts Discussed in Thread: CC2530, CC2530EM, Z-STACK

Hello,

i wanted to compile a program with that i recoved the random data at TX. So, i haved an error of linker :

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

I don't know why, can you tell me how resolve it please ?

Thanks in advance,

  • Hi

    Which version of IAR are you using?

  • Hi Martin, i'am using IAR version 7.60 for programming the µC 8051.

    I have an other question : Is that the µC 8051 has acces external files ? If yes, how can i do please ?

    Br,

  • Unless you have implemented some sort of file system in the software running on the device, it is not that simple to acess files - not to mention external files. Not really sure what you mean by external files, though. If you have files on e.g. a memory card, you could of course try to access them over SPI as binary images (byte array), but you would need to know the internal structure of the file system to make any sense of the data. If the file is on a PC, you could use e.g. UART and implement a small proprietary client/server app such that the server on the PC would provide data from an external file as requsted by the device.

  • Hi M, thanks for your reponse.

    Of course, i want to access in a file on a PC.

    i'am using the USB to program the carte CC2530EM, can i change in UART ?

    i have another problem now :

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

    Can you tell me how can i resolve please ?

    Thanks again,

    L

  • The same linker error question was answered in this thread: http://e2e.ti.com/support/low_power_rf/f/155/t/58179.aspx. Didn't that help?

    You get the problem above if you use the banked memory model but don't use a linker file that supports that memory model (i.e. it does not define the BANKED_CODE segment).

  • Hi, i resume the problem that i have :

    I want to compile this code :

        FILE* fichier = NULL;
        fichier=fopen("test.txt", "w");
       
        if (fichier !=NULL)
        {  
        for (n=0; n < sizeof(txPacket.padding); n++)
        {
          txPacket.padding[n] = rand();
          fprintf (fichier,"%s", txPacket.padding[n]);
        }
        fclose(fichier);
        }

    When i change the linker with lnk51ew_2530F256.xcl by lnk51ew_cc2530F256_banked.xcl, i have the problem :

    Fatal Error[e163]: The command line symbol "_FLASH_LOCK_BITS_START" in -U(CODE)0x0000=(CODE)_FLASH_LOCK_BITS_START-_FLASH_LOCK_BITS_END is not defined. [C:\Program Files\IAR Systems\Embedded Workbench 5.4 Evaluation\8051\config\devices\Texas Instruments\lnk51ew_cc2530F256_banked.xcl 218 ]
    Error while running Linker

    Then, i change lnk51ew_cc2530F256_banked.xcl by lnk51ew_2530F256.xcl i have another problem :

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

    .....

    I'am very confused ... i don't know what to do .... Sorry to bother !!!

    Thanks again,


  • No bother at all.

    As mentioned before: If you build an application that is based on the Z-Stack, you cannot use the generic linker files that are shipped with IAR. You need to use the the customized linker file which is inlcuded with the Z-Stack. You will normally find that linker file here:

    C:\Texas Instruments\ZStack-CC2530-2.4.0-1.4.0\Projects\zstack\Tools\CC2530DB

    Use the file called f8w2530.xcl. The sample projects are usually set up to use this linker file by default.

    However, this won't solve the linker warning stating that it cannot find the symbols for fopen() etc. You will need to develop these functions yourself...or find another way to store the information.

  • Thank you very much for your reponse,

    I will test this. Hope it functions :)

    Thanks alot !!!

     

  • Cheerrrr !! It works !!!!! i can continue mon project now :) Thanks !!!!!!!!!!!!!

     

  • i have a question for you : what mean Extra Output of Linker ? And how it functions please ?

    Here, my output file is per_test.hex, how this file is builded please ?

    Thanks again !!!

  • To learn more about the linker, please refer to the "Linker and Library Tools Reference Guide" which is bundled with IAR Embedded Workbench (you'll find it in the Help menu).

    When you have enabled extra output, the linker will generate both the output file needed for debugging of the code in addition to a user selected output file format - in this case the Intel HEX file - which is a specific representation of the data that should be written to the flash of the device to run your program. So the extra output option is just a convenience to the user: Instead of building twice; first to generate the debug file, then the file used by e.g. an external flosh prog tool, you generate both files at the same time.

    Many tools, like our SmartRF Flash Programmer", can read the Intel HEX file to properly program the device.

     

  • Hi M,

    Thanks for reply. i think i understand better now :)

    Best regards,