<?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>Button callback and i2c_transfer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96045/button-callback-and-i2c_transfer</link><description>Dev tools: HW: nRF52DK_52832 (&amp;amp; LTC DC1697A) SDK: v2.2.0 
 
 The problem: The I2C transfer function doesn&amp;#39;t work as expected within a callback. 
 Steps to reproduce: 1. Starting a new project with the zephyr button example 2. Adding RTT support to the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 31 Jan 2023 15:07:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96045/button-callback-and-i2c_transfer" /><item><title>RE: Button callback and i2c_transfer</title><link>https://devzone.nordicsemi.com/thread/407391?ContentTypeID=1</link><pubDate>Tue, 31 Jan 2023 15:07:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af08a1aa-f4de-43dc-9d62-b8bffb8fbcbc</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Here is the documentation for &lt;a href="https://docs.zephyrproject.org/3.0.0/reference/kernel/synchronization/semaphores.html#implementation"&gt;Implementing a semaphore in Zephyr&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button callback and i2c_transfer</title><link>https://devzone.nordicsemi.com/thread/407390?ContentTypeID=1</link><pubDate>Tue, 31 Jan 2023 15:03:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba050138-f45e-484d-9452-98c6b411e415</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;It is very limited what one can do within an interrupt in Zephyr and using I&lt;sup&gt;2&lt;/sup&gt;C within an interrupt will not work. Instead you can look at using work items (&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/zephyr/kernel/services/threads/workqueue.html#workqueue-threads"&gt;Workqueue Threads&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Another alternative is to use a semaphore. Give the semaphore in the interrupt and take it in a thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button callback and i2c_transfer</title><link>https://devzone.nordicsemi.com/thread/406778?ContentTypeID=1</link><pubDate>Fri, 27 Jan 2023 07:51:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:986e581b-6646-40c1-8bfd-e11f9821319a</guid><dc:creator>SHOzturk</dc:creator><description>&lt;p&gt;thanks for looking into this so quickly&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button callback and i2c_transfer</title><link>https://devzone.nordicsemi.com/thread/406688?ContentTypeID=1</link><pubDate>Thu, 26 Jan 2023 14:22:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03cab5e0-1503-4ef8-bd61-13839f813331</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I will try to reproduce to see what I can find.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>