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

NRFX_SPI2_ENABLED or NRFX_SPIM2_ENABLED from SDK Config File

Hello,

I'd like to enable an instance of  SPIM2 master (base address: 40023000) in SDK 17.0.2  for SPI operations. In sdk_config.h, there are two options, NRFX_SPIM2_ENABLED and NRFX_SPI2_ENABLED. Which one do I use? Also, to further complicate things, there's a NRFX_SPIS2_ENABLED flag, which is what I don't what. 

This is for the NRF52840 chip.

Parents
  • Very helpful clarification. I have set NRFX_SPIM2_ENABLED in sdk_config.h, but I don't see NRFX_SPIM2_ENABLED activated in nrf_drv_spi.h. 

    I made sure to comment out all of the legacy SPI2_ENABLED flags in sdk_config.h as well, as per 

    https://devzone.nordicsemi.com/f/nordic-q-a/63239/sdk_config-overwritten-by-sdk_old_config/257738#257738

    What other step(s) does one need to take in order to see NRFX_SPIM2_ENABLED activated in nrf_drv_spi.h?

    Thanks!

  • Sorry, might be my mistake, but if you plan to use nrf_drv_spi api then you can take a look at:
    \nRF5_SDK_17.0.2_d674dde\examples\peripheral\spi

    In that case the spi driver take use of SPI_ENABLED and SPI2_ENABLED defines from sdk_config.h. You can find that none of the NRFX_SPI* in sdk_config.h have any function in this case (you may try to simple find and replace NRFX_SPI if you like in sdk_config.h), the apply_config.h will simply undefine/overwrite all NRFX_SPI.

    If you want to use nrfx_spim directly you should instead look at:
    \nRF5_SDK_17.0.2_d674dde\examples\peripheral\nrfx_spim

    There you can also find that SPI_ENABLED and SPI2_ENABLED is not used at all, there is no apply_config.h, and all the NRFX_SPI* will have an effect. However you cannot use the nrf_drv api, you need to use the nrfx_spim* api. You will need to use the nrfx_spim_xfer() instead of nrf_drv_spi_transfer().

Reply
  • Sorry, might be my mistake, but if you plan to use nrf_drv_spi api then you can take a look at:
    \nRF5_SDK_17.0.2_d674dde\examples\peripheral\spi

    In that case the spi driver take use of SPI_ENABLED and SPI2_ENABLED defines from sdk_config.h. You can find that none of the NRFX_SPI* in sdk_config.h have any function in this case (you may try to simple find and replace NRFX_SPI if you like in sdk_config.h), the apply_config.h will simply undefine/overwrite all NRFX_SPI.

    If you want to use nrfx_spim directly you should instead look at:
    \nRF5_SDK_17.0.2_d674dde\examples\peripheral\nrfx_spim

    There you can also find that SPI_ENABLED and SPI2_ENABLED is not used at all, there is no apply_config.h, and all the NRFX_SPI* will have an effect. However you cannot use the nrf_drv api, you need to use the nrfx_spim* api. You will need to use the nrfx_spim_xfer() instead of nrf_drv_spi_transfer().

Children
No Data
Related