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.

Why the _hal_uart_spi.c can be build while it can not be found in the project source code?

Now I want to use both uart and spi,uart on port0 and spi on port1,I can not found _hal_uart_spi.c  or _hal_uart_isr.c in the project source code in the sample code, but it worked as expected, so the question is where does it be included into the project, and if I want to use both uart and spi, should I add the _hal_uart_spi.c and _hal_uart_isr.c or  _hal_uart_dma.c into my project?

 

Thanks!

Chris

  • Hello Chris,

    All the files you mentioned can be found in the BLE-CC254x-1.3 or 1.4 folder inside Components/hal.

    These files get added to the project depending on the build option you select I.e, CC2540USB, OAD imgA, etc..  They are shown in the workspace under HAL/Target/Drivers.  You can add other hal_ files to the build at that location by right clicking on Drivers, select Add -> Add files and then select the folder as mentioned above.

    Thanks,

  • Thanks for your reply. 

    I mean it can not be found in the IAR project source files. You are right, it is added depend on the Preprocessor defines,but what I'm confused is what mechanism does the IAR use to add the prebuild files, does it use prebuild script to include prebuild object files, etc. the _hal_uart_spi.o. 

    Chris

  • If I am not mistaken, every time you select a different build in the workspace, the Target/Drivers change.  Some files will be greyed out with an x beside them.  All of the files in the Drivers can be "Removed from Build" on the Options section.  If it is used by the program, it is listed in one of the workspace folders.  The Preprocessor and other defines simply call on those programs listed.  If the files are not in the workspace, then you would get an error message.

  • Hi,Greenja,Have you ever  found the _hal_uart_spi.c or _hal_uart_isr.c in any project that used it? I can not find it is added into project, but the project use and build it.

  • I'am sorry, it is included in the har_uart.c

    Chris