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

     

  • Hi Karl,

    I continued this process of copying the missing file and rebuilding until the compiler was happy. In the end, 78 files were copied from the SPI examples project. This took the better part of a whole day. What a waste of time. Now I have some linker errors where it is complaining about .nrf_balloc will not fit in region 'UNPLACED_SECTIONS'. Clearly the GCC linker script file needs to be updated because the SPI example project used some custom sections. Can you understand my frustration working with your SDK? All of this makes a developer's life much more difficult. Here is my Segger project in it's current form.

    https://drive.google.com/file/d/1fbFMxvhs5wUW0rStkpe2RS4XUjvhYOET/view?usp=sharing

    I don't want to learn about GCC linker scripts, so I'm hoping that someone at Nordic will understand how to fix this, or show me an easier way of adding SPI to an existing project. In every other development tool I have used, this is simply selecting a checkbox and generate code and rebuilding. No more than 5 minutes total.

    BTW, Segger technical support suggested starting with your SPI example and adding in emFile files. After 3 iterations, we are no closer to getting that project to work either.

    Regards,

    John

Reply
  • Hi Karl,

    I continued this process of copying the missing file and rebuilding until the compiler was happy. In the end, 78 files were copied from the SPI examples project. This took the better part of a whole day. What a waste of time. Now I have some linker errors where it is complaining about .nrf_balloc will not fit in region 'UNPLACED_SECTIONS'. Clearly the GCC linker script file needs to be updated because the SPI example project used some custom sections. Can you understand my frustration working with your SDK? All of this makes a developer's life much more difficult. Here is my Segger project in it's current form.

    https://drive.google.com/file/d/1fbFMxvhs5wUW0rStkpe2RS4XUjvhYOET/view?usp=sharing

    I don't want to learn about GCC linker scripts, so I'm hoping that someone at Nordic will understand how to fix this, or show me an easier way of adding SPI to an existing project. In every other development tool I have used, this is simply selecting a checkbox and generate code and rebuilding. No more than 5 minutes total.

    BTW, Segger technical support suggested starting with your SPI example and adding in emFile files. After 3 iterations, we are no closer to getting that project to work either.

    Regards,

    John

Children
No Data
Related