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

Need a support to do spi interfacing in segger embedded studio using nRF51822 module

Dear Sir/Madam,

I'am new to segger embedded studio.I would like to do SPI interfacing of an IC using nRF51822 with segger embedded studio.

Please guide me how to add the necessary driver files into my project.

Regards

Pavankumar S

  • Hi,

    My objective is to do spi interfacing using nRF51822 module.

    As suggested by you I followed the below steps.

    1)Created a new project in SES.

    2)Added nrf_drv_spi.c file into the Device Files folder of my project.

    after this when I tried to build the project,Getting the following error.

    sdk_common.h file not found.(how to resolve this error).

    please tell me how to Add the path to the header file (nrf_drv_spi.h) to my project settings.

    To which folder I should add sdk_config.h file and tell me how to enable it.

    Regards

    Pavankumar S

  • You can see in the image when I add nrf_drv_spi.c file,Inside the file all statements are not enabled.

    Regards

    PavankumarS

  • Hi,

    I did not suggest that you create a new project from scratch. This will almost always create a lot of issues for yourself, especially if you are not experienced with Nordic SDK and SoCs.

    The drivers and libraries in the SDK usually has dependencies on other libraries for error handling, utility functions, etc. If you want to create a project from scratch, you need to add all the source files and paths that are needed. It is much easier to start out with an existing example project that has all the required files added already, for instance the SPI Master example.

    Paths are added in the "user include directories" configuration in project settings:

  • Hi,

    I do agree that libraries in the sdk are having dependencies on each other.

    So I,am trying to import a keil project into segger embedded studio.

    /DeviceDownload/nRF5_SDK_12.3.0_d7731ad/examples/peripheral/spi/pca10028/blank

    I followed the steps suggested by you in your first reply.

    My Include user directories looks like this.

    Even though I have followed the complete steps suggested by you,Iam getting 2 errors when I build my project.

    Thank you for your patience in replying to me,I have been asking lot of questions since Iam new to SES.

    Please help me out how to resolve this errors,Today is the deadline given to complete this project.

    Regards

    Pavankumar S

  • You should follow the tutorial closely, the nrf.h file is located in the components/device directory:

    • Select Project -> Edit Options... and then select the Preprocessor tab
    • Add ../../../../../../components/device to the User Include Directories field to include the device header files in our Embedded Studio project

    Your user include directories should look like this now:

    image description

    I also see that you have added system_nrf52.c and ses_startup_nrf52.s, these will not work for nRF51 chips. You may find some useful information in this post.

Related