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

nrf52832 with SDk 15.3 , S132 trying to get spi master to work. Not sure if nrf drv path is required or nrfx. Unclear to me.

Was told to avoid using nrf and particularly to mix nrf/nrfx functions.

Need clear sdk_config.h requirements to setup that also addresses what must not be in the config file if it breaks functionality.

For example do all  the references in the sdk_config to nrf_drv_gpiote, nrf_drv_spi need to be not only disabled but removed ?

And then all replaced with eqv nrfx_gpiote, nrfx_spi functions and nrfx config_t's ?

The current combination has nrfx_spi_init undefined (grayed out in the nrfx_spi.c file) because the condition compile directives are not satisfied.

I need to run active beacon scanner, control gpiote including a few interrupts and of course send and receive as a spi master.

So looking for solution that I can configure and plays well together.

I went through a spim example but don't need or want the extended features. Would use if required and it works on a nrf52832.

Assuming there is an explanation or example om how to get it working.

Right now I am manually controlling the chip select related to the spi slaves and am not sure if that is part of the extended features or not. 

I will start to migrate to all nrfx functions where possible as outlined in the migration notes.

Appreciate any help and/or working examples or ref code.

  • Hi,

    Did you read the new nrfx driver migration guide in SDK 15.3.0 documentation?

    Was told to avoid using nrf and particularly to mix nrf/nrfx functions.

    For new designs/firmwares, it is recommended to use the nrfx drivers directly.

    For example do all  the references in the sdk_config to nrf_drv_gpiote, nrf_drv_spi need to be not only disabled but removed ?

    Yes, unfortunately the nrfx configs are overwritten if the legacy config is included in sdk_config.h file, you will have to remove it completely to use nrfx driver configs. This is caused by apply_old_config.h file that only checks if legacy config modules are defined (does not care about if they are set enabled or not).

    You can use both nrfx_spi.c and nrfx_spim.c on nRF52832, but SPIM is recommended to reduce the number of interrupts needing to be serviced by CPU. The nrfx_spim example in the SDK servers as a sample implementation for both drivers, they should have similar APIs but SPIM provide more functionality like you say.

    Best regards,
    Jørgen

  • Ok thank you. I will keep pushing on using  spim and hopefully will get it working soon.

Related