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.

Compiler/CC2540: IAR Workbench compiler int64

Part Number: CC2540

Tool/software: TI C/C++ Compiler

Hi,

I recently started to work with IAR and CC2540. I'm currently building some code to communicate with the BME280 sensor. There are some operations that require 64bit integers. I searched in multiple places and haven't found support for 64bit integers in the IAR Workbench compiler.

Is this type not supported?

Thank you!

  • Hi,

    Have you tried using an integer with the type uint64_t or int64_t?
    I've tested it in IAR and it shouldn't cause any compilation errors.

    -Sy Su
  • Is there a special header that needs to be included?
    I've tried with int64_t and int64 and it didn't compiled. I've searched through all the ble stack and there is no mention of int64 (apart from some commented code in CC2541ST).

    I displayed sizeof(long) and sizeof(long long) and both have 4 bytes. It seems to me that the compiler doesn't support 64 bit integers.

    I'm developing on SimpleBLEPeripheral project.

  • Try including stdint.h
  • I did misread what device you were using however it should still work.

    For IAR, the header should be included in a similar file path as this: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\8051\inc\dlib\c\stdint.h

    If you open the header file, you can see that int64_t and uint64_t are supported.

    -Sy Su

  • It's not working. Maybe because that header is for Dlib. I use Clib (it cannot be changed to Dlib because the ble libraries are compiled for Clib).

    Fatal Error[Pe1696]: cannot open source file "stdint.h" C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\Source\simpleBLEPeripheral.c 806 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\common\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\include\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\hal\include\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\hal\target\CC2540EB\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\osal\include\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\services\saddr\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\ble\include\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\ble\controller\CC254x\phy\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\ble\controller\CC254x\include\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\ble\hci\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\ble\host\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\..\..\Components\ble\ROM\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\common\cc2540\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\common\npi\npi_np\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\Profiles\Roles\CC254x\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\Profiles\Roles\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\Profiles\SimpleProfile\CC254x\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\Profiles\SimpleProfile\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\Profiles\DevInfo\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\Profiles\Keys\CC254x\" 
                searched: "C:\Texas Instruments\BLE-CC254x-1.4.2.2\Projects\ble\Test_RF_BM_S02\CC2540DB\..\..\Profiles\Keys\" 
                searched: "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\8051\inc\" 
                searched: "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\8051\lib\dlib\" 
                searched: "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\8051\inc\clib\" 
    Error while running C/C++ Compiler