<?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>Vybrid ProcessorsのトピックRe: MQX Vybrid Serial communication error</title>
    <link>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279679#M1946</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you use the USB to serial connection via the OpenSDA debug port or the direct serial via the DB9 connector?&amp;nbsp; There are issues with the USB serial.&amp;nbsp; Set very tiny jumpers at the 'white' connector side midway to be parallel to the connector.&amp;nbsp; They are J23 and J24.&amp;nbsp; The OpenSDA debugger definitely has issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Feb 2014 20:23:08 GMT</pubDate>
    <dc:creator>billpringlemeir</dc:creator>
    <dc:date>2014-02-07T20:23:08Z</dc:date>
    <item>
      <title>MQX Vybrid Serial communication error</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279677#M1944</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;I'm having a bit of a problem with the serial communication on the Vybrid. I can write from the UART on the Vybrid fine, but it has trouble receiving data correctly. I've been sending data from a couple different terminal emulators (one of them being TeraTerm). Code below, using MQX 4.0.2, VF60GS10, IAR EWARM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; pointer old_handle, fh_ptr, statptr;&lt;/P&gt;&lt;P&gt;&amp;nbsp; boolean disable_rx = FALSE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 baud = 9600;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 result;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 ser_opts = IO_SERIAL_NON_BLOCKING;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fh_ptr = (pointer)fopen("ttyb:", BSP_DEFAULT_IO_OPEN_MODE); &lt;/P&gt;&lt;P&gt;&amp;nbsp; result = ioctl(fh_ptr, IO_IOCTL_SERIAL_SET_FLAGS, &amp;amp;ser_opts);&lt;/P&gt;&lt;P&gt;&amp;nbsp; result = ioctl(fh_ptr, IO_IOCTL_SERIAL_DISABLE_RX, &amp;amp;disable_rx );&lt;/P&gt;&lt;P&gt;&amp;nbsp; result = ioctl(fh_ptr, IO_IOCTL_SERIAL_SET_BAUD, &amp;amp;baud);&lt;/P&gt;&lt;P&gt;&amp;nbsp; fflush(fh_ptr);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (fh_ptr == NULL) {&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;&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; //if no driver, driver not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Cannot open IO device\n");&lt;/P&gt;&lt;P&gt;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //if driver works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; old_handle = _io_set_handle(IO_STDOUT, fh_ptr);&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; //changing the address of the IO handle IO_STDOUT to that pointed to by fh_ptr&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; fflush(stdout);&lt;/P&gt;&lt;P&gt;&amp;nbsp; _mqx_int bytes_written;&lt;/P&gt;&lt;P&gt;&amp;nbsp; char tx_data_buffer[] = "abc";&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(1){&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; char rx_data_buffer[16] = "";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; char num_bytes_written =&amp;nbsp;&amp;nbsp;&amp;nbsp; write(stdout, tx_data_buffer, strlen(tx_data_buffer));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; char num_bytes_read = read( stdout, rx_data_buffer, 16);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Often, the Vybrid doesn't recognize all the bytes that the terminal emulator sends: num_bytes_read and UART1_RCFIFO (before read) are smaller than the number of characters originally sent. Other times, the Vybrid can recognize that X characters were sent, but thinks that they're all zero. Sometimes, the processor receives all the characters correctly, but will have them slightly out of order (e.g. displays "2345678abcdef01" in rx_data_buffer instead of "12345678abcdef0"). I've tried changing the buffer size and gotten different (but not consistently correct) results. I've also tried switching off non-blocking mode, but had odd results when doing that. Thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 02:48:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279677#M1944</guid>
      <dc:creator>n00b1024</dc:creator>
      <dc:date>2014-02-06T02:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: MQX Vybrid Serial communication error</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279678#M1945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've also tried working outside of the MQX driver, setting up the UART according to the registers pictured below. When I try to read the UART1_D register inside an infinite while loop, it'll skip received characters. For example, if I send the string "12345", I might get "1", "3", "4" during consecutive reads of UART1_D. I also ran the program on another VF60GS10 board and had the same issues, so it's not due to electrical damage to the board.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="uart1_default.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/42565i8337D9717D3E3F5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="uart1_default.png" alt="uart1_default.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 17:17:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279678#M1945</guid>
      <dc:creator>n00b1024</dc:creator>
      <dc:date>2014-02-07T17:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: MQX Vybrid Serial communication error</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279679#M1946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you use the USB to serial connection via the OpenSDA debug port or the direct serial via the DB9 connector?&amp;nbsp; There are issues with the USB serial.&amp;nbsp; Set very tiny jumpers at the 'white' connector side midway to be parallel to the connector.&amp;nbsp; They are J23 and J24.&amp;nbsp; The OpenSDA debugger definitely has issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 20:23:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279679#M1946</guid>
      <dc:creator>billpringlemeir</dc:creator>
      <dc:date>2014-02-07T20:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: MQX Vybrid Serial communication error</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279680#M1947</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;I have used your code sample and saw similar results. I expect the problem is that you are opening 'ttyb:' which is by default assigned to STDOUT/STDIN on Vybrid Tower module. Please see my code snippet, it reads data from TWR-SER2 serial and prints them to OpenSDA virtual port (or vice versa, depending on your J23 and J24 setting). Works well for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FILE * sci2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;char buffer[16] = "";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;uint_32 baud = 115200;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;uint_32 br = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;sci2 = fopen("ttyc:","");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ioctl(sci2, IO_IOCTL_SERIAL_SET_BAUD, &amp;amp;baud);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;while(1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; br = read( sci2, buffer, 15);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffer[br+1] = '\0';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("%s\n", buffer);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Feb 2014 16:16:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279680#M1947</guid>
      <dc:creator>rendy</dc:creator>
      <dc:date>2014-02-09T16:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: MQX Vybrid Serial communication error</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279681#M1948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rene,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the advice. I'm using the debug port deliberately, and have switched my jumper settings depending on whether I was to use the debug port or the serial connector on the TWR-SER. I fixed the problem with reading by cutting out most of the MQX reading function and tweaking my code to reading the data register on the Vybrid, as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp; pointer old_handle, fh_ptr, statptr;&lt;/P&gt;&lt;P&gt;&amp;nbsp; boolean disable_rx = FALSE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 baud = 9600;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 result;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 ser_opts = IO_SERIAL_NON_BLOCKING; &lt;/P&gt;&lt;P&gt;&amp;nbsp; fh_ptr = (pointer)fopen(RS232_CHANNEL, BSP_DEFAULT_IO_OPEN_MODE);&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; result = ioctl(fh_ptr, IO_IOCTL_SERIAL_SET_FLAGS, &amp;amp;ser_opts);&lt;/P&gt;&lt;P&gt;&amp;nbsp; result = ioctl(fh_ptr, IO_IOCTL_SERIAL_DISABLE_RX, &amp;amp;disable_rx );&lt;/P&gt;&lt;P&gt;&amp;nbsp; result = ioctl(fh_ptr, IO_IOCTL_SERIAL_SET_BAUD, &amp;amp;baud);&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; char i = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; char rx_data_buffer[3];&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;&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; //can also be done with a 16-char buffer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!(UART1_SFIFO &amp;amp; 0x40)){&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;&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; //if the rx buffer isn't empty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(i&amp;lt;3){&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rx_data_buffer[i] = UART1_D;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++; &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;&amp;nbsp;&amp;nbsp; i = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART1_CFIFO |= 0x40;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //flushing the RXFIFO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memset(rx_data_buffer,0,sizeof(rx_data_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; //reset the array to zero&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 19:12:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279681#M1948</guid>
      <dc:creator>n00b1024</dc:creator>
      <dc:date>2014-02-10T19:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: MQX Vybrid Serial communication error</title>
      <link>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279682#M1949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bill, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been using the OpenSDA debugger so far, and managed to fix my problem, but it's a relief to hear that other people have been having problems with it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 19:13:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Vybrid-Processors/MQX-Vybrid-Serial-communication-error/m-p/279682#M1949</guid>
      <dc:creator>n00b1024</dc:creator>
      <dc:date>2014-02-10T19:13:31Z</dc:date>
    </item>
  </channel>
</rss>

