This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPI frequency update at run time

Hello,

We are working on a product that has UART and SPI integrated. We initialise the UART and the SPI at the beginning of the code and everything works fine.

However, the client wants to change the frequency of the SPI via UART at run time.

Is there a way to do it without having to restart the board?

If so how can we approach that?

Neel.

  • Hello Neel,

    However, the client wants to change the frequency of the SPI via UART at run time.

    Is there a way to do it without having to restart the board?

    To change the configuration of these peripherals you will need to uninit them, and re-initialize them.
    Are you working with the nRF5 SDK, or the nRF Connect SDK? Both SDKs' SPI and UART drivers include functions for uninitializing the peripheral, as well as for initializing.
    The simplest way to achieve this is to create an update function that stops all ongoing activity, waits for it to be properly stopped, uninit and re-init with the new configuration.

    Best regards,
    Karl

Related