This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

IAR Library (v7.xx to v8.xx) compatibility

I am trying to build the writable_ndef_msg example from the nRF5_SDK_15.2.0. I am using IAR'e Embedded Workbench (ARM v8.30.1) and I get the following Linker Error:

Error[Lt009]: Inconsistent wchar_t size
nfc_t4t_lib.o(nfc_t4t_lib_iar.a) and 1 other objects have wchar_t size 16 bits
app_error.o and 66 other objects, some of them in dl7M_tlf.a and 10 other libraries have wchar_t size 32 bits
Error while running Linker

Having searched the DevZne I see tat over a year ago it became apparent that pre-built libraries are built with an earlier version of the ARM compiler, and that the wchar implementation is not consistent between v7.xx and v8.xx.

Is there a v8 compatible nfc_t4t_lib available that I can use?

  • Hi,

    You can use the "gcc" libraries with IAR 8. Excerpt from the SDK release notes:

    Note for IAR 8 users:
    (Libraries for IAR 8 require wchar_t to be of size 32 bits while IAR 7 requires 16 bits).

    To run a project using IAR 8, follow these intructions:
    - Open the IAR project in IAR 8. The IAR workbench will automatically generate an IAR 8 compatible project file.
    - If the project contains one of the precompiled libraries listed below, replace it with the IAR 8 compatible alternative
    (there are no projects targeting nRF51 in this SDK).
    - Save the project.
    - When building the project, you might get the warning: "The header file 'cmsis_iar.h' is obsolete and should not be used. [...]".
    - The problem is described in DevZone post: devzone.nordicsemi.com/.../iar-ewarm-8-22-1-complains-about-cmsis_iar-h
    The solution is to remove all occurrences of #include <cmsis_iar.h>.

    The affected libraries are:
    - micro-ecc crypto:
    - IAR7: Includes library located in the folder named “…_iar\…”.
    - IAR8: Switch to using the library from the folder named “…_armgcc\…”.
    - nrf_cc310, nrf_cc310_bl, and nrf_oberon:
    - IAR7: Includes the library where “_short_wchar_” is part of the file name.
    - IAR8: Switch to using the library with similar naming, but where the “short_wchar” is removed.
    - Gazell, NFC Tag, and 802.15.4:
    - IAR7: Includes the library where the file name ends with “_iar”.
    - IAR8: Switch to using the library with similar file name that ends with “_gcc”.

Related