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

SPI DMA with SDK15

Hello,

after migrating to SDK15 we noticed, that our spi master seems to clock out single bytes instead of a continous clock for the whole transfer.

The Migration guide mentions the following:

combined drivers for peripherals with EasyDMA and without were split into two separate parts for respective peripherals:

  • nrf_drv_twi to nrfx_twi and nrfx_twim
  • nrf_drv_spi to nrfx_spi and nrfx_spim
  • nrf_drv_uart to nrfx_uart and nrfx_uarte

But it is not specified which is the one with easyDMA. We currently use the nrfx_spi.

I also tried using the nrfx_spim, but there are lots of compiler problems with the macros used there and the only example is for pca10056 while we are using pca 10040.

The other spi examples seem to still use the legacy driver.

The pictures show the transfer with SDK15 and SDK14

Best regards,

Niclas

Parents
  • SPI and TWI without the 'M' are "legacy" peripherals that are pretty much copy-pasted functionality from the nRF51 series. We chose to include these on the nRF52 to make it easier for customers to migrate from 51 to 52. These peripherals do not have EasyDMA. 

    SPIM and TWIM with the 'M' are new and improved peripherals with EasyDMA, so this is what you need to use. What compiler errors do you see when you use the SPIM drivers? You are not the first one to struggle with nrfx drivers and migration from SDK 14 to 15 by the way

  • Hi Martin,

    i activated all SPI defines in the sdk_config.h but I don't understand which ones are really needed:

    • SPI_ENABLED 1 (which was also in the old SDK so I assume its legacy)
    • NRFX_SPIM_ENABLED 1 (the correct new one with DMA support)
    • NRFX_SPI_ENABLED 1 (the nrf51 migration version?)

    With all enabled I can solve the compiler error for NRFX_SPIM_INSTANCE() even though I don't understand the dependency.

    In general there seems to be a big problem with dependency on legacy_drivers going on in SDK15.

    Will it be possible in the near future to just include the new NRFX versions of drivers without errors?

    The migration guide says:

    • replacing old configuration options contained in "sdk_config.h" with their new versions by adding NRFX_ prefix to their names

    But in the cases I tried (SPI, RNG), I always needed the old ones as well.

    Best regards,

    Niclas

    EDIT: ok the ticket you linked linked to another ticket saying i have to delete all legacy defines from sdk_config instead of disabling them, so i will give this a try

Reply
  • Hi Martin,

    i activated all SPI defines in the sdk_config.h but I don't understand which ones are really needed:

    • SPI_ENABLED 1 (which was also in the old SDK so I assume its legacy)
    • NRFX_SPIM_ENABLED 1 (the correct new one with DMA support)
    • NRFX_SPI_ENABLED 1 (the nrf51 migration version?)

    With all enabled I can solve the compiler error for NRFX_SPIM_INSTANCE() even though I don't understand the dependency.

    In general there seems to be a big problem with dependency on legacy_drivers going on in SDK15.

    Will it be possible in the near future to just include the new NRFX versions of drivers without errors?

    The migration guide says:

    • replacing old configuration options contained in "sdk_config.h" with their new versions by adding NRFX_ prefix to their names

    But in the cases I tried (SPI, RNG), I always needed the old ones as well.

    Best regards,

    Niclas

    EDIT: ok the ticket you linked linked to another ticket saying i have to delete all legacy defines from sdk_config instead of disabling them, so i will give this a try

Children
Related