<?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>Dynamic I2C configuration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88710/dynamic-i2c-configuration</link><description>Dear colleagues, 
 I&amp;#39;d be very grateful for your help in the following challenge: I would need to change pins and/or i2c bus speed without recompilation of my code. 
 I can perfectly communicate to my i2c slaves from the 52833 (custom board) when my i2c0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Mar 2023 12:13:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88710/dynamic-i2c-configuration" /><item><title>RE: Dynamic I2C configuration</title><link>https://devzone.nordicsemi.com/thread/413509?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2023 12:13:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cec03942-cebe-4c4b-b7d7-c391bc3be894</guid><dc:creator>delossantos</dc:creator><description>&lt;p&gt;Thanks for sharing useful information I will come back to your article to update with more new information.&lt;/p&gt;
&lt;p style="text-align:right;"&gt;&lt;a href="https://fnafsecuritybreach3.com"&gt;fnaf security breach&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamic I2C configuration</title><link>https://devzone.nordicsemi.com/thread/371600?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2022 09:17:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb406da8-b1fb-40a4-903d-128c6e0d72b5</guid><dc:creator>rdim</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thanks a lot for your suggestion! I will try to figure out if pin control could be used. I am little bit uncertain because of the following statement in the &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/hardware/pinctrl/index.html"&gt;doc&lt;/a&gt;:&lt;/p&gt;
&lt;p class="admonition-title"&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Note&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Dynamic pin control should only be used on devices that have not been initialized. Changing pin configurations while a device is operating may lead to unexpected behavior. Since Zephyr does not support device de-initialization yet, this functionality should only be used during early boot stages.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;As we would need to reset pins during on the fly, I would need to find a proper de-initialization function that is not static &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;And yes, i2c_configure() does change&amp;nbsp;bitrate for me without re-initialization of the device. I was lucky that this function is only changing interface speed (and allowing 10 bits operations). Note, that the proper way to use it would be to a) get current configuration [that is not possible :\] b) modify it accordingly, and c) set it back using i2c_configure(). Its parameter dev_config is also &amp;quot;encrypted&amp;quot; as the doc only &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/0.4.0/zephyr/reference/peripherals/i2c.html?highlight=i2c_configure#_CPPv313i2c_configureP6device5u32_t"&gt;says&lt;/a&gt; that it is some bit-packed structure while in fact there are perfectly defined relevant macros in the codebase like for example&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;I2C_SPEED_SET&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;I2C_SPEED_FAST&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;So I managed to&amp;nbsp;change bitrate on the fly although&amp;nbsp;I had to explore the SDK source for that &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamic I2C configuration</title><link>https://devzone.nordicsemi.com/thread/371479?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2022 15:29:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04f3fd73-18fa-41be-b4f6-db9af93abf67</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;I believe what you&amp;#39;re looking for is &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/hardware/pinctrl/index.html"&gt;Zephyr&amp;#39;s Pin Control API&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;At least for the changing pins part. Are you able to change bus speed at runtime using i2c_configure()?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>