<?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>8-bit MicrocontrollersのトピックRe: USB serial stack on JB16</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/USB-serial-stack-on-JB16/m-p/202013#M16591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to everyone for their help.&lt;BR /&gt;&lt;BR /&gt;It seems that while the low speed standard does not support bulk endpoints, one can still define an endpoint to be bulk on a low-speed device.&lt;BR /&gt;&lt;BR /&gt;Since my first post, I have now been able to send and receive data under Windows (Windows 2000), but not Linux (Ubuntu Dapper). Perhaps Linux is being more true to the standard. I also receive announcements like SetLineEncoding, SetBreak, etc.&lt;BR /&gt;&lt;BR /&gt;Anyway - I have to stop working on this project - it has taken too much time. I am attaching my abstract call model project. Perhaps someone who knows a little more about the ACM can have a look at it and point out the obvious problem that I am missing - I feel convinced that I am mis-handling some packets that arrive on EP0.&lt;BR /&gt;&lt;BR /&gt;The project has two targets, a keyboard HID from elsewhere on this site, and the virtual com port CDC ACM project. If anyone makes any improvements, please could they post the updates here. I have also used parts from the USBDM and drawn inspiration from some other CDC ACM projects (Microchip and CMX).&lt;BR /&gt;&lt;BR /&gt;The project is somewhat device independent - but it will take some work to reconfigure the register read/writes that access the USB peripheral on the JB16, to make it work with other devices.&lt;BR /&gt;&lt;BR /&gt;The numerous DEBUG*_PULSE, etc, are my toggling bits lines that I monitor on an oscilloscope to confirm program flow.&lt;BR /&gt;&lt;BR /&gt;To conclude, it mostly works under Win2K. It mounts as a /dev/ttyACM under Linux, but I can't write to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/files/community_files/8BITCOMM/12580_usb_hal_v_00_20081118_1143.zip" rel="nofollow" target="_self"&gt;usb_hal_v_00_20081118_1143.zip&lt;/A&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-10-27&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;12:01 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Nov 2008 18:01:07 GMT</pubDate>
    <dc:creator>markslFS</dc:creator>
    <dc:date>2008-11-18T18:01:07Z</dc:date>
    <item>
      <title>USB serial stack on JB16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/USB-serial-stack-on-JB16/m-p/202011#M16589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've have just spent about a week trying to get a CDC / ACM USB stack working on a JB16.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Before you point out the slow maximum data transfer rate, I need to interface with existing software that communicates a short packet every few seconds at 9600 baud, so the JB16 ought to be fast enough.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At this moment, when I plug the device into either my Linux machine or my Windows machine, it is recognized as a serial port. It appears as an ACM device in Linux (/dev/ttyACM1) and as a COM port under Windows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This just tells me that I have set up the descriptors, and have basic setup transfer working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do seem to be able to set line speed, etc, but I have not been able to 100% confirm this. As you can imagine, breakpoints interrupt the USB timing, so I have to use bit-toggling, which I monitor on an oscilloscope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately I can not send/receive data to the device. Under Linux I get " /dev/ttyACM1: Input/output error" when I try and read or write from the port, and the windows app just hangs. This also happens when I try and send a break under Windows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am attaching the output from "lsusb -v" (under Linux) and USBView (under Windows). I have just noticed that there is some suspicious information from USBView... I am also attaching my USB descriptors definitions. I left out the Call Management descriptor, as my Linux box complains that no call management is supported when I include it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My questions are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Does the JB16 support bulk end points on EP2? The ACM documentation says that the data endpoints have to be bulk, and Windows bluescreens on me if I set them to interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) How do I ensure that the data class interface on EP2 is enabled to generate USB interrupts when data arrives? Is it as simple as writing 0xFF to UIR2, then setting UIR0_RXD2IE ? In short, why can't I read/write data to the device (serial port)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) The CDC documentation is very confusing to me. Can anyone simplify the process of packet flow for me? In particular, to which endpoint does data get sent when I change the baud rate, etc? I am assuming that this does not always happen during setup (i.e. USR0_SETUP is or can be false).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4) I seem to be getting a spurious interrupt on EP0 TX, but I can't tell if I am not servicing a required request, or not. I just send an empty packet in response. I thought EP0 TX interrupts on happen when I am sending data, but my program logic says that no data is waiting to be sent. Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;5) I am assuming that when I want to send a notification to the OS that something has changed, I just prepare the data to be sent via EP1 (my notification end point), and enable the EP1 TX interrupt. Is this correct?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am happy to release this project Open Source once I get it working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ultimately I wish to replace all JB16 specific register writes with generic #defines so that the code can be adapated to other devices. But first I would really like to get this working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2008 02:40:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/USB-serial-stack-on-JB16/m-p/202011#M16589</guid>
      <dc:creator>markslFS</dc:creator>
      <dc:date>2008-11-14T02:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: USB serial stack on JB16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/USB-serial-stack-on-JB16/m-p/202012#M16590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&amp;gt; 1) Does the JB16 support bulk end points on EP2?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;No. Bulk endpoints only apply to full speed usb. JB16 is only low speed.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2008 18:28:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/USB-serial-stack-on-JB16/m-p/202012#M16590</guid>
      <dc:creator>MrBean</dc:creator>
      <dc:date>2008-11-17T18:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: USB serial stack on JB16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/USB-serial-stack-on-JB16/m-p/202013#M16591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to everyone for their help.&lt;BR /&gt;&lt;BR /&gt;It seems that while the low speed standard does not support bulk endpoints, one can still define an endpoint to be bulk on a low-speed device.&lt;BR /&gt;&lt;BR /&gt;Since my first post, I have now been able to send and receive data under Windows (Windows 2000), but not Linux (Ubuntu Dapper). Perhaps Linux is being more true to the standard. I also receive announcements like SetLineEncoding, SetBreak, etc.&lt;BR /&gt;&lt;BR /&gt;Anyway - I have to stop working on this project - it has taken too much time. I am attaching my abstract call model project. Perhaps someone who knows a little more about the ACM can have a look at it and point out the obvious problem that I am missing - I feel convinced that I am mis-handling some packets that arrive on EP0.&lt;BR /&gt;&lt;BR /&gt;The project has two targets, a keyboard HID from elsewhere on this site, and the virtual com port CDC ACM project. If anyone makes any improvements, please could they post the updates here. I have also used parts from the USBDM and drawn inspiration from some other CDC ACM projects (Microchip and CMX).&lt;BR /&gt;&lt;BR /&gt;The project is somewhat device independent - but it will take some work to reconfigure the register read/writes that access the USB peripheral on the JB16, to make it work with other devices.&lt;BR /&gt;&lt;BR /&gt;The numerous DEBUG*_PULSE, etc, are my toggling bits lines that I monitor on an oscilloscope to confirm program flow.&lt;BR /&gt;&lt;BR /&gt;To conclude, it mostly works under Win2K. It mounts as a /dev/ttyACM under Linux, but I can't write to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/files/community_files/8BITCOMM/12580_usb_hal_v_00_20081118_1143.zip" rel="nofollow" target="_self"&gt;usb_hal_v_00_20081118_1143.zip&lt;/A&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-10-27&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;12:01 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2008 18:01:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/USB-serial-stack-on-JB16/m-p/202013#M16591</guid>
      <dc:creator>markslFS</dc:creator>
      <dc:date>2008-11-18T18:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: USB serial stack on JB16</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/USB-serial-stack-on-JB16/m-p/202014#M16592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I just wanted to let you all know that after leaving this project alone for a bit, I have now made sufficient progress to be able to justify calling the project a success! (Despite the protocol violations of specifying that endpoint 2 use bulk transfer on a low-speed device).&lt;BR /&gt;&lt;BR /&gt;If anyone is interested, let me know, and I'll post the current project here.&lt;BR /&gt;&lt;BR /&gt;It still won't work under Linux, presumably because of the above mentioned protocol violations.&lt;BR /&gt;&lt;BR /&gt;To summarise: Under Windows 2000 (and presumably XP), the project uses Windows' own usbser.sys to provide a virtual COM port. It is implemented on a JB16. A very basic .inf file is needed to complete the installation.&lt;BR /&gt;&lt;BR /&gt;Next up, to consider converting this code to work on the JM32/JM60 high-speed device.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 20:57:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/USB-serial-stack-on-JB16/m-p/202014#M16592</guid>
      <dc:creator>markslFS</dc:creator>
      <dc:date>2008-12-03T20:57:10Z</dc:date>
    </item>
  </channel>
</rss>

