<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Implement blocking read on rpmsg in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1574930#M199251</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/183793"&gt;@ddeyo1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;It should be mentioned that&amp;nbsp;the example code for the rpmsg char driver is not available in rpmsg-lite MCUExpresso SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Dec 2022 13:26:59 GMT</pubDate>
    <dc:creator>Dhruvit</dc:creator>
    <dc:date>2022-12-27T13:26:59Z</dc:date>
    <item>
      <title>Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1569813#M198760</link>
      <description>&lt;P&gt;I have been succesfully using rpmsg on an iMX8 (4 A53's, 1 M4) for a while.&amp;nbsp; I'd like to make the 'read' function blocking, as the code I've found for rpmsg on the linux side uses polling and an ioctl to determine if data is available to be read.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The read thread has a sleep in it to keep the cpu from fly away.&amp;nbsp; That sleep amounts to a 1ms delay in all of the messages coming from the m4.&amp;nbsp; In our real time appliction, that can be a problem.&lt;/P&gt;&lt;P&gt;All my effrots to make the read blocking have returned no error, but the read doesn't block either.&amp;nbsp; I've tried (&amp;amp;(~O_NONBLOCK)) and&amp;nbsp;FIONBIO set to zero.&lt;/P&gt;&lt;P&gt;I want to have my read thread consuming no cpu cycles until data is ready from the M4.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to implement blocking on a read from rpmsg on the linux side?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 14:36:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1569813#M198760</guid>
      <dc:creator>ddeyo1</dc:creator>
      <dc:date>2022-12-14T14:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571110#M198862</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/183793"&gt;@ddeyo1&lt;/a&gt;,&lt;/P&gt;
&lt;DIV&gt;The &lt;EM&gt;imx_rpmsg_tty.c&lt;/EM&gt; driver does not support blocking read from RPMSG tty.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;However,&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;one can try using the&amp;nbsp;&lt;EM&gt;"&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;/drivers/rpmsg/&lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;rpmsg_&lt;WBR /&gt;char.c (CONFIG_RPMSG_CHAR)"&lt;/EM&gt; driver. It does have some support for blocking IO with the (~&lt;SPAN&gt;O_NONBLOCK) option.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;One can refer to the below thread for more&amp;nbsp;information about the rpmsg_char driver with i.MX processors&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/Alternatives-to-imx-rpmsg-tty-rpsmg-lite/m-p/1341625/highlight/true" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://community.nxp.com/t5/i-MX-Processors/Alternatives-to-imx-rpmsg-tty-rpsmg-lite/m-p/1341625/highlight/true&amp;amp;source=gmail&amp;amp;ust=1671267074445000&amp;amp;usg=AOvVaw3TG8Ou7XYkFSVHy_dBPqlC"&gt;Alternatives to imx_rpmsg_tty/rpsmg_lite&lt;/A&gt;.&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Dec 2022 09:06:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571110#M198862</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2022-12-16T09:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571139#M198866</link>
      <description>&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;The&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;imx_rpmsg_tty.c&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;driver does not support blocking read from RPMSG tty.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Are you sure? I've no problems with blocking read from /dev/ttyRPMSG on iMX7D and VF.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 09:59:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571139#M198866</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2022-12-16T09:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571247#M198874</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Is there any example of co-processor code using rpmsg_char, running either bare bone or FreeRTOS?&lt;/P&gt;&lt;P&gt;I have code for rpmsg_tty but I wouldn't expect it to act the same.&lt;/P&gt;&lt;P&gt;-dwd&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 14:21:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571247#M198874</guid>
      <dc:creator>ddeyo1</dc:creator>
      <dc:date>2022-12-16T14:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571251#M198875</link>
      <description>&lt;P&gt;It definitely appears my driver doesn't support it.&amp;nbsp; There are no 'waits' in my version, which are necessary for blocking reads (as far as I understand).&amp;nbsp; In rpmsg_char, you can clearly see waits and I see an NXP member has stated as much.&lt;/P&gt;&lt;P&gt;All that said, how were you able achieve a block in your linux-side application?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 14:25:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571251#M198875</guid>
      <dc:creator>ddeyo1</dc:creator>
      <dc:date>2022-12-16T14:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571268#M198878</link>
      <description>&lt;P&gt;I believe you have the same imx_rpmsg_tty driver on iMX8. Blocking or non blocking TTY, depends on termios settings, perhaps on O_NONBLOCK in some way too, but termios matters. Like with serial port TTY, it can be both blocking and non blocking. Google suggested&amp;nbsp;&lt;A href="http://www.unixwiz.net/techtips/termios-vmin-vtime.html" target="_self"&gt;this&amp;nbsp;&lt;/A&gt;, perhaps there's better reading.&lt;/P&gt;&lt;P&gt;I open it this way. read() blocks.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	struct termios newtio;

		rpmsg_tty = open( rpmsgdevice, O_RDWR | O_NOCTTY);
		tcflush(rpmsg_tty, TCIOFLUSH);
		tcgetattr(rpmsg_tty, &amp;amp;newtio);
	 	cfmakeraw(&amp;amp;newtio);
		tcsetattr(rpmsg_tty, TCSANOW, &amp;amp;newtio);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 15:06:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571268#M198878</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2022-12-16T15:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571271#M198880</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I'll give it a try and let you know.&lt;/P&gt;&lt;P&gt;-dwd&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 15:15:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571271#M198880</guid>
      <dc:creator>ddeyo1</dc:creator>
      <dc:date>2022-12-16T15:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571277#M198881</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I tried your version and even added VTIME and VMIN (google ref.), with no change.&lt;/P&gt;&lt;P&gt;The cpu on my thread goes to 1.3% with a 1ms sleep.&amp;nbsp; With a 1 second sleep, I get my test log, every second.&amp;nbsp; It doesn't appear to be acting the same using my kernel (5.4.110).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-dwd&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 15:58:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571277#M198881</guid>
      <dc:creator>ddeyo1</dc:creator>
      <dc:date>2022-12-16T15:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571292#M198882</link>
      <description>&lt;P&gt;Are you sure your M4 FW isn't sending, ehh, .. some empty messages? Perhaps it's just something odd on iMX8, I can't believe it.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 16:18:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1571292#M198882</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2022-12-16T16:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1573800#M199142</link>
      <description>&lt;P&gt;Hard to say, about M4 empty rpmsg messages.&lt;/P&gt;&lt;P&gt;I am using an ioctl (ioctl(mFdRpmsg, FIONREAD, &amp;amp;byte_avail)) to check if there's anything in the buffer of the kernel driver. It says there's nothing.&lt;/P&gt;&lt;P&gt;On my M4 side, I have two queues, TX/RX. Those are clearly blocked, based off of previous testing.&lt;/P&gt;&lt;P&gt;I see no evidence that an empty message is being sent.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a log being sent based off the return from the ioctl. It doesn't indicate any empty messages.&lt;/P&gt;&lt;P&gt;Perhaps it's not so much the iMx8, but the kernel. The kernel driver decides if blocking is supported.&lt;/P&gt;&lt;P&gt;In the rpmsg_char driver (on my kernel), it clearly indicates it should support blocking reads. The rpmsg_tty driver doesn't have any waits on any queues available.&lt;/P&gt;&lt;P&gt;I believe I will need to use rpmsg_char, but I don't have any m4 (co-processor) code for rpmsg_char. I do have working M4 code for rpmsg_tty.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 14:47:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1573800#M199142</guid>
      <dc:creator>ddeyo1</dc:creator>
      <dc:date>2022-12-22T14:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1573804#M199144</link>
      <description>&lt;P&gt;Do you have any idea what I need to change in the M4 co-processor&amp;nbsp; code in order for it to work with the rpmsg_char driver?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 14:59:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1573804#M199144</guid>
      <dc:creator>ddeyo1</dc:creator>
      <dc:date>2022-12-22T14:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1574930#M199251</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/183793"&gt;@ddeyo1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;It should be mentioned that&amp;nbsp;the example code for the rpmsg char driver is not available in rpmsg-lite MCUExpresso SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 13:26:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1574930#M199251</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2022-12-27T13:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1574946#M199252</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Where is it available?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 14:24:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1574946#M199252</guid>
      <dc:creator>ddeyo1</dc:creator>
      <dc:date>2022-12-27T14:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Implement blocking read on rpmsg</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1575724#M199323</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/183793"&gt;@ddeyo1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can find an example code for the M4 core which is required to communicate with the linux side rpmsg char driver on other communities like toradex. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;----------------------------------------------------------------------------------&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Note: If this answers your query, kindly close the ticket. Thank you!&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;----------------------------------------------------------------------------------&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 05:02:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Implement-blocking-read-on-rpmsg/m-p/1575724#M199323</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2022-12-30T05:02:25Z</dc:date>
    </item>
  </channel>
</rss>

