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.

RTOS/CC2640R2F: How can I resolve "cannot open source file "file.h"" when it compiler ffcio.c for using FatFS

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2650,

Tool/software: TI-RTOS

Hi, 

    How can I resolve this issue when I using fatfs with C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\examples\rtos\CC2640R2_LAUNCHXL\blestack\simple_peripheral_oad_offchip?

    My fatfs is coped from C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\third_party\fatfs.

    I don't use the driver SDSPI, I tend to use it for nand-flash.

    My error message is:

              

Fatal Error[Pe1696]: cannot open source file "file.h" D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\middleware\fatfs\ffcio.c 36

            searched: "C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/kernel/tirtos/packages/"

            searched: "C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/"

            searched: "C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/"

            searched: "C:/ti/xdctools_3_50_03_33_core/packages/"

            searched: "D:/Lifevo/Workspace/Microhierax/code/Mircrohierax/tirtos/iar/config/configPkg/../"

            searched: "D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\interfaces\"

            searched: "D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\drivers\nvs\"

            searched: "D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\middleware\fatfs\"

            searched: "D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\target\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\controller\cc26xx_r2\inc\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\inc\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\menu\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\crc\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\bim\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\flash_interface\"

            searched: "D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\src\app\"

            searched: "D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\..\bim_oad_offchip\src\board\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\icall\inc\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\dev_info\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\oad\cc26xx\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\roles\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\roles\cc26xx\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\simple_profile\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\simple_profile\cc26xx\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\inc\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\target\_common\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\target\_common\cc26xx\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\target\cc2650\rom\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\heapmgr\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\icall\src\inc\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\osal\src\inc\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\services\src\saddr\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\services\src\sdata\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\target\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\devices\cc26x0r2\"

            searched: "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\"

            searched: "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\inc\"

            searched: "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\inc\c\"

            current directory: "D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\middleware\fatfs"

My Environment:

My Environment:

    IDE IAR:

           IAR embedded workbench for ARM, V 8.20.1.14188

           IAR embedded workbench shared components, v 8.0.11.5069

 

   FatFS version : C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\third_party\fatfs

     I also try to add an additional include directories - $SIMPLELINK_CORE_SDK_INSTALL_DIR$\kernel\tirtos\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\sys, but I get the another issue as following information when include stdio.h

Fatal Error[Pe1696]: cannot open source file "sys/lock.h" C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\kernel\tirtos\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\sys\stdio.h 4

 ..... 

  Best Regards,

