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

Inconsistent wchar_t size

Hello,

I am compiling with encryption implemented for Bluetooth communications. Specifically with code taken from the ble_app_hrs_c example.

I am seeing this error:

Error[Lt009]: Inconsistent wchar_t size

I've seen some other posts that have talked about how using previous SDKs such as v14 and newer versions past v7 for IAR workbench will cause this error to occur, but I wanted to see if this was still the issue with v15.2 of the SDK.

If so, are there any work arounds for this beyond switching back to IAR v7. or would that be my only option for moving forward?

Thanks,

Mia

  • Hi Mia,

    please refer the nRF5 SDK v15.2.0 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”.
    *****

    Best regards

    Bjørn 

  • Hi Mia,

    please refer the nRF5 SDK v15.2.0 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”.
    *****

    Best regards

    Bjørn 

  • Hi Bjorn,

    Can you please guide me on how to make suggested changes for IAR8? i.e.

    *******************

    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”.

    ********************

    I am using IAR 8.32.1 and nRF SDK v15.3.0, trying to compile template_project but failing with error.

    Error[Lt009]: Inconsistent wchar_t size
                ssi_aes.c.obj(libnrf_cc310_0.9.12.a) and 64 other objects in libnrf_cc310_0.9.12.a have wchar_t size 16 bits
                aes.o and 259 other objects, some of them in dl7M_tlf.a and 13 other libraries have wchar_t size 32 bits

    Thanks,

    Abinash

Related