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

Having issues adding drivers to a new project

I am trying to add the spi and twi drivers to the ble_app_template project, but I keep running into errors. I am using the SDK 12.2.0. How are we supposed to go about adding all of the files we need to get these drivers working on a new project? I have tried adding it through the software components management tool and by just adding the necessary files to a new group. I have also seen both methods used in different example projects. Sorry if there is already a tutorial on how to do this.

Parents
  • Hi,

    There are four things you have to add/verify when adding modules to a Keil project:

    1. Add the source files (.c) for the module to groups in Keil.
    2. Include the header file (.h) in the source file where the module is used.
    3. Add the path to the header file to the include paths in C/C++ project options.
    4. Enable the module in SDK configuration header file. If you cannot find the settings for the desired module in the sdk_config.h file for your project, check in ble_app_template project sdk_config.h file, as this include all modules in the SDK.

    Step 1-3 is described in more details in section Add required files and includes of the Application Timer Tutorial. All steps are shown in below image:

    image description

    Best regards,

    Jørgen

  • Jørgen

    Re: Item 3 I've found that the example Keil projects and also the gcc makefile normally contain include paths to virtually everything, even if its not needed in the specific example

    In this case the ble_app_template (in SDK 12.1 and 12.2 ) already contains the paths to the SPIM and also TWI driver folders in the include paths

    But the user has to add includes for those headers in any file which uses SPIM (or TWI), i.e this could be in main.c or any other source file which use SPIM or TWI

Reply
  • Jørgen

    Re: Item 3 I've found that the example Keil projects and also the gcc makefile normally contain include paths to virtually everything, even if its not needed in the specific example

    In this case the ble_app_template (in SDK 12.1 and 12.2 ) already contains the paths to the SPIM and also TWI driver folders in the include paths

    But the user has to add includes for those headers in any file which uses SPIM (or TWI), i.e this could be in main.c or any other source file which use SPIM or TWI

Children
No Data
Related