<?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>LPC Microcontrollers中的主题 Re: LPC11u37h usb DEVCMDSTAT register.. cannot change the DEV_ADDR bits...</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u37h-usb-DEVCMDSTAT-register-cannot-change-the-DEV-ADDR/m-p/525142#M7778</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Tsuneo on Thu Dec 11 02:01:13 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;2. i am writing the new address into DEVCMDSTAT register inside the ISR of the endpoint0 IN interrupt (which correspond to the STATUS stage completion).&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When your firmware sees the completion ISR on the IN EP0, the STATUS stage has finished on the bus.&amp;nbsp; I know you are faithful to the USB2.0 spec, 9.2.6.3 Set Address Processing ;-)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the user manual of this MCU states as follows,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&lt;STRONG&gt;11.6.1 USB Device Command/Status register (DEVCMDSTAT)&lt;/STRONG&gt;&lt;BR /&gt;DEV_ADDR&lt;BR /&gt;When receiving a SetAddress Control Request from the USB host, software must program the new address &lt;STRONG&gt;before&lt;/STRONG&gt; completing the status phase of the SetAddress Control Request.&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your firmware has to write to DEV_ADDR, when it sees SETUP stage of Set_Address request.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The process of Set_Address depends on SIE design so much. To implement your own stack, always refer to the MCU manual, if it would require specific sequence or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tsuneo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:53:27 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:53:27Z</dc:date>
    <item>
      <title>LPC11u37h usb DEVCMDSTAT register.. cannot change the DEV_ADDR bits...</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u37h-usb-DEVCMDSTAT-register-cannot-change-the-DEV-ADDR/m-p/525141#M7777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by siangming on Wed Dec 10 23:26:05 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i am trying to implement a simple USB device on the lpc11u37h.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i am writing my own device drivers on the lpc, but my program got stuck at the Set Address request from the host PC (win 7).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. i am getting a valid new address from the host.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. i am writing the new address into DEVCMDSTAT register inside the ISR of the endpoint0 IN interrupt (which correspond to the STATUS stage completion). i know for sure that i am writing the new address in the STATUS stage completion because i set a flag during the SETADDRESS request handling and check for this flag in my endpoint0 IN ISR before i proceed to set the new address.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here comes the problem.. upon inspection of the register values, i realised i cannot write to the DEV_ADDR (bit0..6) of the DEVCMDSTAT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ptrToUSB-&amp;gt;DEVCMDSTAT |= 0x7F; has no effect on the last 7bits of the register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- To investigate further, i loaded an example USB HID application by NXP into my LPC chip and it can enumerate ok on the same host pc. This proves my LPC hardware is ok.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Next, i tried to write to the DEV_ADDR (bit0..6) of the DEVCMDSTAT at the beginning of my program (just after reset_handler)..i also cannot change the bit0..6 at all.. but i can change the other bits of the DEVCMDSTAT register...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone advise if the LPC11u37h is hard-wired such that we need to satisfy some conditions/settings in some registers before we can write to the DEV_ADDR (bit0..6) of the DEVCMDSTAT??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i am so lost.... HELP!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:53:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u37h-usb-DEVCMDSTAT-register-cannot-change-the-DEV-ADDR/m-p/525141#M7777</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11u37h usb DEVCMDSTAT register.. cannot change the DEV_ADDR bits...</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u37h-usb-DEVCMDSTAT-register-cannot-change-the-DEV-ADDR/m-p/525142#M7778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Tsuneo on Thu Dec 11 02:01:13 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;2. i am writing the new address into DEVCMDSTAT register inside the ISR of the endpoint0 IN interrupt (which correspond to the STATUS stage completion).&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When your firmware sees the completion ISR on the IN EP0, the STATUS stage has finished on the bus.&amp;nbsp; I know you are faithful to the USB2.0 spec, 9.2.6.3 Set Address Processing ;-)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the user manual of this MCU states as follows,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&lt;STRONG&gt;11.6.1 USB Device Command/Status register (DEVCMDSTAT)&lt;/STRONG&gt;&lt;BR /&gt;DEV_ADDR&lt;BR /&gt;When receiving a SetAddress Control Request from the USB host, software must program the new address &lt;STRONG&gt;before&lt;/STRONG&gt; completing the status phase of the SetAddress Control Request.&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your firmware has to write to DEV_ADDR, when it sees SETUP stage of Set_Address request.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The process of Set_Address depends on SIE design so much. To implement your own stack, always refer to the MCU manual, if it would require specific sequence or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tsuneo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:53:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u37h-usb-DEVCMDSTAT-register-cannot-change-the-DEV-ADDR/m-p/525142#M7778</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11u37h usb DEVCMDSTAT register.. cannot change the DEV_ADDR bits...</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u37h-usb-DEVCMDSTAT-register-cannot-change-the-DEV-ADDR/m-p/525143#M7779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by siangming on Thu Dec 11 19:32:34 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the reply..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i have moved the setting of address to the point when i am handling the SETUP request. Also i noticed that i must clear the SETUP bit in DEVCMDSTAT before i set the new address. Previously, i clear the SETUP bit very late at the last step just before i left the SETUP request ISR..now i am clearing the SETUP bit the moment i enter into the SETUP request ISR...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, now i can write a new address into my LPC11U37.. but now the host reseting my device back to address 0 after the set address request and a get device descriptor request. During debugging, i put a breakpoint at get device descriptor and each time i stop at the breakpoint, my device address will switch between 0 and the new address.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i am guessing some thing went wrong in the get descriptor step after the new address and the host resets my device back to address 0. I learnt this from another post i found on the internet...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Flibusb.6.n5.nabble.com%2FUSB-bus-reset-td5521893.html" rel="nofollow" target="_blank"&gt;http://libusb.6.n5.nabble.com/USB-bus-reset-td5521893.html&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i am guessing its related to some problems in the descriptors... or some problems in the EPSKIP... see my previous post on EPSKIP registers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Flpc11u37-usb-device-register-endpoint-skip" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/forum/lpc11u37-usb-device-register-endpoint-skip&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:53:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u37h-usb-DEVCMDSTAT-register-cannot-change-the-DEV-ADDR/m-p/525143#M7779</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:53:27Z</dc:date>
    </item>
  </channel>
</rss>

