<?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>Kinetis MicrocontrollersのトピックRe: Strange Time Sequence of UART Rx Interrupt and its Flag for KEA128</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-Time-Sequence-of-UART-Rx-Interrupt-and-its-Flag-for/m-p/1036410#M56680</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the following &lt;A href="https://www.nxp.com/downloads/en/device-drivers/SDK-DRIVER-FRDM-KEA-S32DS.zip"&gt;link &lt;/A&gt;you can find some FRDM examples, the one called&amp;nbsp;FRDM_KEA128_UART_Interrupt has an implementation using the UART2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jan 2020 19:04:43 GMT</pubDate>
    <dc:creator>Alexis_A</dc:creator>
    <dc:date>2020-01-07T19:04:43Z</dc:date>
    <item>
      <title>Strange Time Sequence of UART Rx Interrupt and its Flag for KEA128</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-Time-Sequence-of-UART-Rx-Interrupt-and-its-Flag-for/m-p/1036408#M56678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi NXP team,&lt;/P&gt;&lt;P&gt;I am developing a UART bootloader using FRDM-KEAZ128Q80. I want to realize a UART2 fifo by software, so i have to use UART2 receiving way by interrupting. But strange time sequence of UART rx interrupt and its flag occurs to me, that is,&lt;/P&gt;&lt;P&gt;1) only one interrupt Rx interrupt(UART2_C2[RIE]: Receiver Interrupt Enable for RDRF) is enabled;&lt;/P&gt;&lt;P&gt;2) program can run to UART2_IRQHandler(UART2 interrupt handle function in uart.c), when I transmit one byte data to board by Tera Term VT(virtual COM tools);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Strange:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3)&amp;nbsp;UART2_S1[RDRF] would be 0, when program enters into&amp;nbsp;&lt;SPAN&gt;UART2_IRQHandler() and use UART_IsRxBuffFull() to query Rx buffer of UART; but if i use&amp;nbsp;UART_GetChar(), the program can get the status of&amp;nbsp;UART&lt;SPAN&gt;2_&lt;/SPAN&gt;&lt;SPAN&gt;S1[RDRF]&lt;SPAN&gt;&amp;nbsp;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expectation :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;when evb receives a uart byte data, then run to uart interrupt handle and get the interrupt flag RDRF==1, but actually it is RDRF==1 if i query the flag at once in interrupt handle.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;When i can get the flag set(RDRF == 1)? it seems i have to use a polling loop to wait the flag.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;I dont know why ? if i use a while loop in my interrupt handle, i am warried that the loop wasting much time for wating&amp;nbsp; RDRF&amp;nbsp; set and even program will go stuck in the loop especially program cant get the flag set.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Environment and tools&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My EVB:&amp;nbsp;FRDM-KEAZ128Q80;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;IDE: S32DS for ARM 2018.R1;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;MCU PN: S9KEAZ128AMLK;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;SDK: 1.0.0&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;uart driver: uart.c, .h&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;UART configuration: BUS 20MHz, UART2 baud rate=115200bps, enable receive buffer full interrupt and receive function&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My uart configuration:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;//uart_manager.c&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;#define&amp;nbsp;TERMINAL_UART_PORT&amp;nbsp; UART2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void UartManager_Init()&lt;BR /&gt;{&lt;BR /&gt; UART_ConfigType sUartConfig = {{0}};&lt;BR /&gt; sUartConfig.u32SysClkHz = BUS_CLK_FREQ; // 20MHz(20000000)&lt;BR /&gt; sUartConfig.u32Baudrate = UART_BIT_BAUDRATE; // 115200kbps&lt;/P&gt;&lt;P&gt;sUartConfig.sctrl1settings.byte = 0;&lt;/P&gt;&lt;P&gt;sUartConfig.sctrl2settings.bits.bTe = 1; // transmitter enable&lt;BR /&gt; sUartConfig.sctrl2settings.bits.bRe = 1; // receive enable&lt;BR /&gt;sUartConfig.sctrl2settings.bits.bRie = 1; // receive buffer full interrupt enable&lt;/P&gt;&lt;P&gt;UART_SetCallback(TERMINAL_UART_PORT, UartManager_Interrupt);&lt;/P&gt;&lt;P&gt;UART_Init(TERMINAL_UART_PORT, &amp;amp;sUartConfig);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void UartManager_Interrupt(void)&lt;BR /&gt;{&lt;BR /&gt; volatile uint8_t data = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*only use 1 case (case 1, 2, 3) for test*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// case 1 - success to read flag RDRF and uart data&lt;/P&gt;&lt;P&gt;// data = UART_GetChar(TERMINAL_UART_PORT); // can get the received char&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// case 2 - success&amp;nbsp;&lt;SPAN&gt;to read flag RDRF and uart data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;//while(!UART_IsRxBuffFull(TERMINAL_UART_PORT)); // can pass the loop, which means RDRF==1&lt;/P&gt;&lt;P&gt;//data = UART_ReadDataReg(TERMINAL_UART_PORT);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// case 3 - failure&amp;nbsp;&lt;SPAN&gt;to read flag RDRF and uart data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/* if(UART_IsRxBuffFull(TERMINAL_UART_PORT)){ // cant get the flag RDRF == 1, it will run to else condition&lt;BR /&gt; data = UART_ReadDataReg(TERMINAL_UART_PORT);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; UART_ReadDataReg(TERMINAL_UART_PORT);&lt;BR /&gt; }*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jan 2020 16:49:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-Time-Sequence-of-UART-Rx-Interrupt-and-its-Flag-for/m-p/1036408#M56678</guid>
      <dc:creator>fortunelyx</dc:creator>
      <dc:date>2020-01-05T16:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Time Sequence of UART Rx Interrupt and its Flag for KEA128</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-Time-Sequence-of-UART-Rx-Interrupt-and-its-Flag-for/m-p/1036409#M56679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Serial loaders for the KEA128 (Kboot compatible or iHex, SREC) including robust SW FIFO interrupt/DMA driven driver, documented and industrially proven, are readily available at&lt;BR /&gt;&lt;A href="http://www.utasker.com/kinetis/FRDM-KEAZ128Q80.html" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KEAZ128Q80.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.pdf" target="test_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.pdf&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.utasker.com/docs/uTasker/uTaskerUART.PDF" target="test_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerUART.PDF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open Source at GITHUB and can be used on almost any Kinetis part, on any UART/LPUART and with any IDE without any porting work: &lt;A href="https://github.com/uTasker/uTasker-Kinetis" target="test_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are doing an educational project where you need to redevelop for learning purposes you can use the project to simulate the chip and its UART/interrupt operation and copy relevant parts to solve issues with initial code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2020 14:18:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-Time-Sequence-of-UART-Rx-Interrupt-and-its-Flag-for/m-p/1036409#M56679</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-01-07T14:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Time Sequence of UART Rx Interrupt and its Flag for KEA128</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-Time-Sequence-of-UART-Rx-Interrupt-and-its-Flag-for/m-p/1036410#M56680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the following &lt;A href="https://www.nxp.com/downloads/en/device-drivers/SDK-DRIVER-FRDM-KEA-S32DS.zip"&gt;link &lt;/A&gt;you can find some FRDM examples, the one called&amp;nbsp;FRDM_KEA128_UART_Interrupt has an implementation using the UART2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2020 19:04:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-Time-Sequence-of-UART-Rx-Interrupt-and-its-Flag-for/m-p/1036410#M56680</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-01-07T19:04:43Z</dc:date>
    </item>
  </channel>
</rss>

