<?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: UART continuous transmission with interrups [AsyncSend/SetTxBuffer ] in S32K</title>
    <link>https://community.nxp.com/t5/S32K/UART-continuous-transmission-with-interrups-AsyncSend/m-p/1908853#M37728</link>
    <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/230018"&gt;@JorgeSans&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I'm afraid there is no such example.&lt;/P&gt;
&lt;P&gt;Can you describe the issue and share you code here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jul 2024 13:42:18 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2024-07-15T13:42:18Z</dc:date>
    <item>
      <title>UART continuous transmission with interrups [AsyncSend/SetTxBuffer ]</title>
      <link>https://community.nxp.com/t5/S32K/UART-continuous-transmission-with-interrups-AsyncSend/m-p/1907016#M37630</link>
      <description>&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P class="lia-align-justify"&gt;Hello,&lt;/P&gt;&lt;P class="lia-align-justify"&gt;I am trying to program an application for an S32K311 with continuous reception and transmission using the following functions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Lpuart_Uart_Ip_AsyncSend &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Lpuart_Uart_Ip_SetTxBuffer &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Lpuart_Uart_Ip_GetTransmitStatus&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Lpuart_Uart_Ip_AsyncReceive &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Lpuart_Uart_Ip_SetRxBuffer&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Lpuart_Uart_Ip_GetReceiveStatus&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class="lia-align-justify"&gt;As well as a callback function to receive events of type &lt;STRONG&gt;Lpuart_Uart_Ip_EventType&lt;/STRONG&gt;.&lt;/P&gt;&lt;P class="lia-align-justify"&gt;I have managed to get the reception part working correctly, but the transmission part is not working as expected.&lt;/P&gt;&lt;P class="lia-align-justify"&gt;Could someone explain how the functions dedicated to transmission should be used and ideally provide an example application?&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 12 Jul 2024 10:09:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/UART-continuous-transmission-with-interrups-AsyncSend/m-p/1907016#M37630</guid>
      <dc:creator>JorgeSans</dc:creator>
      <dc:date>2024-07-12T10:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: UART continuous transmission with interrups [AsyncSend/SetTxBuffer ]</title>
      <link>https://community.nxp.com/t5/S32K/UART-continuous-transmission-with-interrups-AsyncSend/m-p/1908853#M37728</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/230018"&gt;@JorgeSans&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I'm afraid there is no such example.&lt;/P&gt;
&lt;P&gt;Can you describe the issue and share you code here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 13:42:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/UART-continuous-transmission-with-interrups-AsyncSend/m-p/1908853#M37728</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-07-15T13:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: UART continuous transmission with interrups [AsyncSend/SetTxBuffer ]</title>
      <link>https://community.nxp.com/t5/S32K/UART-continuous-transmission-with-interrups-AsyncSend/m-p/1909551#M37752</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/160001"&gt;@danielmartynek&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I haven't been able to find the correct way to use the transmission mode with interrupts without resorting to blocking calls, I am temporarily using them. To prevent the start of a new message transmission before the previous one is finished, I create a lock. However, this is not ideal when the goal is to avoid blocking the application's execution.&lt;/P&gt;&lt;P&gt;What I need is to find an analogous method to the reception process, which works excellently with interrupts.&lt;/P&gt;&lt;P&gt;Any suggestions on how this should be implemented?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include "SerialFacility.h"
#include &amp;lt;string.h&amp;gt;
#include "cmsis_gcc.h"

extern Queue_t commandQueue;
uint8_t rxCommandBuff[CMD_BUFF_RX] = { 0 };
volatile uint8_t cursor;

void serialFacilityInit( ){
  	// Initializes an UART driver with interrupt enabled
    IntCtrl_Ip_EnableIrq(LPUART3_IRQn);
    // Configure UART3 peripheral
	Lpuart_Uart_Ip_Init(UART_CHANNEL_3, &amp;amp;Lpuart_Uart_Ip_xHwConfigPB_3);

	//  Start reception of command in interrupt mode
	Lpuart_Uart_Ip_AsyncReceive(UART_CHANNEL_3, rxCommandBuff, 1);
}