Allen

  • Hi Allen,

    Could you try adding both of the following paths as include paths,

    $SIMPLELINK_CORE_SDK_INSTALL_DIR$\kernel\tirtos\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\sys
    $SIMPLELINK_CORE_SDK_INSTALL_DIR$\kernel\tirtos\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include

  • Hi Edvard,
    Thank you for your helping.
    It seems to be workable. I don't receive the "cannot open source file" issues. But I have another error message:

    Performing Pre-Build Action
    Error while running "C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\..\xdctools_3_50_03_33_core\xs" --xdcpath="C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\kernel\tirtos\packages;C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source;C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack"
    iar.tools.configuro -c "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm" --cc "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\bin\iccarm.exe" --device "CC2640R2F" --compileOptions "dummy.c -D BOARD_DISPLAY_USE_UART=1 -D
    BOARD_DISPLAY_USE_UART_ANSI=1 -D CC2640R2_LAUNCHXL -D CC26XX -D CC26XX_R2 -D DeviceFamily_CC26X0R2 -D EXT_HAL_ASSERT -D FEATURE_OAD -D HAL_IMAGE_E -D ICALL_EVENTS -D ICALL_JT -D ICALL_LITE -D ICALL_MAX_NUM_ENTITIES=6 -D
    ICALL_MAX_NUM_TASKS=3 -D LED_DEBUG -D MAX_NUM_BLE_CONNS=1 -D MAX_PDU_SIZE=251 -D xOAD_BLE_SECURITY -D POWER_SAVING -D RF_SINGLEMODE -D TBM_ACTIVE_ITEMS_ONLY -D USE_EXT_FLASH_GD25Q32C -D USE_ICALL -D
    xdc_runtime_Assert_DISABLE_ALL -D xdc_runtime_Log_DISABLE_ALL --diag_suppress Pa050 -o D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\FlashROM\Obj --no_cse --no_unroll --no_inline --no_code_motion --no_tbaa --no_clustering --no_scheduling --debug --endian=little
    --cpu=Cortex-M3 -f C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\config\build_components.opt -f C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\config\factory_config.opt -f D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\tirtos\build_config.opt
    -f D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\config\configPkg\compiler.opt.defs -f D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\config\iar_boundary.bdef -e --fpu=None --dlib_config \"C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\
    arm\INC\c\DLib_Config_Normal.h\" -I D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\interfaces\ -I D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\drivers\nvs\ -I D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\middleware\
    fatfs\ -I D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\target\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\controller\cc26xx_r2\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\
    ti\blestack\common\cc26xx\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\menu\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\crc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\bim\ -I C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\flash_interface\ -I D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\src\app\ -I D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\..\..\..\bim_oad_offchip\src\board\ -I C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\icall\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\dev_info\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\oad\
    cc26xx\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\roles\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\roles\cc26xx\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\simple_profile\ -I C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\profiles\simple_profile\cc26xx\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\target\_common\ -I C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\target\_common\cc26xx\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\hal\src\target\cc2650\rom\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\heapmgr\ -I C:\ti\
    simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\icall\src\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\osal\src\inc\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\services\src\saddr\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\
    services\src\sdata\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\target\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\devices\cc26x0r2\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\kernel\tirtos\packages\gnu\
    targets\arm\libs\install-native\arm-none-eabi\include\sys\ -I C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\kernel\tirtos\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\ -On" --linkOptions "-o D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\FlashROM\Exe\
    sp_oad_offchip_cc2640r2lp_app_FlashROM.out --config_def CC2650=2 --config_def RTOS_ROM=1 --config_def xAPP_IMAGE_START=0x0000 --config_def OAD_IMG_E=1 --map D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\FlashROM\List\
    sp_oad_offchip_cc2640r2lp_app_FlashROM.map --config D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\config_patch\cc26xx_app_oad.icf --keep __vector_table -f D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\config\configPkg\linker.cmd -f D:\Lifevo\
    Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\config\iar_boundary.xcl C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\rom\ble_rom_releases\cc26xx_r2\Final_Release\common_r2.symbols C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\devices\cc26x0r2\driverlib\
    bin\iar\driverlib.lib C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\kernel\tirtos\packages\ti\dpl\lib\dpl_cc26x0r2.arm3 C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\drivers\lib\drivers_cc26x0r2.arm3 C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\drivers\rf\lib\rf_singleMode_cc26x0r2.arm3
    C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\display\lib\display.arm3 C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\grlib\lib\grlib.arm3 C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\mw\lcd\lib\lcd.arm3 --entry __iar_program_start --vfe --text_out locale" --profile release
    --projFile "D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\cc2640r2lp_app.ewp" --cfgArgs "{NO_ROM:0, OAD_IMG_E:1}" -o D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\..\config\configPkg D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\tirtos\iar\app\
    ..\..\..\tirtos\app_ble.cfg

    Total number of errors: 1
    Total number of warnings: 0

    My cc26xx_app_oad.icf is copied from C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\common\cc26xx\iar and is not modified. I can build the project before I add FatFS files. Is there anything I have to do for using file.h ?
  • When you say "my fatfs is copied from <SDK>", what do you mean by that?
  • Hi Edvard,
    I copy the following files to the fatfs folder under my project source folder (D:\Lifevo\Workspace\Microhierax\code\Mircrohierax\middleware\fatfs) from C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\third_party\fatfs. And I add an additional include directory $PROJ_DIR$\..\..\..\middleware\fatfs in preprocess setting. I hope my fatfs will not be impacted by another project.

    diskio.c
    diskio.h
    ff.c
    ff.h
    ffcio.c
    ffcio.h
    ffconf.h
    ffosal.c
    integer.h
    Best Regards,
    Allen
  • Why do you copy the files?
  • Hi Edvard,
    Sorry for replaying you so late.
    I tend to change it for Nand flash, and don't impact other project. So I copy it to my project.
    BTW, I also try to use the files inside the C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\third_party\fatfs directly , it has the same issue.
    Which file should I provide you, than you can help me to check this issue?
    Best Regards,
    Allen
  • So if I understand you correctly you are manually including fatfs into your CCS project. Have you remembered to add correct include paths to the fatfs source directory, as well as including the fatfs library to the linker?
  • I'm closing this thread due to inactivity. You can reopen the thread by replying if you feel you haven't gotten the appropriate support.