<?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 Re: MK2251212_features.h error? USB IRQ Location? in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423895#M2289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Donald,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For question 1, I don't think changing &lt;SPAN style="color: #3a0699;"&gt;FSL_FEATURE_SOC_DMA_COUNT (0) to 16 is a correct solution, actually there is no DMA module in K22F51212 , just eDMA available, so you may find #define FSL_FEATURE_EDMA_MODULE_CHANNEL (16) in the line 364 of MK22F51212_features.h, and DMA irq numbers in MK22F51212.h like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/57024i7C05FDCDE61F9D5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;for question 2, I could not figure out why, as there are many possible causes for your issue, maybe the clock for USB module is not set up correctly , which should be 48MHz to get it work correctly, or maybe the clock gate for USB module is not enabled at that moment so it causes a bus fault exception, but anyway, if you want to build a USB application from scratch based on KSDK 1.2, you may use the PEx component in KDS 3.0, and if you want to make a MSC demo, you may refer to &lt;A href="https://community.nxp.com/docs/DOC-105714"&gt;How to implement a USB Device MSD demo based on KSDK PEx components and KDS 3.0&lt;/A&gt; for details.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;For question 3, I think the following figure shows the difference, and since the USB stack uses low layer drivers from KSDK, so the examples selected SDK as the adapter in adapter_cfg.h.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/57025iE112C378B8A4987D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;Hope that helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Jun 2015 07:10:05 GMT</pubDate>
    <dc:creator>Kan_Li</dc:creator>
    <dc:date>2015-06-24T07:10:05Z</dc:date>
    <item>
      <title>MK2251212_features.h error? USB IRQ Location?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423893#M2287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1=================&lt;/P&gt;&lt;P&gt;So I was having a problem with my KSDK 1.2 based projects that used DMA, using KDS 3.0 where no matter what I was doing, they were dropping into the default IRQ. &lt;/P&gt;&lt;P&gt;When I started to dig I found that the DMA IRQ's were undeclared, and greyed out as not defined inside of the &lt;EM&gt;edma_irq&lt;/EM&gt; file, because of a value called FSL_FEATURE_SOC_DMA_COUNT contained in the &lt;EM&gt;MK2251212_features.h&lt;/EM&gt; file. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;FSL_FEATURE_SOC_DMA_COUNT (0)&lt;/SPAN&gt; ----&amp;gt; When I change this value to 16 (can't remember off hand but I think that's the number of DMA channels?), I get my DMA IRQ handler, and everything runs as it is supposed to. &lt;STRONG&gt;Not sure if this is the correct way to solve this, but would appreciate some input. &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 ====================&lt;/P&gt;&lt;P&gt;I'm working on a USB application from scratch (by copying the function and logic from an example....) which I can't solve a problem for after a while of trying, because I can't find where anything is actually declared half of the time in this API. I'm calling :&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;USB_Class_MSC_Init(USB_CONTROLLER_KHCI_0, &amp;amp;g_msd_config, &amp;amp;msd_handle);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Which gets me to ... usb_status usb_device_init ....&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Initialize the USB controller chip */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dev_if-&amp;gt;dev_init != NULL)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&lt;STRONG&gt; PROBLEM -----&amp;gt;&lt;/STRONG&gt;&amp;nbsp; error = dev_if-&amp;gt;dev_init(controller_id,usb_dev_ptr-&amp;gt;controller_handle);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;......&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And never beyond this function from a structure of pointers to functions. Drops into default IRQ.&lt;/P&gt;&lt;P&gt;In features we have, the correct number of USB devices. &lt;/P&gt;&lt;P&gt;In &lt;EM&gt;startup_MK22F51212.S&lt;/EM&gt; i see&amp;nbsp; &lt;SPAN style="color: #3a0699;"&gt;&lt;STRONG&gt;def_irq_handler&amp;nbsp;&amp;nbsp;&amp;nbsp; USB0_IRQHandler&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;And in &lt;EM&gt;MK22F51212.h&lt;/EM&gt; I see &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;/** Interrupt vectors for the USB peripheral type */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;#define USB_IRQS&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; { USB0_IRQn } &lt;SPAN style="color: #303030;"&gt; where&lt;/SPAN&gt;&amp;nbsp; USB0_IRQn&amp;nbsp; = 53, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Where is does USB0 Irq actually live as a function and how do I get it into the vector table or whatever it is I need to do in order to get this initialization process to complete? It obviously doesn't use the interrupt handler /callback I've written into my code, or replace the address - so what do I need to do? Prior to the above mentioned function, &lt;/SPAN&gt;&lt;SPAN style="color: #303030;"&gt;NVIC 53 has a priority set, the interrupt set enable bit is set, and that the interrupt clear-enable bit is also set.&lt;/SPAN&gt;&lt;SPAN style="color: #303030;"&gt;I noticed that in my structures the Callback is assigned, but it says the address is "0x835" while the actual function appears to start at "0x834" - is this something I should also be concerned about? I've tried mass erase and getting rid of breakpoints completely to try to rectify but it's still not working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3 ====================&lt;/P&gt;&lt;P&gt;What is the major difference between the SDK and BM adapter for the USB stack? Is there a specific reason that an example BM project has SDK selected in the adapter_config.h - is this correct? Because some of the example I've looked at are setup like this.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 22:17:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423893#M2287</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2015-06-23T22:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: MK2251212_features.h error? USB IRQ Location?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423894#M2288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Changing &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;USB_Class_MSC_Init(USB_CONTROLLER_KHCI_0, &amp;amp;g_msd_config, &amp;amp;msd_handle);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;USB_Class_MSC_Init(CONTROLLER_ID, &amp;amp;g_msd_config, &amp;amp;msd_handle);&lt;/P&gt;&lt;P&gt;At least gets some activity and enters the handler I assign, but still no dice beyond event 135, 136...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 23:40:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423894#M2288</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2015-06-23T23:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: MK2251212_features.h error? USB IRQ Location?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423895#M2289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Donald,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For question 1, I don't think changing &lt;SPAN style="color: #3a0699;"&gt;FSL_FEATURE_SOC_DMA_COUNT (0) to 16 is a correct solution, actually there is no DMA module in K22F51212 , just eDMA available, so you may find #define FSL_FEATURE_EDMA_MODULE_CHANNEL (16) in the line 364 of MK22F51212_features.h, and DMA irq numbers in MK22F51212.h like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/57024i7C05FDCDE61F9D5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;for question 2, I could not figure out why, as there are many possible causes for your issue, maybe the clock for USB module is not set up correctly , which should be 48MHz to get it work correctly, or maybe the clock gate for USB module is not enabled at that moment so it causes a bus fault exception, but anyway, if you want to build a USB application from scratch based on KSDK 1.2, you may use the PEx component in KDS 3.0, and if you want to make a MSC demo, you may refer to &lt;A href="https://community.nxp.com/docs/DOC-105714"&gt;How to implement a USB Device MSD demo based on KSDK PEx components and KDS 3.0&lt;/A&gt; for details.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;For question 3, I think the following figure shows the difference, and since the USB stack uses low layer drivers from KSDK, so the examples selected SDK as the adapter in adapter_cfg.h.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/57025iE112C378B8A4987D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3a0699;"&gt;Hope that helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2015 07:10:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423895#M2289</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2015-06-24T07:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: MK2251212_features.h error? USB IRQ Location?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423896#M2290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Donald,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just some supplement for question 3:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For BM , SDK and RTOS like MQX , USB stack have a different OS APIs for each of them, so with different adapters we can make one code be used for all of them.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2015 07:34:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423896#M2290</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2015-06-24T07:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: MK2251212_features.h error? USB IRQ Location?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423897#M2291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On #1 - If that's not the correct solution, then you guys should change the define in fsl_edma_irq.c to reflect the correct constant. &lt;/P&gt;&lt;P&gt;You have : &lt;/P&gt;&lt;P&gt;#include "fsl_edma_driver.h"&lt;/P&gt;&lt;P&gt;#if FSL_FEATURE_SOC_DMA_COUNT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right at the top of the file. I would say you may want to have it be &lt;SPAN style="color: #3a0699; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;FSL_FEATURE_EDMA_MODULE_CHANNEL, if that's what it's actually supposed to depend on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On #2 - I'll double check the clock registers / settings and see what happens.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2015 13:03:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/MK2251212-features-h-error-USB-IRQ-Location/m-p/423897#M2291</guid>
      <dc:creator>bosleymusic_com</dc:creator>
      <dc:date>2015-06-24T13:03:26Z</dc:date>
    </item>
  </channel>
</rss>

