<?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>S32 Design StudioのトピックS32k uart RX interrupt handler problem</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-handler-problem/m-p/868433#M4455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am configuring UART communication over S32K144 EVB.&lt;/P&gt;&lt;P&gt;I use LPUART1 (Rx : PTD13 , Tx : PTC7) that is inerrupt type.&lt;/P&gt;&lt;P&gt;But My&amp;nbsp;&amp;nbsp;LPUART1_RxTx_IRQHandler only works once at first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know solution to this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;this is my init function about LPUART1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void LPUART1_init(void) /* Init. summary: 9600 baud, 1 stop bit, 8 bit format, no parity */&lt;BR /&gt;{&lt;BR /&gt; PCC-&amp;gt;PCCn[PCC_LPUART1_INDEX] &amp;amp;= ~PCC_PCCn_CGC_MASK; /* Ensure clk disabled for config */&lt;BR /&gt; PCC-&amp;gt;PCCn[PCC_LPUART1_INDEX] |= PCC_PCCn_PCS(1) /* Clock Src= 1 (SOSCDIV2_CLK) */&lt;BR /&gt; | PCC_PCCn_CGC_MASK; /* Enable clock for LPUART1 regs */&lt;/P&gt;&lt;P&gt;LPUART1-&amp;gt;BAUD = ((DEBUG_OSR &amp;lt;&amp;lt; 24) | (SBR(DEBUG_BAUDRATE, DEBUG_OSR))); /* Initialize for 115200baud, 1 stop: */&amp;nbsp;&lt;BR /&gt; /* SBR=52 (0x34): baud divisor = 8M/9600/16 = ~52 */&lt;BR /&gt; /* OSR=15: Over sampling ratio = 15+1=16 */&lt;BR /&gt; /* SBNS=0: One stop bit */&lt;BR /&gt; /* BOTHEDGE=0: receiver samples only on rising edge */&lt;BR /&gt; /* M10=0: Rx and Tx use 7 to 9 bit data characters */&lt;BR /&gt; /* RESYNCDIS=0: Resync during rec'd data word supported */&lt;BR /&gt; /* LBKDIE, RXEDGIE=0: interrupts disable */&lt;BR /&gt; /* TDMAE, RDMAE, TDMAE=0: DMA requests disabled */&lt;BR /&gt; /* MAEN1, MAEN2, MATCFG=0: Match disabled */&lt;/P&gt;&lt;P&gt;LPUART1-&amp;gt;CTRL=0x000C0000; /* Enable transmitter &amp;amp; receiver, no parity, 8 bit char: */&lt;BR /&gt; /* RE=1: Receiver enabled */&lt;BR /&gt; /* TE=1: Transmitter enabled */&lt;BR /&gt; /* PE,PT=0: No hw parity generation or checking */&lt;BR /&gt; /* M7,M,R8T9,R9T8=0: 8-bit data characters*/&lt;BR /&gt; /* DOZEEN=0: LPUART enabled in Doze mode */&lt;BR /&gt; /* ORIE,NEIE,FEIE,PEIE,TIE,TCIE,RIE,ILIE,MA1IE,MA2IE=0: no IRQ*/&lt;BR /&gt; /* TxDIR=0: TxD pin is input if in single-wire mode */&lt;BR /&gt; /* TXINV=0: TRansmit data not inverted */&lt;BR /&gt; /* RWU,WAKE=0: normal operation; rcvr not in statndby */&lt;BR /&gt; /* IDLCFG=0: one idle character */&lt;BR /&gt; /* ILT=0: Idle char bit count starts after start bit */&lt;BR /&gt; /* SBK=0: Normal transmitter operation - no break char */&lt;BR /&gt; /* LOOPS,RSRC=0: no loop back */&lt;BR /&gt; /* Enable transmitter &amp;amp; receiver, no parity, 8 bit char: */&lt;/P&gt;&lt;P&gt;// Enable Interrupt ---------------------------------------------------------------&lt;BR /&gt; S32_NVIC-&amp;gt;ICPR[ 33 / 32 ] = 1 &amp;lt;&amp;lt; (33 % 32);&lt;BR /&gt; /* Interrupt Enable */&lt;BR /&gt; S32_NVIC-&amp;gt;ISER[ 33 / 32 ] = 1 &amp;lt;&amp;lt; (33 % 32);&lt;/P&gt;&lt;P&gt;S32_NVIC-&amp;gt;IP[33] = 0x10;&lt;/P&gt;&lt;P&gt;LPUART1-&amp;gt;CTRL |= LPUART_CTRL_RIE_MASK; // Rx Interrupt Enable&lt;BR /&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my&amp;nbsp;LPUART1_RxTx_IRQHandler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void LPUART1_RxTx_IRQHandler( void )&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt; static uint8_t indx = 0;&lt;/P&gt;&lt;P&gt;// Tx completed&lt;BR /&gt; if( (LPUART1-&amp;gt;STAT &amp;amp; LPUART_STAT_TDRE_MASK) )&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; // RX completed&lt;BR /&gt; if( LPUART1-&amp;gt;STAT &amp;amp; LPUART_STAT_RDRF_MASK )&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;nRxData = LPUART1-&amp;gt;DATA; // DUMMY&lt;/P&gt;&lt;P&gt;indx ++;&lt;/P&gt;&lt;P&gt;if(indx % 2 ==0)&lt;BR /&gt; PINS_DRV_WritePin(LED_GPIO_PORT, PORT_LED1_INDEX, 1U);&lt;BR /&gt; else&lt;BR /&gt; PINS_DRV_WritePin(LED_GPIO_PORT, PORT_LED1_INDEX, 0U);&lt;/P&gt;&lt;P&gt;if(indx &amp;gt; 100)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;indx = 0;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please reply my question.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Mar 2019 00:41:17 GMT</pubDate>
    <dc:creator>hjinha</dc:creator>
    <dc:date>2019-03-19T00:41:17Z</dc:date>
    <item>
      <title>S32k uart RX interrupt handler problem</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-handler-problem/m-p/868433#M4455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am configuring UART communication over S32K144 EVB.&lt;/P&gt;&lt;P&gt;I use LPUART1 (Rx : PTD13 , Tx : PTC7) that is inerrupt type.&lt;/P&gt;&lt;P&gt;But My&amp;nbsp;&amp;nbsp;LPUART1_RxTx_IRQHandler only works once at first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know solution to this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;this is my init function about LPUART1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void LPUART1_init(void) /* Init. summary: 9600 baud, 1 stop bit, 8 bit format, no parity */&lt;BR /&gt;{&lt;BR /&gt; PCC-&amp;gt;PCCn[PCC_LPUART1_INDEX] &amp;amp;= ~PCC_PCCn_CGC_MASK; /* Ensure clk disabled for config */&lt;BR /&gt; PCC-&amp;gt;PCCn[PCC_LPUART1_INDEX] |= PCC_PCCn_PCS(1) /* Clock Src= 1 (SOSCDIV2_CLK) */&lt;BR /&gt; | PCC_PCCn_CGC_MASK; /* Enable clock for LPUART1 regs */&lt;/P&gt;&lt;P&gt;LPUART1-&amp;gt;BAUD = ((DEBUG_OSR &amp;lt;&amp;lt; 24) | (SBR(DEBUG_BAUDRATE, DEBUG_OSR))); /* Initialize for 115200baud, 1 stop: */&amp;nbsp;&lt;BR /&gt; /* SBR=52 (0x34): baud divisor = 8M/9600/16 = ~52 */&lt;BR /&gt; /* OSR=15: Over sampling ratio = 15+1=16 */&lt;BR /&gt; /* SBNS=0: One stop bit */&lt;BR /&gt; /* BOTHEDGE=0: receiver samples only on rising edge */&lt;BR /&gt; /* M10=0: Rx and Tx use 7 to 9 bit data characters */&lt;BR /&gt; /* RESYNCDIS=0: Resync during rec'd data word supported */&lt;BR /&gt; /* LBKDIE, RXEDGIE=0: interrupts disable */&lt;BR /&gt; /* TDMAE, RDMAE, TDMAE=0: DMA requests disabled */&lt;BR /&gt; /* MAEN1, MAEN2, MATCFG=0: Match disabled */&lt;/P&gt;&lt;P&gt;LPUART1-&amp;gt;CTRL=0x000C0000; /* Enable transmitter &amp;amp; receiver, no parity, 8 bit char: */&lt;BR /&gt; /* RE=1: Receiver enabled */&lt;BR /&gt; /* TE=1: Transmitter enabled */&lt;BR /&gt; /* PE,PT=0: No hw parity generation or checking */&lt;BR /&gt; /* M7,M,R8T9,R9T8=0: 8-bit data characters*/&lt;BR /&gt; /* DOZEEN=0: LPUART enabled in Doze mode */&lt;BR /&gt; /* ORIE,NEIE,FEIE,PEIE,TIE,TCIE,RIE,ILIE,MA1IE,MA2IE=0: no IRQ*/&lt;BR /&gt; /* TxDIR=0: TxD pin is input if in single-wire mode */&lt;BR /&gt; /* TXINV=0: TRansmit data not inverted */&lt;BR /&gt; /* RWU,WAKE=0: normal operation; rcvr not in statndby */&lt;BR /&gt; /* IDLCFG=0: one idle character */&lt;BR /&gt; /* ILT=0: Idle char bit count starts after start bit */&lt;BR /&gt; /* SBK=0: Normal transmitter operation - no break char */&lt;BR /&gt; /* LOOPS,RSRC=0: no loop back */&lt;BR /&gt; /* Enable transmitter &amp;amp; receiver, no parity, 8 bit char: */&lt;/P&gt;&lt;P&gt;// Enable Interrupt ---------------------------------------------------------------&lt;BR /&gt; S32_NVIC-&amp;gt;ICPR[ 33 / 32 ] = 1 &amp;lt;&amp;lt; (33 % 32);&lt;BR /&gt; /* Interrupt Enable */&lt;BR /&gt; S32_NVIC-&amp;gt;ISER[ 33 / 32 ] = 1 &amp;lt;&amp;lt; (33 % 32);&lt;/P&gt;&lt;P&gt;S32_NVIC-&amp;gt;IP[33] = 0x10;&lt;/P&gt;&lt;P&gt;LPUART1-&amp;gt;CTRL |= LPUART_CTRL_RIE_MASK; // Rx Interrupt Enable&lt;BR /&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my&amp;nbsp;LPUART1_RxTx_IRQHandler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void LPUART1_RxTx_IRQHandler( void )&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt; static uint8_t indx = 0;&lt;/P&gt;&lt;P&gt;// Tx completed&lt;BR /&gt; if( (LPUART1-&amp;gt;STAT &amp;amp; LPUART_STAT_TDRE_MASK) )&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; // RX completed&lt;BR /&gt; if( LPUART1-&amp;gt;STAT &amp;amp; LPUART_STAT_RDRF_MASK )&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;nRxData = LPUART1-&amp;gt;DATA; // DUMMY&lt;/P&gt;&lt;P&gt;indx ++;&lt;/P&gt;&lt;P&gt;if(indx % 2 ==0)&lt;BR /&gt; PINS_DRV_WritePin(LED_GPIO_PORT, PORT_LED1_INDEX, 1U);&lt;BR /&gt; else&lt;BR /&gt; PINS_DRV_WritePin(LED_GPIO_PORT, PORT_LED1_INDEX, 0U);&lt;/P&gt;&lt;P&gt;if(indx &amp;gt; 100)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;indx = 0;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please reply my question.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2019 00:41:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-handler-problem/m-p/868433#M4455</guid>
      <dc:creator>hjinha</dc:creator>
      <dc:date>2019-03-19T00:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: S32k uart RX interrupt handler problem</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-handler-problem/m-p/868434#M4456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are using SDK in your project. The easiest way how to use LPUART is add it in processor expert, configure it, generate Processor Expert code, init UART and assign callback in main.c like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPUART_DRV_Init(INST_LPUART1, &amp;amp;lpuart1_State, &amp;amp;lpuart1_InitConfig0);&lt;BR /&gt;LPUART_DRV_InstallRxCallback(INST_LPUART1, rxCallback, NULL);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where rxCallback is for example is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;void rxCallback(void *driverState, uart_event_t event, void *userData)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;// Toggle blue LED when character is received&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;PINS_DRV_TogglePins(PTD, 1 &amp;lt;&amp;lt; LED0_PIN_INDEX);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with SDK - there is no needs to set registers. With the very simple code (above) I have no issue with Interrupt and callback.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference you can look at lpuart_echo_s32k144&amp;nbsp; SDK example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jiri&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2019 12:18:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-handler-problem/m-p/868434#M4456</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2019-03-19T12:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: S32k uart RX interrupt handler problem</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-handler-problem/m-p/868435#M4457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jiri Kral，&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am using&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;lpuart_echo_s32k144&amp;nbsp; SDK example to test uart ,&amp;nbsp; if this example&amp;nbsp;&lt;SPAN&gt;with Interrupt and callback , why need the code as below:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;UART_ReceiveData(&amp;amp;uart_instance, buffer, 1U);&lt;BR /&gt; /* Wait for transfer to be completed */&lt;BR /&gt; while(UART_GetReceiveStatus(&amp;amp;uart_instance, &amp;amp;bytesRemaining) == STATUS_BUSY);&lt;/P&gt;&lt;P&gt;/* Check the status */&lt;BR /&gt; status = UART_GetReceiveStatus(&amp;amp;uart_instance, &amp;amp;bytesRemaining);&lt;/P&gt;&lt;P&gt;if (status != STATUS_SUCCESS)&lt;BR /&gt; {&lt;BR /&gt; /* If an error occurred, send the error message and exit the loop */&lt;BR /&gt; UART_SendDataBlocking(&amp;amp;uart_instance, (uint8_t *)errorMsg, strlen(errorMsg), TIMEOUT);&lt;BR /&gt; break;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lpuart rx with&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Interrupt and callback , why add rec function in while loop ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;thank you very much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Mike&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2019 09:04:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/S32k-uart-RX-interrupt-handler-problem/m-p/868435#M4457</guid>
      <dc:creator>mikening</dc:creator>
      <dc:date>2019-05-22T09:04:05Z</dc:date>
    </item>
  </channel>
</rss>

