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.

CC2530: Linking issues with lates IAR 8051 Version (released this Monday)

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK

Hello

I upgraded to the lates IAR Compiler for 8051 released this Monday following information from indicating that they fixed a few issues I had with the toolchain.

The result is that Linking simply fails now - the target directory and temporary directroy are deleted entirely on each build so it should not be caused by llingering files from a previous build.

OSAL_Math.s51
.\trv\Components\osal\mcu\cc2530\OSAL_Math.s51(108) : Warning[410]: B is using fixed address 0xF0. Use external lab
el ?B instead if B is using another address
.\trv\Components\osal\mcu\cc2530\OSAL_Math.s51(185) : Warning[410]: B is using fixed address 0xF0. Use external lab
el ?B instead if B is using another address


...

Linking
Error[e46]: Undefined external "?B" referred in bdb_Reporting ( .\trv\TRVRelease\Obj\bdb_Reporting.r51 )
Error[e46]: Undefined external "?IE" referred in ?ALLOC_XSTACK8 ( C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.3\8051\LIB\CL
IB\cl-pli-blxd-1e16x01.r51 )
Error while running Linker


Total number of errors: 2
Total number of warnings: 5


 ERROR, Command failed: build

I also filed a report with IAR, so maybe they'll identify the fix.  I did not investigate this.

Version:


IAR Command Line Build Utility V8.3.4.6127
Copyright 2002-2019 IAR Systems AB.

Creating backup of original project file.
Deleting outputs for configuration TRVRelease
Updating build tree...

0 file(s) deleted.


IAR Command Line Build Utility V8.3.4.6127
Copyright 2002-2019 IAR Systems AB.

# IAR C/C++ Compiler V10.40.1.7397 for 8051 23/Mar/2021 19:56:17
# Copyright 2004-2021 IAR Systems AB.
# PC-locked license - IAR Embedded Workbench for 8051 10.40

  • Follow up: Compiling the ZNP project results in the same issues at link time.

  • Try to download matched IAR version in TI Z-Stack release note from https://www.twblogs.net/a/5d4070d4bd9eee51fbf9991a to test again 

  • Hi Mario,

    As YK mentioned, you must use the IAR EW 8051 version from the Z-Stack Release Notes to ensure compiler/linker compatibility.  I have not seen this error before and do not know what recent IAR changes were made which could have caused such behavior.  Hopefully IAR Support can provide you with more information in regards to their tools.

    Regards,
    Ryan

  • According to IAR support, the issue "relates to the B-register and IE-registers having become 'moveable'.
    First level support is asking the IAR BackOffice for any migration advice for the usage of B/?B and IE/?IE registers. in the source code."

    This refers to release note "* Support for changing the addresses for the B and IE registers" .

  • Which Z-Stack version do you use? Do you see this trouble when building original example?

  • This is with Z-Stack_3.0.2 - both ZED and ZNP do not compile with IAR 10.40 - IAR 10.30 is fine.

    IAR says they fixed an issue in 10.40 that I had when compiling in 10.30 from the CLI (random failing compilations), and have updated the documentation to indicate that the 8051 compiler does not support the Stack Usage Report thereby confirming that the reports provided by 10.30 and prior are unuseable and that they are not evolving that.

  • Hello Mario

    See the release notes on IAR 10.40.1 https://netstorage.iar.com/FileStore/STANDARD/001/000/602/ew/doc/infocenter/readme.ENU.html
    It states that you need to update the linker configuration file. I hope this helps, I have not yet updated to 10.40.1 so I can't be of further help.

    SunnyKai

    Version 10.40

    • Support for changing the addresses for the B and IE registers

      When the compiler generates an instruction that would result in an opcode that uses
      the address of B or IE, it now uses the external labels ?B and ?IE instead. These labels are
      then resolved by the linker, by specifying the values of the labels on the command line,
      i.e. -D?B=0xF0.

      All linker configuration files have been updated to include these definitions. If you are
      upgrading from an earlier version of IAR Embedded Workbench for 8051 and your project uses a
      custom linker configuration file, you must add the definitions to your configuration file to
      avoid linking errors.

      Note: The assembler does not support changed addresses. If the device has a
      non-standard address for the B register, replace it with ?B and remember to add EXTERN ?B.
      Note: If the B register is located on an address which is not bit-addressable, the runtime libraries will no longer be compatible and will not function properly.

  • Hello

    Thank you for the helpfull feedback.

    I've added the following to the xcl files in my ZED project and linking succeeded:

    //
    //  Device specific symbol definitions
    //  ==================================
    -D?B=F0                       // B register location
    -D?IE=A8                      // Interrupt Enable register location
    -D?IP=A9                      // Interrupt Priority register location
    

    These lines can be found in "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.3\8051\config\devices\Texas Instruments\lnk51ew_cc2530F256.xcl"