void uart3EventCallBack( const uint8 HwInstance, const Lpuart_Uart_Ip_EventType Event, void *UserData ){

	if (HwInstance == UART_CHANNEL_3)
	{
		if(Event == LPUART_UART_IP_EVENT_RX_FULL)
		{
			// The reception stops when newline is received or the buffer is full
			if ( ( rxCommandBuff[cursor] != FRAME_DELIMITER ) &amp;amp;&amp;amp; ( cursor != ( CMD_BUFF_RX - 2U ) ) )
			{
				// Update the buffer index and the rx buffer
				cursor++;
				Lpuart_Uart_Ip_SetRxBuffer(UART_CHANNEL_3, &amp;amp;rxCommandBuff[cursor],1U);
			}
			else
			{
				EnqueuedCommand pendingCmd;
				memcpy( ( char* ) pendingCmd.commnddBuff, ( char* ) rxCommandBuff, cursor );
				// Adding end of string dekimitator
				pendingCmd.commnddBuff[cursor] = '\0';
				pendingCmd.commandSize = cursor;
				if (!q_isFull(&amp;amp;commandQueue)) {
					q_push(&amp;amp;commandQueue, &amp;amp;pendingCmd);
				}
				cursor = 0;
				Lpuart_Uart_Ip_SetRxBuffer(UART_CHANNEL_3,&amp;amp;rxCommandBuff[cursor],1U);
			};
		}
		else if(Event == LPUART_UART_IP_EVENT_END_TRANSFER)
		{
			// Enable interrupt for again to be able to continue receiving data
			Lpuart_Uart_Ip_AsyncReceive( UART_CHANNEL_3, rxCommandBuff, 1 );
		}
		else if( Event == LPUART_UART_IP_EVENT_END_TRANSFER )
		{
					// Implementatio here to handl continous trasnmission
		}
	}
}


void sendMessage( const uint8_t* message )
{
	size_t length = strlen( ( char * ) message );
	volatile Lpuart_Uart_Ip_StatusType lpuartStatus = LPUART_UART_IP_STATUS_ERROR;

	lpuartStatus = Lpuart_Uart_Ip_AsyncSend(UART_CHANNEL_3, message, length);
        // Temporaru solution to avoid trasnmitinf a new  message before ending current trassmission
	uint32_t remainingByte;
	do
	{
		lpuartStatus = Lpuart_Uart_Ip_GetTransmitStatus(UART_CHANNEL_3, &amp;amp;remainingByte);
	    // Waiting for the transmit  to be completed
	} while ( remainingByte &amp;gt; 0 );
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 08:12:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/UART-continuous-transmission-with-interrups-AsyncSend/m-p/1909551#M37752</guid>
      <dc:creator>JorgeSans</dc:creator>
      <dc:date>2024-07-16T08:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: UART continuous transmission with interrups [AsyncSend/SetTxBuffer ]</title>
      <link>https://community.nxp.com/t5/S32K/UART-continuous-transmission-with-interrups-AsyncSend/m-p/1909779#M37763</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/230018"&gt;@JorgeSans&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I put my test project here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/Lpuart-Ip-Set-Tx-Buffer-Example-S32K344-S32DS35-RTD400-P24/ta-p/1909776" target="_blank"&gt;https://community.nxp.com/t5/S32K-Knowledge-Base/Lpuart-Ip-Set-Tx-Buffer-Example-S32K344-S32DS35-RTD400-P24/ta-p/1909776&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 13:42:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/UART-continuous-transmission-with-interrups-AsyncSend/m-p/1909779#M37763</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-07-16T13:42:02Z</dc:date>
    </item>
  </channel>
</rss>

