<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SPI frequency update at run time</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80793/spi-frequency-update-at-run-time</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Oct 2021 14:38:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80793/spi-frequency-update-at-run-time" /><item><title>RE: SPI frequency update at run time</title><link>https://devzone.nordicsemi.com/thread/334931?ContentTypeID=1</link><pubDate>Tue, 19 Oct 2021 14:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:149105bc-49dc-4e89-b3a8-54adb8bff380</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Neel,&lt;/p&gt;
[quote user=""]&lt;p&gt;However, the client wants to change the frequency of the SPI via UART at run time.&lt;/p&gt;
&lt;p&gt;Is there a way to do it without having to restart the board?&lt;/p&gt;[/quote]
&lt;p&gt;To change the configuration of these peripherals you will need to uninit them, and re-initialize them.&lt;br /&gt;Are you working with the nRF5 SDK, or the nRF Connect SDK? Both SDKs&amp;#39; SPI and UART drivers include functions for uninitializing the peripheral, as well as for initializing.&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>