Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I'm using the Segger nRF52840-DK and I want to add support for SPI?

I'm using the nRF52840-DK evaluation software from Segger. I want to add NAND Flash support, so I want to add an SPI interface. I have looked at the example in nRF5SDK160098a08e2 and that works nicely on my board, but I'm having difficulty moving that SPI example to the nRF52840-DK project as there are dependencies on Integration, module and components folders. isn't there a much simpler way to just add SPI support like there is when using ST Micro Cube IDE? I did manage to have a successful build with nrfx version of SPI, but the driver won't work correctly on my board.

I'm using the latest version of Segger Embedded Studio.

Regards,

John

Parents
  • Hello John,

    but I'm having difficulty moving that SPI example to the nRF52840-DK project as there are dependencies on Integration, module and components folders.

    Yes, the drivers and libraries of the SDK is located in these folders, and you will have to add them to your "preprocessor included directories" so that they are available to the preprosessor when you are going to compile your project. If you are working in Segger Embedded Studios, this is done by right-clicking the project name in the project explorer view and selecting options..->preprocessor->User Include Directories while in the common configuration.
    In your case, you mention that you are using the ST Micro Cube IDE, which I personally have never worked with - a brief google search on the topic yielded this forum post where they seem to discuss the relevant process for the ST Micro Cube IDE. In essence, you need to provide the IDE with the paths to your included files(*.h files) and you will have to include the source code files(*.c) in the project.

    I did manage to have a successful build with nrfx version of SPI, but the driver won't work correctly on my board.

    Could you elaborate what you mean by this - you are able to compile and flash the project, but it does not behave as expected? Or does something else happen before you are able to run it? Please be as specific as possible.

    Please let me know if this does not answer your question,

    Best regards,
    Karl

     

  • Is there no one from Nordic technical support who can help me here?

    Regards,

    John

  • Hello John.

    Sorry for my delayed reply.

    john3909 said:
    Let's make this simple. Start a new nRF52840 project with all the default settings. Show me how you add the required code to support for comms with an SPI device. Assume that no SPI example project existed.

    In essence you are asking me to type out the nrfx SPIM example here, to avoid linking you an example. This example demonstrates the nrfx_spim driver, and the main file comes in at 80 lines of code - but I recon that it might be the sdk_config file you are interested in hearing more about? Is there a particular part of the example code you would like me to go through or explain in detail?

    The nrfx SPIM API Reference and the SPIM peripheral documentation are good starting points when adding SPIM to an existing project, though I suspect you have already seen them.

    Note that the SPIM driver uses easyDMA, and if you do not intend to use this, you should use the nrfx_spi driver instead.

    Best regards,
    Karl 

  • Sorry, when I replied, there was no reply button at this level, so I could only reply up one level.

Reply Children
No Data
Related