<?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: Embedded wizard application in combination with HID device in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039025#M3293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mykepredkomimetics"&gt;mykepredkomimetics&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for getting back to me.&lt;/P&gt;&lt;P&gt;I solved the problem by simply setting the FRO_HF clock from 48 MHz to 96 MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hereafter I ran into trouble when creating the second task,&amp;nbsp;xTaskCreate returned&amp;nbsp;the error&amp;nbsp;errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY. This was solved by increasing the heap size by changing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define configTOTAL_HEAP_SIZE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;( ( size_t ) ( 25 * 1024 ) ) // from 10 to 25&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next the GUI did still not work properly... The screen was empty. This was solved by changing the priority of the tasks.&lt;/P&gt;&lt;P&gt;Now the GUI tasks runs at priority (UBaseType_t uxPriority ) 2 and the HID device at priority 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2020 13:04:56 GMT</pubDate>
    <dc:creator>mail6</dc:creator>
    <dc:date>2020-08-04T13:04:56Z</dc:date>
    <item>
      <title>Embedded wizard application in combination with HID device</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039020#M3288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the NXP LPCXpresso54628. I have created a graphical interface in embedded wizard that runs on the &lt;SPAN&gt;LPCXpresso54628. Simultaneously&amp;nbsp;I want the device to act as a USB HID device.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is what I have done so far:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1) I have compiled the&amp;nbsp;lpcxpresso54628_dev_hid_generic_bm example and got the USB HID device working on the USB FS connector. This is a BM project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2) I compiled the Embedded wizard GUI and have the&amp;nbsp;GUI program running on the LPCXpresso. This is also a BM project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3) I merged all the source files from both projects into a new project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4) When I run the following main program the HID device works in this merged project&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main( void )&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* attach 12 MHz clock to FLEXCOMM0 (debug console) */&lt;BR /&gt; CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);&lt;BR /&gt; BOARD_InitPins();&lt;BR /&gt; BOARD_BootClockFROHF96M();&lt;BR /&gt; BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*&amp;lt; Turn on USB Phy */&lt;BR /&gt; CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1, false);&lt;BR /&gt; CLOCK_AttachClk(kFRO_HF_to_USB0_CLK);&lt;BR /&gt; /* enable usb0 host clock */&lt;BR /&gt; CLOCK_EnableClock(kCLOCK_Usbhsl0);&lt;BR /&gt; /*According to reference mannual, device mode setting has to be set by access usb host register */&lt;BR /&gt; *((uint32_t *)(USBFSH_BASE + 0x5C)) |= USBFSH_PORTMODE_DEV_ENABLE_MASK;&lt;BR /&gt; /* disable usb0 host clock */&lt;BR /&gt; CLOCK_DisableClock(kCLOCK_Usbhsl0);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; USB_DeviceApplicationInit();&lt;/P&gt;&lt;P&gt;while (1U)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;return 0;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) When I run the following code the GUI program works in the merged project&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main( void )&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* initialize system */&lt;BR /&gt; EwBspSystemInit();&lt;/P&gt;&lt;P&gt;/* initialize Embedded Wizard application */&lt;BR /&gt; if ( EwInit() == 0 )&lt;BR /&gt; {&lt;BR /&gt; return 0;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;/* process the Embedded Wizard main loop */&lt;BR /&gt; while( EwProcess())&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;/* de-initialize Embedded Wizard application */&lt;BR /&gt; EwDone();&lt;/P&gt;&lt;P&gt;/* terminate the system */&lt;BR /&gt; EwBspSystemDone();&lt;/P&gt;&lt;P&gt;return 0;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to have both programs running at the same time, so that I have a GUI on the screen and simultaneously have a USB HID device. When I merge the two main function both applications stop to work. A closer look into&amp;nbsp;&lt;/P&gt;&lt;P&gt;EwBspSystemInit(); which contains:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt;* FUNCTION:&lt;BR /&gt;* EwBspSystemInit&lt;BR /&gt;*&lt;BR /&gt;* DESCRIPTION:&lt;BR /&gt;* The function EwBspSystemInit initializes the system components.&lt;BR /&gt;* (CPU clock, memory, qspi, ...)&lt;BR /&gt;*&lt;BR /&gt;* ARGUMENTS:&lt;BR /&gt;* None&lt;BR /&gt;*&lt;BR /&gt;* RETURN VALUE:&lt;BR /&gt;* None&lt;BR /&gt;*&lt;BR /&gt;*******************************************************************************/&lt;BR /&gt;void EwBspSystemInit( void )&lt;BR /&gt;{&lt;BR /&gt; /* attach 12 MHz clock to FLEXCOMM0 (debug console) */&lt;BR /&gt; CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);&lt;/P&gt;&lt;P&gt;/* attach 12 MHz clock to FLEXCOMM2 (I2C master for touch controller) */&lt;BR /&gt; CLOCK_AttachClk(kFRO12M_to_FLEXCOMM2);&lt;BR /&gt; CLOCK_EnableClock(kCLOCK_Gpio2);&lt;/P&gt;&lt;P&gt;BOARD_InitPins();&lt;/P&gt;&lt;P&gt;BOARD_BootClockPLL180M();&lt;/P&gt;&lt;P&gt;/* attach 12 MHz clock to SPI3 */&lt;BR /&gt; CLOCK_AttachClk(kFRO12M_to_FLEXCOMM9);&lt;/P&gt;&lt;P&gt;BOARD_InitDebugConsole();&lt;BR /&gt; BOARD_InitSDRAM();&lt;/P&gt;&lt;P&gt;#if EW_USE_EXTERNAL_FLASH == 1&lt;BR /&gt; {&lt;BR /&gt; spifi_config_t config = {0};&lt;BR /&gt; uint32_t sourceClockFreq;&lt;/P&gt;&lt;P&gt;/* Set SPIFI clock source */&lt;BR /&gt; CLOCK_AttachClk(kMAIN_CLK_to_SPIFI_CLK);&lt;BR /&gt; sourceClockFreq = CLOCK_GetSpifiClkFreq();&lt;/P&gt;&lt;P&gt;/* Set the clock divider */&lt;BR /&gt; CLOCK_SetClkDiv(kCLOCK_DivSpifiClk, sourceClockFreq / EXAMPLE_SPI_BAUDRATE - 1U, false);&lt;/P&gt;&lt;P&gt;/* Initialize SPIFI */&lt;BR /&gt; SPIFI_GetDefaultConfig(&amp;amp;config);&lt;BR /&gt; SPIFI_Init(EXAMPLE_SPIFI, &amp;amp;config);&lt;/P&gt;&lt;P&gt;/* Reset to memory command mode */&lt;BR /&gt; SPIFI_ResetCommand(EXAMPLE_SPIFI);&lt;BR /&gt; SPIFI_SetMemoryCommand(EXAMPLE_SPIFI, &amp;amp;command[READ]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shows that here the&amp;nbsp;BOARD_BootClockPLL180M(); is loaded and in the USB HID program the&amp;nbsp;&lt;SPAN&gt;BOARD_BootClockFROHF96M(); is loaded. How do I proceed in merging the two programs ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2020 10:10:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039020#M3288</guid>
      <dc:creator>mail6</dc:creator>
      <dc:date>2020-07-29T10:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded wizard application in combination with HID device</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039021#M3289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;First you need make sure both GUI program and HID program works separately.&lt;/P&gt;&lt;P&gt;then you import your HID code into your GUI program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;steps:&lt;/P&gt;&lt;P&gt;1. add USB component to your GUI project&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/109163i84ED8E93B5AA17BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/109075iAA684CAD5DBE1712/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. after import you will see USB driver added in project:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/109239i78C9CDCC6A5CB4BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus you have imported all USB device driver source codes into your project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next you can either add your HID application source code into your project directly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;refer this document from step 5 to create your HID application&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-347301"&gt;https://community.nxp.com/docs/DOC-347301&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jun Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2020 06:13:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039021#M3289</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2020-07-30T06:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded wizard application in combination with HID device</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039022#M3290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mail@jimfranssen.nl"&gt;mail@jimfranssen.nl&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just saw &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/ZhangJennie"&gt;ZhangJennie&lt;/A&gt;‌'s reply and I think it's a good start but could I ask why are you not implementing this in a RTOS?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you GUI function and HID function are independent of each other then you could (reasonably) simply turn them into two tasks and run them under the RTOS.&amp;nbsp; If you go the RTOS route there's also the added benefit of intertask communications which allows data to be passed without affecting their operation.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just curious - I always like to understand the reasons why people approach problems in certain ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2020 13:49:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039022#M3290</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2020-07-30T13:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded wizard application in combination with HID device</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039023#M3291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mykepredkomimetics"&gt;mykepredkomimetics&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/ZhangJennie"&gt;ZhangJennie&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help so far. First of all&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mykepredkomimetics"&gt;mykepredkomimetics&lt;/A&gt;, I started using FREE RTOS but this seemed complicated at first (+ I had some difficulties debugging) so I decided to switch to BM. After reading your post I decided to switch back to FREERTOS since this will keep the project easily adaptable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I switched back to FREE RTOS and followed the steps mentioned by&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/ZhangJennie"&gt;ZhangJennie&lt;/A&gt;. I have added the project (see porject.rar) and two main files (main_not_working.c and main_working.c)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the main_working.c I have split the main function in two parts by using the definition ( #define EMBEDDED_WIZZARD 1).&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When ( EMBEDDED_WIZZARD 1 ) the program compiles and the GUI application is started and everything works as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When&amp;nbsp;( EMBEDDED_WIZZARD&amp;nbsp; 0 ) the program compiles and the HID application is started and everything works as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I want both tasks to run simultaneously&amp;nbsp;and I removed the following statements from the main file:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#if (defined EMBEDDED_WIZZARD) &amp;amp;&amp;amp; (EMBEDDED_WIZZARD)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I do this both tasks do not work anymore. I think it has something todo with the GUI program is using&amp;nbsp;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; BOARD_BootClockPLL180M();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and the HID task is using:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; BOARD_BootClockFROHF96M();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Looking forward to your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2020 09:57:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039023#M3291</guid>
      <dc:creator>mail6</dc:creator>
      <dc:date>2020-07-31T09:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded wizard application in combination with HID device</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039024#M3292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mail@jimfranssen.nl"&gt;mail@jimfranssen.nl&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have the time to do a deep dive into your code but I think you're going to have to understand how&amp;nbsp;each of the code modules work and which&amp;nbsp;parts need to be installed and working and which parts are to be put into tasks.&amp;nbsp; Along with that, I think you're going to need to take some time to figure out your system initialization - I cringed a bit when I saw:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;// This code is already present in EwBspSystemInit();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt; //* attach 12 MHz clock to FLEXCOMM0 (debug console) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt; //CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt; //BOARD_InitPins();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt; //BOARD_InitDebugConsole();&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe the code is already present, but I think you should make sure you understand what is going on here before taking out the system generated code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the point of clocks, how are you validating that they are correct?&amp;nbsp; It took me a long time to be comfortable with the Clocks Tool in MCUXpresso and I don't think it works very easily/intuitive/correctly but it does generate correct code once you have it set in the two views to provide you with the clocks that you are looking for.&amp;nbsp; The same thing with the Pins tool.&amp;nbsp; I'm emphasizing clocks because of how critical it is for USB.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To give you an example of what I mean in terms of understanding the BM code, I've included my USB CDC code (modified from the BM example code) and note that when I receive a packet, I&amp;nbsp;format it&amp;nbsp;inside the ISR to create a text string that is sent to my Command task&amp;nbsp;that&amp;nbsp;executes the request:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;if ((0 != s_recvSize) &amp;amp;&amp;amp; (0xFFFFFFFF != s_recvSize)) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; for (i = 0; (s_recvSize + 0) &amp;gt; i; ++i) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; if (0 != usbBlockCountDown) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbCMDMsg.msg[usbCMDMsgSize++] = s_currRecvBuf[i];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--usbBlockCountDown;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; else if (usbBlockFlag) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbBlockCountDown = (uint32_t)(usbCMDMsg.msg[usbCMDMsgSize++] = s_currRecvBuf[i]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbBlockFlag = FALSE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; else if ('@' == s_currRecvBuf[i]) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbCMDMsg.msg[usbCMDMsgSize++] = s_currRecvBuf[i];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbBlockFlag = TRUE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; else if ('\b' == s_currRecvBuf[i]) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--usbCMDMsgSize;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; else if ('\r' == s_currRecvBuf[i]) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbCMDMsg.msg[usbCMDMsgSize++] = '\r';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbCMDMsg.msg[usbCMDMsgSize] = '\0';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbCMDMsg.header = CMD_REQUEST_CHARS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbCMDMsg.source = CMD_SOURCE_USB;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; CMDMSGISR(usbCMDMsg)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbCMDMsgSize = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; else if ((CMD_MESSAGE_SIZE - 2) &amp;gt; usbCMDMsgSize) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;usbCMDMsg.msg[usbCMDMsgSize++] = s_currRecvBuf[i];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp;s_recvSize = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp;error = USB_DeviceCdcAcmRecv(handle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&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; , USB_CDC_VCOM_BULK_OUT_ENDPOINT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&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; , s_currRecvBuf&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&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; , g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The macro for sending the&amp;nbsp;full packet (terminated with a '\r') is:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;#define CMDMSGISR(txMsg)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;\&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;{&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; \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;BaseType_t xHigherPriorityTaskWoken = pdFALSE; \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt; xQueueSendFromISR(cmdQUEUE_Handle&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt; , (void*)&amp;amp;txMsg&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; \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt; , &amp;amp;xHigherPriorityTaskWoken);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt; portYIELD_FROM_ISR(xHigherPriorityTaskWoken);&amp;nbsp; \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;}&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And when the Command task is sending a packet out through the USB, I have the separate task:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;void USBTX_task(void *pvParameters) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;struct replyQueueMsg mainMsg;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;usb_status_t error;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;#if (2 != SDK_DEBUGCONSOLE)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; PRINTF("\nUSBTX_task");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; for (;;) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; xQueueReceive(usbOUTQUEUE_Handle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , (void*)&amp;amp;mainMsg&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , portMAX_DELAY);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; error = USB_DeviceCdcAcmSend(s_cdcVcom.cdcAcmHandle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&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;, USB_CDC_VCOM_BULK_IN_ENDPOINT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&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;, mainMsg.msg&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&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;, mainMsg.size);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; if (error != kStatus_USB_Success) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; /* Failure to send Data Handling code here */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I oversold the work in my original reply as being easy, but with a few hours understanding the operation of the two tasks/applications along with their resources (with an emphasis on clocking) you should be able to get something that works well.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Aug 2020 16:03:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039024#M3292</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2020-08-01T16:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded wizard application in combination with HID device</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039025#M3293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mykepredkomimetics"&gt;mykepredkomimetics&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for getting back to me.&lt;/P&gt;&lt;P&gt;I solved the problem by simply setting the FRO_HF clock from 48 MHz to 96 MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hereafter I ran into trouble when creating the second task,&amp;nbsp;xTaskCreate returned&amp;nbsp;the error&amp;nbsp;errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY. This was solved by increasing the heap size by changing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define configTOTAL_HEAP_SIZE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;( ( size_t ) ( 25 * 1024 ) ) // from 10 to 25&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next the GUI did still not work properly... The screen was empty. This was solved by changing the priority of the tasks.&lt;/P&gt;&lt;P&gt;Now the GUI tasks runs at priority (UBaseType_t uxPriority ) 2 and the HID device at priority 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2020 13:04:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039025#M3293</guid>
      <dc:creator>mail6</dc:creator>
      <dc:date>2020-08-04T13:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded wizard application in combination with HID device</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039026#M3294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great job &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mail@jimfranssen.nl"&gt;mail@jimfranssen.nl&lt;/A&gt;‌!&lt;BR /&gt;&lt;BR /&gt;It's never as simple as it could/should be but it's never as hard as it can be.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep us informed as to how you're doing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2020 15:12:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Embedded-wizard-application-in-combination-with-HID-device/m-p/1039026#M3294</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2020-08-04T15:12:45Z</dc:date>
    </item>
  </channel>
</rss>

