<?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: Console input with Processor Expert on FRDM-KLxx</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229445#M4832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use it with gets(), see&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/FRDM-KL25Z/FRDM-KL25Z_printf/Sources" title="https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/FRDM-KL25Z/FRDM-KL25Z_printf/Sources"&gt;mcuoneclipse/Examples/FRDM-KL25Z/FRDM-KL25Z_printf/Sources at master · ErichStyger/mcuoneclipse · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Just keep in mind that gets() reads/blocks until there is a \n&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jun 2013 08:43:27 GMT</pubDate>
    <dc:creator>BlackNight</dc:creator>
    <dc:date>2013-06-20T08:43:27Z</dc:date>
    <item>
      <title>Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229443#M4830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are plenty of working examples of using printf() for console output with FRDM-KL25Z etc. But I have not managed to find a working example of console input. The following code appears to block at the getchar() call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Console output works\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp; char c=getchar();&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("But this line is never executed.\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("I would like to process incoming character %c.\n", c);&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;What do I need to do? I am using a Processor Expert ConsoleIO component, which I assume is responsible for the functioning printf().&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 22:43:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229443#M4830</guid>
      <dc:creator>charlespalmer</dc:creator>
      <dc:date>2013-06-19T22:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229444#M4831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ever use scanf with K60 without RTOS it works well. so i think it should also work with Kinetis L. can you please try it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 02:00:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229444#M4831</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2013-06-20T02:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229445#M4832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use it with gets(), see&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/FRDM-KL25Z/FRDM-KL25Z_printf/Sources" title="https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/FRDM-KL25Z/FRDM-KL25Z_printf/Sources"&gt;mcuoneclipse/Examples/FRDM-KL25Z/FRDM-KL25Z_printf/Sources at master · ErichStyger/mcuoneclipse · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Just keep in mind that gets() reads/blocks until there is a \n&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 08:43:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229445#M4832</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2013-06-20T08:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229446#M4833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried scanf(), gets(), fgets() and getchar() all with the same result: I get no console output until I have typed 64 characters. Then the for loop executes several times in quick succession, printing the strings (delimited by newline) that I have typed. Then it will sit, apparently unresponsive, until I have typed another 64 characters, at which point it will print the strings in the buffer. Code follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; char incomingString[256];&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Type some characters, please.\n");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //gets(incomingString);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //fgets(incomingString, 5, stdin);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scanf("%s",incomingString);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Received: %s\n",incomingString);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The question is why do these routines not return strings immediately, and how do I make them behave normally?&amp;nbsp; I am using an FRDM-KL25Z with Processor Expert, having installed the CPU and ConsoleIO components. Is this some interrupt issue? In the Component Inspector for the Console I/O, the Interrupt service/event property is set to disabled and is greyed out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps a related issue: the printf() will not send characters until a newline has been printed. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 11:04:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229446#M4833</guid>
      <dc:creator>charlespalmer</dc:creator>
      <dc:date>2013-06-20T11:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229447#M4834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By default, CodeWarrior is setup to use a buffered behavior for the standard I/O functions (i.e., printf, gets, etc.).&amp;nbsp; You can turn that off using this command:&amp;nbsp; setvbuf(stdout, NULL, _IONBF, 0); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The KL25_SC code package has an example of this in the helloworld project (in the Processor Expert code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Chris&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 14:01:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229447#M4834</guid>
      <dc:creator>chris_brown</dc:creator>
      <dc:date>2013-06-20T14:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229448#M4835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Chris, that fixed it! Both for the scanf() and getchar() in stdin and printf() on stdout (which no longer waits for a newline). I added this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; setvbuf(stdout, NULL, _IONBF, 0); // no buffering on stdout - for printf()&lt;/P&gt;&lt;P&gt;&amp;nbsp; setvbuf(stdin, NULL, _IONBF, 0); // no buffering on stdin - for getchar() etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Interestingly, gets(incomingString) does not work, &lt;/SPAN&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;SPAN class="mce_paste_marker"&gt; whereas&lt;/SPAN&gt; fgets(incomingString, 5, stdin) does work. But getchar() and scanf() are sufficient for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 14:49:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229448#M4835</guid>
      <dc:creator>charlespalmer</dc:creator>
      <dc:date>2013-06-20T14:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229449#M4836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For some reason this doesn't work for me. I've added the call to &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;setvbuf(stdin, NULL, _IONBF, 0);&lt;/SPAN&gt; but getchar(), scanf() and gets(buf, size, stdin) all continue to block. I even tried recompiling the EWL C Library with #define _EWL_BUFFERED_CONSOLE 0. setvbuf doesn't return an error value. I am running CW 10.4 with the Freedom K25 board. I'm not sure why this isn't working!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 22:26:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229449#M4836</guid>
      <dc:creator>matthews</dc:creator>
      <dc:date>2013-10-11T22:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229450#M4837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All of the underlying stdin reads come down to the following function provided by the CW Processor Expert (see below). In this function it is blocking on the while /* Wait until a char is received */. I replaced the while loop with a break; and I am able to use stdin reads of 1 char at a time. I'm not sure how to instruct the processor expert to generate the function as nonblocking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;** ===================================================================&lt;/P&gt;&lt;P&gt;**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; CsIO1___read_console (component ConsoleIO)&lt;/P&gt;&lt;P&gt;**&lt;/P&gt;&lt;P&gt;**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description :&lt;/P&gt;&lt;P&gt;**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __read_console&lt;/P&gt;&lt;P&gt;**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This method is internal. It is used by Processor Expert only.&lt;/P&gt;&lt;P&gt;** ===================================================================&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;int __read_console(__file_handle handle, unsigned char* buffer, size_t * count)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; size_t CharCnt = 0x00;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; (void)handle;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Parameter is not used, suppress unused argument warning */&lt;/P&gt;&lt;P&gt;&amp;nbsp; for (;*count &amp;gt; 0x00; --*count) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Clear error flags */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART0_PDD_ClearInterruptFlags(UART0_BASE_PTR,0x1FU);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((UART0_PDD_ReadInterruptStatusReg(UART0_BASE_PTR) &amp;amp; UART0_S1_RDRF_MASK) == 0x00) { /* Any data in receiver buffer */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // MWS 10-11-2013 -- if no data is here, simply return instead of blocking on data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (CharCnt != 0x00) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* No, at least one char received? */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Yes, return received char(s) */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Wait until a char is received */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ((UART0_PDD_ReadInterruptStatusReg(UART0_BASE_PTR) &amp;amp; UART0_S1_RDRF_MASK) == 0x00) {};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CharCnt++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Increase char counter */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Save character received by UARTx device into the receive buffer */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *buffer = (unsigned char)UART0_PDD_GetChar8(UART0_BASE_PTR);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Stop reading if CR (Ox0D) character is received */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (*buffer == 0x0DU) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* New line character (CR) received ? */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *buffer = '\n';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Yes, convert LF to '\n' char. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Stop loop and return received char(s) */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffer++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Increase buffer pointer */&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; *count = CharCnt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; return (__no_io_error);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 23:06:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229450#M4837</guid>
      <dc:creator>matthews</dc:creator>
      <dc:date>2013-10-11T23:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229451#M4838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need two terminals opened in linux. One to send data and other to receive and see the data on serial port from computer. I was using minicom to read the serial port and I had anything. So I looked in the minicom serial port setup and changed the Hardware Flow Control to No. After that I can see the string or character that I send from computer serial port according the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Read whole string&amp;nbsp; from embedded serial port&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;char str[10]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//string length&amp;nbsp;&lt;/P&gt;&lt;P&gt;scanf("%s", str);&lt;BR /&gt; printf("the str is : %s\n", str);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//print the string on serial port&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Read&amp;nbsp;char from embedded serial port&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;char character[1];&amp;nbsp;&lt;/P&gt;&lt;P&gt;scanf("%c",&amp;nbsp;&lt;SPAN&gt;character&lt;/SPAN&gt;);&lt;BR /&gt;printf("the&amp;nbsp;&lt;SPAN&gt;character&lt;/SPAN&gt; is : %c\n",&lt;SPAN&gt;character[0]&lt;/SPAN&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//print the string on serial port&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To send data from linux terminal to embedded serial port (as root):&lt;/P&gt;&lt;P&gt;echo -e string&amp;nbsp;&amp;gt; /dev/ttyUSB0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check your serial file in /dev (it can be&amp;nbsp;&lt;SPAN&gt;ttyUSB0,&amp;nbsp;&lt;SPAN&gt;ttyUSB1,&amp;nbsp;&lt;SPAN&gt;ttyUSB2... just check if there is anyone like that).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;I'm using:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;- Processor Expert on Kinetis Design (eclipse)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;- Arm7 (mk22fx512xx)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;- Console IO component (in the processor expert)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Serial on loop&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;You can receive the same data that you send in your&amp;nbsp;embedded system to test the serial port, for examplo, and see in debug if it&amp;nbsp;is working. You just need to change the loop while from the _read method in the CsIO1.c founded in Generated_Code from your project&amp;nbsp;(automatically generated by console component).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;while ((UART_PDD_ReadInterruptStatusReg(UART0_BASE_PTR) &amp;amp; UART_S1_RDRF_MASK) == 0x00) {};&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;do that:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;while ((UART_PDD_ReadInterruptStatusReg(UART0_BASE_PTR) &amp;amp; UART_S1_RDRF_MASK) == 0x00) {&lt;BR /&gt;printf("%s", str);&amp;nbsp;&amp;nbsp;&amp;nbsp;//or&amp;nbsp;&lt;SPAN&gt;printf("%c", character[0]')&amp;nbsp;&lt;/SPAN&gt;put the data according the code above.&lt;BR /&gt; };&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 16:42:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/229451#M4838</guid>
      <dc:creator>jeffersonfpalhe</dc:creator>
      <dc:date>2016-10-26T16:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/1371638#M61862</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/40323"&gt;@chris_brown&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/1452"&gt;@BlackNight&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/13026"&gt;@ZhangJennie&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the FRDM-K22F board and I have been facing the same issue. I am trying to read a character from the console terminal using the getchar() function. However, the setvbuf() function call did not seem to work in my case. Is there any workaround for this?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 04:58:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/1371638#M61862</guid>
      <dc:creator>JSunil</dc:creator>
      <dc:date>2021-11-16T04:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/1371730#M61863</link>
      <description>&lt;P&gt;Does it work if you type in more characters?&lt;/P&gt;&lt;P&gt;Keep in mind that the implementation and especially semihosting depends on the debug firmware used (e.g. Segger vs. P&amp;amp;E vs. CMSIS-DAP).&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 07:31:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/1371730#M61863</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2021-11-16T07:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/1372134#M61866</link>
      <description>&lt;P&gt;Update: I did some digging (FRDM-K22F, MCUXpresso SDK and IDE), and for me semihosting with getc() and getchar() is not working (tried with newlib and J-Link). But I managed to get it working with native semihosting calls. So to me there are missing calls in the newlib, or it is broken if it ever worked. Normal printf() works.&lt;/P&gt;&lt;P&gt;So if you really need getc(), you probable should do the same as I do, with using direct system calls?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:32:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/1372134#M61866</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2021-11-16T16:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Console input with Processor Expert on FRDM-KLxx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/1612977#M64835</link>
      <description>&lt;P&gt;I managed to use semihosting directly, see &lt;A href="https://mcuoneclipse.com/2023/03/09/using-semihosting-the-direct-way/" target="_blank"&gt;https://mcuoneclipse.com/2023/03/09/using-semihosting-the-direct-way/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The example project used in that article uses both stdout and stdin, and works nicely and efficient (still keep in mind that semihosting stops the target).&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 08:02:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Console-input-with-Processor-Expert-on-FRDM-KLxx/m-p/1612977#M64835</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2023-03-10T08:02:04Z</dc:date>
    </item>
  </channel>
</rss>

