<?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: Re: MKW25D512 Kinetis Bootloader port in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW24D512-Kinetis-Bootloader-port/m-p/355176#M17689</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I decided to use the IAR workbench after all, and now the project compiles. Unfortunately, it fails to enumerate as a USB device. I suspect it has something to do with these lines:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14240967863918693" jivemacro_uid="_14240967863918693"&gt;
&lt;P&gt;BW_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(USB0_BASE, 1);&lt;/P&gt;
&lt;P&gt;BW_USB_CLK_RECOVER_IRC_EN_IRC_EN(USB0_BASE, 1);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;I removed them since MK24 does not have internal 48MHz clock recovery support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the device fails to enumerate for three times consecutively my hypothesis is that it goes to sleep and fails to respond to the host setup packet. How can I disable the device sleep mode?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My other theory is that there's something wrong with the clock setting. Does anyone know which is the correct one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aljaž&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Feb 2015 14:31:15 GMT</pubDate>
    <dc:creator>aljazsrebrnic</dc:creator>
    <dc:date>2015-02-16T14:31:15Z</dc:date>
    <item>
      <title>MKW24D512 Kinetis Bootloader port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW24D512-Kinetis-Bootloader-port/m-p/355174#M17687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;I'm trying to port the official Kinetis Bootloader, but I keep running into problems in the USB stack. There's some defines missing, like DEV_ARCHITECTURE_STRUCT, GETSTATUS_DATA_SIZE and GETSTATE_DATA_SIZE and there's no mention of them in the documentation, so I don't know if I should set them or they get set by IAR. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:32:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW24D512-Kinetis-Bootloader-port/m-p/355174#M17687</guid>
      <dc:creator>aljazsrebrnic</dc:creator>
      <dc:date>2015-01-19T09:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: MKW25D512 Kinetis Bootloader port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW24D512-Kinetis-Bootloader-port/m-p/355175#M17688</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;Those definitions are part of the USB stack:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEV_ARCHITECTURE_STRUCT is used only when COMPOSITE_DEV is used in the stack but the Kinetis Bootloader (KBOOT) does not support composite device, you can see it in the usb_(class name).c file (example usb_hid.c) code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14217971433242579 jive_macro_code" jivemacro_uid="_14217971433242579" modifiedtitle="true"&gt;
&lt;P&gt;#ifdef COMPOSITE_DEV&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;DEV_ARCHITECTURE_STRUCT_PTR&lt;/STRONG&gt; dev_arc_ptr;&amp;nbsp;&amp;nbsp;&amp;nbsp; //HERE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS_ARC_STRUCT_PTR dev_class_ptr;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dev_arc_ptr = (DEV_ARCHITECTURE_STRUCT *)USB_Desc_Get_Class_Architecture(controller_ID);&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is the same with the GETSTATUS_DATA_SIZE and GETSTATE_DATA_SIZE you can find them in the usb_dfu.c file inside the \FSL_Kinetis_Bootloader_1_1_0\src\usb_device\class:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14217973358929958 jive_macro_code" jivemacro_uid="_14217973358929958" modifiedtitle="true"&gt;
&lt;P&gt;static uint_8 USB_Class_DFU_Getstatus (&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_8 controller_ID,&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; /* [IN] Controller ID */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_8 interface,&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; /* [IN] Interface */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_8_ptr *data,&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; /* [OUT] Pointer to Data */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_PACKET_SIZE *size&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; /* [OUT] Pointer to Size of Data */&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNUSED(controller_ID)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* if interface valid */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (interface &amp;lt; USB_MAX_SUPPORTED_INTERFACES)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* get status data*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *size = GETSTATUS_DATA_SIZE;&amp;nbsp;&amp;nbsp;&amp;nbsp; //HERE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *data = g_status;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return USB_OK;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return USBERR_INVALID_REQ_TYPE;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This macros are not used because only &lt;STRONG&gt;USB HID&lt;/STRONG&gt; is supported by the KBOOT but are in the files because are part of the stack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to the Kinetis Bootloader 1.1.0 Reference Manual.pdf file included in the KBOOT documentation the chapter 9 has a lot of hints and procedure of porting the KBOOT to other devices.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope this information can help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Adrian Sanchez Cano&lt;BR /&gt;Technical Support Engineer&lt;BR /&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>Tue, 20 Jan 2015 23:48:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW24D512-Kinetis-Bootloader-port/m-p/355175#M17688</guid>
      <dc:creator>adriancano</dc:creator>
      <dc:date>2015-01-20T23:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Re: MKW25D512 Kinetis Bootloader port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW24D512-Kinetis-Bootloader-port/m-p/355176#M17689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I decided to use the IAR workbench after all, and now the project compiles. Unfortunately, it fails to enumerate as a USB device. I suspect it has something to do with these lines:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14240967863918693" jivemacro_uid="_14240967863918693"&gt;
&lt;P&gt;BW_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(USB0_BASE, 1);&lt;/P&gt;
&lt;P&gt;BW_USB_CLK_RECOVER_IRC_EN_IRC_EN(USB0_BASE, 1);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;I removed them since MK24 does not have internal 48MHz clock recovery support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the device fails to enumerate for three times consecutively my hypothesis is that it goes to sleep and fails to respond to the host setup packet. How can I disable the device sleep mode?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My other theory is that there's something wrong with the clock setting. Does anyone know which is the correct one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aljaž&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:31:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKW24D512-Kinetis-Bootloader-port/m-p/355176#M17689</guid>
      <dc:creator>aljazsrebrnic</dc:creator>
      <dc:date>2015-02-16T14:31:15Z</dc:date>
    </item>
  </channel>
</rss>

