<?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>topic Hard Fault when processing USB class requests in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Hard-Fault-when-processing-USB-class-requests/m-p/524961#M7597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by m-kondo on Thu Mar 28 04:26:02 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to implement USB test &amp;amp; measurement class on my MCB4300 (LPC4357) board as device mode using KEIL RTL and RL-USB. But when after processing a class request in the usbd_cls_if_req() callback function, a Hard Fault is always generated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually in the cls_if_req()function, a class request (device-to-host) comes, set up the out-going (EP0-IN) data stage, then calls USBD_DataInStage() finishing with __TRUE return. The data stage is actually sent back to the host only at the first time, but after returning from usbd_cls_if_req(), a Hard Fault will be generated inside USB_CM.lib. Both USB0(HS) and USB1(FS) generate this problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for std requests, there is no probrem at all, but as soon as returning a data-stage from inside usbd_cls_if_req(), the program falls into Hard Fault. I also tried exactly the same approach with MCBSTM32F400 (STM32F407) board and there was no such problem. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anybody please help me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Makoto Kondo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:52:06 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:52:06Z</dc:date>
    <item>
      <title>Hard Fault when processing USB class requests</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Hard-Fault-when-processing-USB-class-requests/m-p/524961#M7597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by m-kondo on Thu Mar 28 04:26:02 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to implement USB test &amp;amp; measurement class on my MCB4300 (LPC4357) board as device mode using KEIL RTL and RL-USB. But when after processing a class request in the usbd_cls_if_req() callback function, a Hard Fault is always generated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually in the cls_if_req()function, a class request (device-to-host) comes, set up the out-going (EP0-IN) data stage, then calls USBD_DataInStage() finishing with __TRUE return. The data stage is actually sent back to the host only at the first time, but after returning from usbd_cls_if_req(), a Hard Fault will be generated inside USB_CM.lib. Both USB0(HS) and USB1(FS) generate this problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for std requests, there is no probrem at all, but as soon as returning a data-stage from inside usbd_cls_if_req(), the program falls into Hard Fault. I also tried exactly the same approach with MCBSTM32F400 (STM32F407) board and there was no such problem. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anybody please help me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Makoto Kondo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:52:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Hard-Fault-when-processing-USB-class-requests/m-p/524961#M7597</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:52:06Z</dc:date>
    </item>
  </channel>
</rss>

