<?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: LPC54605J256BD100 Won't attach USB clock</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54605J256BD100-Won-t-attach-USB-clock/m-p/2370424#M59575</link>
    <description>&lt;P&gt;In case anybody wants an example of USB Host HID Keypad, you can try this for the&amp;nbsp;LPC54605J256BD100. I had it working like this:&amp;nbsp; Using RTT you'll have to take out if you don't have a SEGGER probe.&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;/P&gt;&lt;P&gt;#include "board.h"&lt;BR /&gt;#include "peripherals.h"&lt;BR /&gt;#include "pin_mux.h"&lt;BR /&gt;#include "clock_config.h"&lt;BR /&gt;#include "fsl_device_registers.h"&lt;BR /&gt;#include "fsl_power.h"&lt;/P&gt;&lt;P&gt;#include "SEGGER_RTT.h"&lt;BR /&gt;#include "FreeRTOS.h"&lt;BR /&gt;#include "task.h"&lt;/P&gt;&lt;P&gt;#include "usb_host_config.h"&lt;BR /&gt;#include "usb_host.h"&lt;BR /&gt;#include "usb.h"&lt;BR /&gt;#include "usb_host_hid.h"&lt;BR /&gt;#include "host_hid_generic.h"&lt;BR /&gt;#include "usb_host_ip3516hs.h"&lt;BR /&gt;#include "usb_host_hub.h"&lt;BR /&gt;#include "usb_host_interface_0_hid_keyboard.h"&lt;/P&gt;&lt;P&gt;#define PRINTF(...) SEGGER_RTT_printf(0, __VA_ARGS__)&lt;BR /&gt;#define CONTROLLER_ID kUSB_ControllerIp3516Hs0&lt;/P&gt;&lt;P&gt;static usb_host_handle g_HostHandle;&lt;BR /&gt;static usb_host_interface_handle g_HidKeyboardInterface = NULL;&lt;BR /&gt;static usb_host_class_handle g_HidKeyboardClassHandle = NULL;&lt;BR /&gt;static usb_device_handle g_HidKeyboardDeviceHandle = NULL;&lt;BR /&gt;static volatile bool g_KeyboardReady = false;&lt;BR /&gt;static uint8_t g_KeyboardReport[8];&lt;/P&gt;&lt;P&gt;static const char *keycode_to_ascii(uint8_t keycode, uint8_t modifiers)&lt;BR /&gt;{&lt;BR /&gt;(void)modifiers;&lt;BR /&gt;static char buf[20];&lt;/P&gt;&lt;P&gt;switch (keycode)&lt;BR /&gt;{&lt;BR /&gt;case 98: return "0";&lt;BR /&gt;case 89: return "1";&lt;BR /&gt;case 90: return "2";&lt;BR /&gt;case 91: return "3";&lt;BR /&gt;case 92: return "4";&lt;BR /&gt;case 93: return "5";&lt;BR /&gt;case 94: return "6";&lt;BR /&gt;case 95: return "7";&lt;BR /&gt;case 96: return "8";&lt;BR /&gt;case 97: return "9";&lt;BR /&gt;case 99: return ".";&lt;BR /&gt;case 85: return "*";&lt;BR /&gt;case 86: return "-";&lt;BR /&gt;case 87: return "+";&lt;BR /&gt;case 88: return "[ENTER]";&lt;BR /&gt;case 76: return "/";&lt;BR /&gt;case 83: return "[NUMLOCK]";&lt;BR /&gt;case 42: return "[BACKSPACE]";&lt;BR /&gt;case 79: return "[RIGHT]";&lt;BR /&gt;case 80: return "[LEFT]";&lt;BR /&gt;case 81: return "[DOWN]";&lt;BR /&gt;case 82: return "[UP]";&lt;BR /&gt;case 75: return "[HOME]";&lt;BR /&gt;case 78: return "[PGUP]";&lt;BR /&gt;case 77: return "[END]";&lt;BR /&gt;case 74: return "[INS]";&lt;BR /&gt;case 73: return "[DEL]";&lt;BR /&gt;default:&lt;BR /&gt;snprintf(buf, sizeof(buf), "[0x%02X]", keycode);&lt;BR /&gt;return buf;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void USB_HostHidKeyboardRecvCallback(void *param,&lt;BR /&gt;uint8_t *buffer,&lt;BR /&gt;uint32_t length,&lt;BR /&gt;usb_status_t status)&lt;BR /&gt;{&lt;BR /&gt;(void)param;&lt;/P&gt;&lt;P&gt;if (status == kStatus_USB_Success &amp;amp;&amp;amp; buffer != NULL &amp;amp;&amp;amp; length &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;uint8_t modifiers = buffer[0];&lt;BR /&gt;uint8_t key = 0;&lt;/P&gt;&lt;P&gt;for (int i = 2; i &amp;lt; 8; i++)&lt;BR /&gt;{&lt;BR /&gt;if (buffer[i] != 0)&lt;BR /&gt;{&lt;BR /&gt;key = buffer[i];&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (key != 0)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("Key: 0x%02X -&amp;gt; %s", key, keycode_to_ascii(key, modifiers));&lt;BR /&gt;if (modifiers)&lt;BR /&gt;{&lt;BR /&gt;PRINTF(" (Mod:0x%02X)", modifiers);&lt;BR /&gt;}&lt;BR /&gt;PRINTF("\r\n");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;PRINTF("Key released\r\n");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else if (status != kStatus_USB_Success)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("HID receive error: %d\r\n", status);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (g_HidKeyboardClassHandle != NULL)&lt;BR /&gt;{&lt;BR /&gt;USB_HostHidRecv(g_HidKeyboardClassHandle,&lt;BR /&gt;g_KeyboardReport,&lt;BR /&gt;sizeof(g_KeyboardReport),&lt;BR /&gt;USB_HostHidKeyboardRecvCallback,&lt;BR /&gt;NULL);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void hid_set_interface_callback(void *param,&lt;BR /&gt;uint8_t *data,&lt;BR /&gt;uint32_t dataLength,&lt;BR /&gt;usb_status_t status)&lt;BR /&gt;{&lt;BR /&gt;(void)param;&lt;BR /&gt;(void)data;&lt;BR /&gt;(void)dataLength;&lt;/P&gt;&lt;P&gt;if (status != kStatus_USB_Success)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("SetInterface failed: %d\r\n", status);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;PRINTF("Interface bound OK\r\n");&lt;/P&gt;&lt;P&gt;USB_HostHidSetProtocol(g_HidKeyboardClassHandle,&lt;BR /&gt;USB_HOST_HID_REQUEST_PROTOCOL_BOOT,&lt;BR /&gt;NULL,&lt;BR /&gt;NULL);&lt;/P&gt;&lt;P&gt;USB_HostHidRecv(g_HidKeyboardClassHandle,&lt;BR /&gt;g_KeyboardReport,&lt;BR /&gt;sizeof(g_KeyboardReport),&lt;BR /&gt;USB_HostHidKeyboardRecvCallback,&lt;BR /&gt;NULL);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void USB_StartKeyboardIfReady(void)&lt;BR /&gt;{&lt;BR /&gt;usb_status_t status;&lt;/P&gt;&lt;P&gt;if (!g_KeyboardReady || g_HidKeyboardDeviceHandle == NULL)&lt;BR /&gt;{&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;g_KeyboardReady = false;&lt;/P&gt;&lt;P&gt;status = USB_HostHidInit(g_HidKeyboardDeviceHandle, &amp;amp;g_HidKeyboardClassHandle);&lt;BR /&gt;PRINTF("HidInit = %d\r\n", status);&lt;/P&gt;&lt;P&gt;if (status != kStatus_USB_Success)&lt;BR /&gt;{&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;status = USB_HostHidSetInterface(g_HidKeyboardClassHandle,&lt;BR /&gt;g_HidKeyboardInterface,&lt;BR /&gt;0,&lt;BR /&gt;hid_set_interface_callback,&lt;BR /&gt;NULL);&lt;BR /&gt;PRINTF("SetInterface submit = %d\r\n", status);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;usb_status_t USB_HostEvent(usb_device_handle deviceHandle,&lt;BR /&gt;usb_host_configuration_handle configurationHandle,&lt;BR /&gt;uint32_t eventCode)&lt;BR /&gt;{&lt;BR /&gt;usb_host_configuration_t *config;&lt;BR /&gt;uint8_t interfaceIndex;&lt;/P&gt;&lt;P&gt;switch (eventCode)&lt;BR /&gt;{&lt;BR /&gt;case kUSB_HostEventAttach:&lt;BR /&gt;g_HidKeyboardDeviceHandle = deviceHandle;&lt;BR /&gt;PRINTF("USB Device Attached\r\n");&lt;BR /&gt;break;&lt;/P&gt;&lt;P&gt;case kUSB_HostEventEnumerationDone:&lt;BR /&gt;if (g_HidKeyboardDeviceHandle != deviceHandle)&lt;BR /&gt;{&lt;BR /&gt;break;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;config = (usb_host_configuration_t *)configurationHandle;&lt;/P&gt;&lt;P&gt;for (interfaceIndex = 0; interfaceIndex &amp;lt; config-&amp;gt;interfaceCount; interfaceIndex++)&lt;BR /&gt;{&lt;BR /&gt;usb_host_interface_t *interface = &amp;amp;config-&amp;gt;interfaceList[interfaceIndex];&lt;BR /&gt;usb_descriptor_interface_t *desc = (usb_descriptor_interface_t *)interface-&amp;gt;interfaceDesc;&lt;/P&gt;&lt;P&gt;if (desc == NULL)&lt;BR /&gt;{&lt;BR /&gt;continue;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (desc-&amp;gt;bInterfaceClass == USB_HOST_HID_CLASS_CODE)&lt;BR /&gt;{&lt;BR /&gt;g_HidKeyboardInterface = interface;&lt;BR /&gt;g_HidKeyboardDeviceHandle = deviceHandle;&lt;BR /&gt;g_KeyboardReady = true;&lt;/P&gt;&lt;P&gt;PRINTF("HID keyboard detected\r\n");&lt;/P&gt;&lt;P&gt;USB_StartKeyboardIfReady();&lt;BR /&gt;return kStatus_USB_Success;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;break;&lt;/P&gt;&lt;P&gt;case kUSB_HostEventDetach:&lt;BR /&gt;if (g_HidKeyboardDeviceHandle == deviceHandle)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("USB keyboard detached\r\n");&lt;BR /&gt;g_HidKeyboardDeviceHandle = NULL;&lt;BR /&gt;g_HidKeyboardInterface = NULL;&lt;BR /&gt;g_HidKeyboardClassHandle = NULL;&lt;BR /&gt;g_KeyboardReady = false;&lt;BR /&gt;}&lt;BR /&gt;break;&lt;/P&gt;&lt;P&gt;default:&lt;BR /&gt;break;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return kStatus_USB_Success;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void USB_HostClockInit(void)&lt;BR /&gt;{&lt;BR /&gt;#if ((defined USB_HOST_CONFIG_IP3516HS) &amp;amp;&amp;amp; (USB_HOST_CONFIG_IP3516HS &amp;gt; 0U))&lt;BR /&gt;CLOCK_EnableUsbhs0HostClock(kCLOCK_UsbSrcUsbPll, 48000000U);&lt;BR /&gt;USBHSH-&amp;gt;PORTMODE &amp;amp;= ~(1UL &amp;lt;&amp;lt; 16);&lt;BR /&gt;USBHSH-&amp;gt;PORTMODE |= (1UL &amp;lt;&amp;lt; 17);&lt;BR /&gt;USBHSH-&amp;gt;PORTMODE &amp;amp;= ~(1UL &amp;lt;&amp;lt; 8);&lt;/P&gt;&lt;P&gt;for (volatile uint32_t d = 0; d &amp;lt; 500000; d++)&lt;BR /&gt;{&lt;BR /&gt;__NOP();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;#if ((defined FSL_FEATURE_USBHSH_USB_RAM) &amp;amp;&amp;amp; (FSL_FEATURE_USBHSH_USB_RAM &amp;gt; 0U))&lt;BR /&gt;for (int i = 0; i &amp;lt; (FSL_FEATURE_USBHSH_USB_RAM &amp;gt;&amp;gt; 2); i++)&lt;BR /&gt;{&lt;BR /&gt;((uint32_t *)FSL_FEATURE_USBHSH_USB_RAM_BASE_ADDRESS)[i] = 0U;&lt;BR /&gt;}&lt;BR /&gt;#endif&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void USB_HostIsrEnable(void)&lt;BR /&gt;{&lt;BR /&gt;IRQn_Type irqNumber = USB1_IRQn;&lt;BR /&gt;NVIC_SetPriority(irqNumber, USB_HOST_INTERRUPT_PRIORITY);&lt;BR /&gt;EnableIRQ(irqNumber);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;usb_status_t USB_HostApplicationInit(void)&lt;BR /&gt;{&lt;BR /&gt;usb_status_t status = kStatus_USB_Success;&lt;/P&gt;&lt;P&gt;USB_HostClockInit();&lt;BR /&gt;PRINTF("Clock Init done\r\n");&lt;/P&gt;&lt;P&gt;#if ((defined FSL_FEATURE_SOC_SYSMPU_COUNT) &amp;amp;&amp;amp; (FSL_FEATURE_SOC_SYSMPU_COUNT))&lt;BR /&gt;SYSMPU_Enable(SYSMPU, 0);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;status = USB_HostInit(CONTROLLER_ID, &amp;amp;g_HostHandle, USB_HostEvent);&lt;BR /&gt;if (status != kStatus_USB_Success)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("USB_HostInit FAILED (status=%d)\r\n", status);&lt;BR /&gt;return status;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;PRINTF("USB_HostInit SUCCESS\r\n");&lt;BR /&gt;USB_HostIsrEnable();&lt;BR /&gt;PRINTF("USB host ISR enabled\r\n");&lt;/P&gt;&lt;P&gt;return status;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void USB_HostTaskFn(void *param)&lt;BR /&gt;{&lt;BR /&gt;#if ((defined USB_HOST_CONFIG_IP3516HS) &amp;amp;&amp;amp; (USB_HOST_CONFIG_IP3516HS &amp;gt; 0U))&lt;BR /&gt;USB_HostIp3516HsTaskFunction(param);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void USB_HostTask(void *param)&lt;BR /&gt;{&lt;BR /&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;USB_HostTaskFn(param);&lt;BR /&gt;vTaskDelay(pdMS_TO_TICKS(1));&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void USB_HostApplicationTask(void *param)&lt;BR /&gt;{&lt;BR /&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;USB_HostHidGenericTask(param);&lt;BR /&gt;vTaskDelay(pdMS_TO_TICKS(1));&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void BOARD_InitHardware(void)&lt;BR /&gt;{&lt;BR /&gt;BOARD_InitBootPins();&lt;BR /&gt;BOARD_InitBootClocks();&lt;BR /&gt;BOARD_InitPeripherals();&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY);&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;extern "C" void USB1_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;if (g_HostHandle != NULL)&lt;BR /&gt;{&lt;BR /&gt;USB_HostIp3516HsIsrFunction(g_HostHandle);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;SEGGER_RTT_Init();&lt;BR /&gt;BOARD_InitHardware();&lt;/P&gt;&lt;P&gt;USB_HostApplicationInit();&lt;/P&gt;&lt;P&gt;xTaskCreate(USB_HostTask, "USB_Host", 2048, g_HostHandle, 3, NULL);&lt;BR /&gt;xTaskCreate(USB_HostApplicationTask, "HID_Generic", 2048, g_HostHandle, 2, NULL);&lt;/P&gt;&lt;P&gt;PRINTF("Starting scheduler...\r\n");&lt;BR /&gt;vTaskStartScheduler();&lt;/P&gt;&lt;P&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Sat, 23 May 2026 18:51:02 GMT</pubDate>
    <dc:creator>SOOTY1</dc:creator>
    <dc:date>2026-05-23T18:51:02Z</dc:date>
    <item>
      <title>LPC54605J256BD100 Won't attach USB clock</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54605J256BD100-Won-t-attach-USB-clock/m-p/2366263#M59569</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;my custom board will not attach the clock.&amp;nbsp; I have been trying for weeks to get this to work.&amp;nbsp; I cannot.&amp;nbsp; I cannot find any results anywhere online, which will tell me how to successfully attach the USB1 clock.&amp;nbsp; Surely there must be a logical set of instructions which will attach it properly, somewhere?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;All the config tools are set correctly with the correct frequencies and selections for it to work properly, but it does not.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Several manual steps have been undertaken in main, in order to try to fix the obvious shortcomings of the gui tool.&amp;nbsp; This has not helped.&amp;nbsp; Probably the order and timing is incorrect.&amp;nbsp; As there are so many, and the order is very particular, I am not surprised if it is very incorrect.&lt;BR /&gt;&lt;BR /&gt;Please, can somebody tell me where I am going wrong with the set up?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;I want to have USB working on this device.&amp;nbsp; This is beyond frustrating at this point.&amp;nbsp; Thanks.&lt;BR /&gt;&lt;BR /&gt;Main -&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;vPortDefineHeapRegions(xHeapRegions);&lt;/P&gt;&lt;P&gt;BOARD_InitBootPins();&lt;BR /&gt;BOARD_InitBootClocks();&lt;BR /&gt;BOARD_InitBootPeripherals();&lt;BR /&gt;BOARD_InitUSB1HS_USBPLL_Only();&lt;/P&gt;&lt;P&gt;SEGGER_RTT_Init();&lt;/P&gt;&lt;P&gt;PRINTF("System Booting...\r\n");&lt;BR /&gt;PRINTF("Core clock = %lu Hz\r\n", CLOCK_GetFreq(kCLOCK_CoreSysClk));&lt;/P&gt;&lt;P&gt;/* 1. POWER DOMAINS FIRST */&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_VD2_ANA);&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_VD3);&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_VD5);&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_USB_PLL);&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY);&lt;BR /&gt;/* Power up the PHY LDO (Bit 24) which is often separate from the PHY logic */&lt;BR /&gt;SYSCON-&amp;gt;PDRUNCFGCLR[0] = (1U &amp;lt;&amp;lt; 24);&lt;/P&gt;&lt;P&gt;SDK_DelayAtLeastUs(15000, SystemCoreClock);&lt;BR /&gt;while (!(SYSCON-&amp;gt;USBPLLSTAT &amp;amp; 0x1)); // Wait for hardware lock&lt;/P&gt;&lt;P&gt;/* 2. THE MANUAL CLOCK FIX */&lt;BR /&gt;PRINTF("Applying Manual Clock Fix...\r\n");&lt;/P&gt;&lt;P&gt;// IMPORTANT: Ensure AHB clock is OFF so the divider logic is 'unloaded'&lt;BR /&gt;SYSCON-&amp;gt;AHBCLKCTRLCLR[2] = (1U &amp;lt;&amp;lt; 18);&lt;BR /&gt;SYSCON-&amp;gt;USB1CLKDIV |= (1U &amp;lt;&amp;lt; 30); // Halt divider&lt;BR /&gt;SYSCON-&amp;gt;USB1CLKSEL = 7U; // "Disable" (Park at None)&lt;BR /&gt;for (volatile int i = 0; i &amp;lt; 1500; i++) { __asm("NOP"); }&lt;/P&gt;&lt;P&gt;SYSCON-&amp;gt;USB1CLKSEL = 2U; // Target: USBPLL (288MHz)&lt;BR /&gt;SYSCON-&amp;gt;USB1CLKDIV = (1U &amp;lt;&amp;lt; 30) | 5U; // Target: Div by 6 (48MHz)&lt;BR /&gt;for (volatile int i = 0; i &amp;lt; 1500; i++) { __asm("NOP"); }&lt;/P&gt;&lt;P&gt;SYSCON-&amp;gt;USB1CLKDIV &amp;amp;= ~(1U &amp;lt;&amp;lt; 30); // Release Halt&lt;/P&gt;&lt;P&gt;PRINTF("POST-FIX USB1CLKSEL: 0x%08lX\r\n", SYSCON-&amp;gt;USB1CLKSEL);&lt;BR /&gt;PRINTF("POST-FIX USB1CLKDIV: 0x%08lX\r\n", SYSCON-&amp;gt;USB1CLKDIV);&lt;/P&gt;&lt;P&gt;/* 3. HARDWARE ENABLE &amp;amp; RESET PULSE */&lt;BR /&gt;// Now that the clock is stable, turn on the AHB interface&lt;BR /&gt;SYSCON-&amp;gt;AHBCLKCTRLSET[2] = (1U &amp;lt;&amp;lt; 18);&lt;/P&gt;&lt;P&gt;//Pulse Reset to sync the controller to the 48MHz clock&lt;BR /&gt;SYSCON-&amp;gt;PRESETCTRLSET[2] = (1U &amp;lt;&amp;lt; 18);&lt;BR /&gt;for (volatile int i = 0; i &amp;lt; 1000; i++) { __asm("NOP"); }&lt;BR /&gt;SYSCON-&amp;gt;PRESETCTRLCLR[2] = (1U &amp;lt;&amp;lt; 18);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* 5. FINAL DIAGNOSTICS BEFORE INIT */&lt;BR /&gt;PRINTF("\r\n--- PRE-INIT DIAGNOSTICS ---\r\n");&lt;BR /&gt;PRINTF("USB1CLKSEL : 0x%08lX\r\n", SYSCON-&amp;gt;USB1CLKSEL);&lt;BR /&gt;PRINTF("USB1CLKDIV : 0x%08lX\r\n", SYSCON-&amp;gt;USB1CLKDIV);&lt;BR /&gt;PRINTF("USBHSH-&amp;gt;PORTSC1 : 0x%08lX\r\n", USBHSH-&amp;gt;PORTSC1);&lt;BR /&gt;PRINTF("PDRUNCFG : 0x%08lX\r\n", SYSCON-&amp;gt;PDRUNCFG);&lt;/P&gt;&lt;P&gt;/* --- 1. FORCE PHY CONFIG --- */&lt;BR /&gt;// 16: Host Mode, 17: Clock Valid, 21: Force VBUS, 23: Force 48MHz Lock&lt;BR /&gt;USBHSH-&amp;gt;PORTMODE |= (1U &amp;lt;&amp;lt; 16) | (1U &amp;lt;&amp;lt; 17) | (1U &amp;lt;&amp;lt; 21) | (1U &amp;lt;&amp;lt; 23);&lt;/P&gt;&lt;P&gt;/* --- 2. FINAL HARDWARE RESET PULSE --- */&lt;BR /&gt;SYSCON-&amp;gt;PRESETCTRLSET[2] = (1U &amp;lt;&amp;lt; 18);&lt;BR /&gt;for (volatile int i = 0; i &amp;lt; 5000; i++) { __asm("NOP"); }&lt;BR /&gt;SYSCON-&amp;gt;PRESETCTRLCLR[2] = (1U &amp;lt;&amp;lt; 18);&lt;/P&gt;&lt;P&gt;/* --- 3. STABILIZATION DELAY --- */&lt;BR /&gt;SDK_DelayAtLeastUs(10000, SystemCoreClock);&lt;/P&gt;&lt;P&gt;/* --- 4. PRE-INIT DIAGNOSTICS --- */&lt;BR /&gt;PRINTF("\r\n--- FINAL HW CHECK ---\r\n");&lt;BR /&gt;PRINTF("USBHSH-&amp;gt;USBSTS: 0x%08lX\r\n", USBHSH-&amp;gt;USBSTS);&lt;BR /&gt;PRINTF("USBHSH-&amp;gt;USBCMD: 0x%08lX\r\n", USBHSH-&amp;gt;USBCMD);&lt;BR /&gt;PRINTF("USBHSH-&amp;gt;PORTMODE: 0x%08lX\r\n", USBHSH-&amp;gt;PORTMODE);&lt;/P&gt;&lt;P&gt;/* 2. Re-sync the clock tree variables */&lt;BR /&gt;SystemCoreClockUpdate();&lt;/P&gt;&lt;P&gt;/* 3. Manually toggle the USB1 Clock Gate */&lt;BR /&gt;// SYSCON-&amp;gt;AHBCLKCTRLSET[2] = (1U &amp;lt;&amp;lt; 18); // Ensure AHB is on&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;status_t clkStatus = CLOCK_EnableUsbhs0HostClock(kCLOCK_UsbSrcUsbPll, 48000000U);&lt;BR /&gt;PRINTF("Clock enable returned: %d\r\n", clkStatus);&lt;/P&gt;&lt;P&gt;PRINTF("USB PLL freq = %lu Hz\r\n", CLOCK_GetFreq(kCLOCK_UsbPll));&lt;BR /&gt;PRINTF("USB1CLK freq = %lu Hz\r\n", CLOCK_GetFreq(kCLOCK_UsbClk));&lt;/P&gt;&lt;P&gt;/* 6. STACK INIT */&lt;BR /&gt;usb_status_t status = USB_HostInit(CONTROLLER_ID, &amp;amp;g_HostHandle, USB_HostEvent);&lt;BR /&gt;if (status != kStatus_USB_Success) {&lt;BR /&gt;PRINTF("USB_HostInit failed with status %d\r\n", status);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 14:24:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54605J256BD100-Won-t-attach-USB-clock/m-p/2366263#M59569</guid>
      <dc:creator>SOOTY1</dc:creator>
      <dc:date>2026-05-15T14:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54605J256BD100 Won't attach USB clock</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54605J256BD100-Won-t-attach-USB-clock/m-p/2366871#M59572</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/262626"&gt;@SOOTY1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;Please test the SDK demo on your board.&lt;/DIV&gt;
&lt;DIV&gt;There is a guide available on how to switch the USB demo from USB0 to USB1.&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/LPC-ALL-Summary-of-Switching-USB-demo-from-USB0-to-USB1/ta-p/1428522" target="_blank"&gt;https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/LPC-ALL-Summary-of-Switching-USB-demo-from-USB0-to-USB1/ta-p/1428522&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;BR&lt;/DIV&gt;
&lt;DIV&gt;Alice&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 May 2026 10:46:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54605J256BD100-Won-t-attach-USB-clock/m-p/2366871#M59572</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2026-05-18T10:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54605J256BD100 Won't attach USB clock</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54605J256BD100-Won-t-attach-USB-clock/m-p/2366944#M59574</link>
      <description>&lt;P&gt;Thanks Alice.&amp;nbsp; I have managed to piece together usb host init, from the files in the xx628 host hid generic example.&lt;/P&gt;&lt;P&gt;thanks very much, regards&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2026 13:09:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54605J256BD100-Won-t-attach-USB-clock/m-p/2366944#M59574</guid>
      <dc:creator>SOOTY1</dc:creator>
      <dc:date>2026-05-18T13:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54605J256BD100 Won't attach USB clock</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54605J256BD100-Won-t-attach-USB-clock/m-p/2370424#M59575</link>
      <description>&lt;P&gt;In case anybody wants an example of USB Host HID Keypad, you can try this for the&amp;nbsp;LPC54605J256BD100. I had it working like this:&amp;nbsp; Using RTT you'll have to take out if you don't have a SEGGER probe.&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;/P&gt;&lt;P&gt;#include "board.h"&lt;BR /&gt;#include "peripherals.h"&lt;BR /&gt;#include "pin_mux.h"&lt;BR /&gt;#include "clock_config.h"&lt;BR /&gt;#include "fsl_device_registers.h"&lt;BR /&gt;#include "fsl_power.h"&lt;/P&gt;&lt;P&gt;#include "SEGGER_RTT.h"&lt;BR /&gt;#include "FreeRTOS.h"&lt;BR /&gt;#include "task.h"&lt;/P&gt;&lt;P&gt;#include "usb_host_config.h"&lt;BR /&gt;#include "usb_host.h"&lt;BR /&gt;#include "usb.h"&lt;BR /&gt;#include "usb_host_hid.h"&lt;BR /&gt;#include "host_hid_generic.h"&lt;BR /&gt;#include "usb_host_ip3516hs.h"&lt;BR /&gt;#include "usb_host_hub.h"&lt;BR /&gt;#include "usb_host_interface_0_hid_keyboard.h"&lt;/P&gt;&lt;P&gt;#define PRINTF(...) SEGGER_RTT_printf(0, __VA_ARGS__)&lt;BR /&gt;#define CONTROLLER_ID kUSB_ControllerIp3516Hs0&lt;/P&gt;&lt;P&gt;static usb_host_handle g_HostHandle;&lt;BR /&gt;static usb_host_interface_handle g_HidKeyboardInterface = NULL;&lt;BR /&gt;static usb_host_class_handle g_HidKeyboardClassHandle = NULL;&lt;BR /&gt;static usb_device_handle g_HidKeyboardDeviceHandle = NULL;&lt;BR /&gt;static volatile bool g_KeyboardReady = false;&lt;BR /&gt;static uint8_t g_KeyboardReport[8];&lt;/P&gt;&lt;P&gt;static const char *keycode_to_ascii(uint8_t keycode, uint8_t modifiers)&lt;BR /&gt;{&lt;BR /&gt;(void)modifiers;&lt;BR /&gt;static char buf[20];&lt;/P&gt;&lt;P&gt;switch (keycode)&lt;BR /&gt;{&lt;BR /&gt;case 98: return "0";&lt;BR /&gt;case 89: return "1";&lt;BR /&gt;case 90: return "2";&lt;BR /&gt;case 91: return "3";&lt;BR /&gt;case 92: return "4";&lt;BR /&gt;case 93: return "5";&lt;BR /&gt;case 94: return "6";&lt;BR /&gt;case 95: return "7";&lt;BR /&gt;case 96: return "8";&lt;BR /&gt;case 97: return "9";&lt;BR /&gt;case 99: return ".";&lt;BR /&gt;case 85: return "*";&lt;BR /&gt;case 86: return "-";&lt;BR /&gt;case 87: return "+";&lt;BR /&gt;case 88: return "[ENTER]";&lt;BR /&gt;case 76: return "/";&lt;BR /&gt;case 83: return "[NUMLOCK]";&lt;BR /&gt;case 42: return "[BACKSPACE]";&lt;BR /&gt;case 79: return "[RIGHT]";&lt;BR /&gt;case 80: return "[LEFT]";&lt;BR /&gt;case 81: return "[DOWN]";&lt;BR /&gt;case 82: return "[UP]";&lt;BR /&gt;case 75: return "[HOME]";&lt;BR /&gt;case 78: return "[PGUP]";&lt;BR /&gt;case 77: return "[END]";&lt;BR /&gt;case 74: return "[INS]";&lt;BR /&gt;case 73: return "[DEL]";&lt;BR /&gt;default:&lt;BR /&gt;snprintf(buf, sizeof(buf), "[0x%02X]", keycode);&lt;BR /&gt;return buf;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void USB_HostHidKeyboardRecvCallback(void *param,&lt;BR /&gt;uint8_t *buffer,&lt;BR /&gt;uint32_t length,&lt;BR /&gt;usb_status_t status)&lt;BR /&gt;{&lt;BR /&gt;(void)param;&lt;/P&gt;&lt;P&gt;if (status == kStatus_USB_Success &amp;amp;&amp;amp; buffer != NULL &amp;amp;&amp;amp; length &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;uint8_t modifiers = buffer[0];&lt;BR /&gt;uint8_t key = 0;&lt;/P&gt;&lt;P&gt;for (int i = 2; i &amp;lt; 8; i++)&lt;BR /&gt;{&lt;BR /&gt;if (buffer[i] != 0)&lt;BR /&gt;{&lt;BR /&gt;key = buffer[i];&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (key != 0)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("Key: 0x%02X -&amp;gt; %s", key, keycode_to_ascii(key, modifiers));&lt;BR /&gt;if (modifiers)&lt;BR /&gt;{&lt;BR /&gt;PRINTF(" (Mod:0x%02X)", modifiers);&lt;BR /&gt;}&lt;BR /&gt;PRINTF("\r\n");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;PRINTF("Key released\r\n");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else if (status != kStatus_USB_Success)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("HID receive error: %d\r\n", status);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (g_HidKeyboardClassHandle != NULL)&lt;BR /&gt;{&lt;BR /&gt;USB_HostHidRecv(g_HidKeyboardClassHandle,&lt;BR /&gt;g_KeyboardReport,&lt;BR /&gt;sizeof(g_KeyboardReport),&lt;BR /&gt;USB_HostHidKeyboardRecvCallback,&lt;BR /&gt;NULL);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void hid_set_interface_callback(void *param,&lt;BR /&gt;uint8_t *data,&lt;BR /&gt;uint32_t dataLength,&lt;BR /&gt;usb_status_t status)&lt;BR /&gt;{&lt;BR /&gt;(void)param;&lt;BR /&gt;(void)data;&lt;BR /&gt;(void)dataLength;&lt;/P&gt;&lt;P&gt;if (status != kStatus_USB_Success)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("SetInterface failed: %d\r\n", status);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;PRINTF("Interface bound OK\r\n");&lt;/P&gt;&lt;P&gt;USB_HostHidSetProtocol(g_HidKeyboardClassHandle,&lt;BR /&gt;USB_HOST_HID_REQUEST_PROTOCOL_BOOT,&lt;BR /&gt;NULL,&lt;BR /&gt;NULL);&lt;/P&gt;&lt;P&gt;USB_HostHidRecv(g_HidKeyboardClassHandle,&lt;BR /&gt;g_KeyboardReport,&lt;BR /&gt;sizeof(g_KeyboardReport),&lt;BR /&gt;USB_HostHidKeyboardRecvCallback,&lt;BR /&gt;NULL);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void USB_StartKeyboardIfReady(void)&lt;BR /&gt;{&lt;BR /&gt;usb_status_t status;&lt;/P&gt;&lt;P&gt;if (!g_KeyboardReady || g_HidKeyboardDeviceHandle == NULL)&lt;BR /&gt;{&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;g_KeyboardReady = false;&lt;/P&gt;&lt;P&gt;status = USB_HostHidInit(g_HidKeyboardDeviceHandle, &amp;amp;g_HidKeyboardClassHandle);&lt;BR /&gt;PRINTF("HidInit = %d\r\n", status);&lt;/P&gt;&lt;P&gt;if (status != kStatus_USB_Success)&lt;BR /&gt;{&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;status = USB_HostHidSetInterface(g_HidKeyboardClassHandle,&lt;BR /&gt;g_HidKeyboardInterface,&lt;BR /&gt;0,&lt;BR /&gt;hid_set_interface_callback,&lt;BR /&gt;NULL);&lt;BR /&gt;PRINTF("SetInterface submit = %d\r\n", status);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;usb_status_t USB_HostEvent(usb_device_handle deviceHandle,&lt;BR /&gt;usb_host_configuration_handle configurationHandle,&lt;BR /&gt;uint32_t eventCode)&lt;BR /&gt;{&lt;BR /&gt;usb_host_configuration_t *config;&lt;BR /&gt;uint8_t interfaceIndex;&lt;/P&gt;&lt;P&gt;switch (eventCode)&lt;BR /&gt;{&lt;BR /&gt;case kUSB_HostEventAttach:&lt;BR /&gt;g_HidKeyboardDeviceHandle = deviceHandle;&lt;BR /&gt;PRINTF("USB Device Attached\r\n");&lt;BR /&gt;break;&lt;/P&gt;&lt;P&gt;case kUSB_HostEventEnumerationDone:&lt;BR /&gt;if (g_HidKeyboardDeviceHandle != deviceHandle)&lt;BR /&gt;{&lt;BR /&gt;break;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;config = (usb_host_configuration_t *)configurationHandle;&lt;/P&gt;&lt;P&gt;for (interfaceIndex = 0; interfaceIndex &amp;lt; config-&amp;gt;interfaceCount; interfaceIndex++)&lt;BR /&gt;{&lt;BR /&gt;usb_host_interface_t *interface = &amp;amp;config-&amp;gt;interfaceList[interfaceIndex];&lt;BR /&gt;usb_descriptor_interface_t *desc = (usb_descriptor_interface_t *)interface-&amp;gt;interfaceDesc;&lt;/P&gt;&lt;P&gt;if (desc == NULL)&lt;BR /&gt;{&lt;BR /&gt;continue;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (desc-&amp;gt;bInterfaceClass == USB_HOST_HID_CLASS_CODE)&lt;BR /&gt;{&lt;BR /&gt;g_HidKeyboardInterface = interface;&lt;BR /&gt;g_HidKeyboardDeviceHandle = deviceHandle;&lt;BR /&gt;g_KeyboardReady = true;&lt;/P&gt;&lt;P&gt;PRINTF("HID keyboard detected\r\n");&lt;/P&gt;&lt;P&gt;USB_StartKeyboardIfReady();&lt;BR /&gt;return kStatus_USB_Success;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;break;&lt;/P&gt;&lt;P&gt;case kUSB_HostEventDetach:&lt;BR /&gt;if (g_HidKeyboardDeviceHandle == deviceHandle)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("USB keyboard detached\r\n");&lt;BR /&gt;g_HidKeyboardDeviceHandle = NULL;&lt;BR /&gt;g_HidKeyboardInterface = NULL;&lt;BR /&gt;g_HidKeyboardClassHandle = NULL;&lt;BR /&gt;g_KeyboardReady = false;&lt;BR /&gt;}&lt;BR /&gt;break;&lt;/P&gt;&lt;P&gt;default:&lt;BR /&gt;break;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return kStatus_USB_Success;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void USB_HostClockInit(void)&lt;BR /&gt;{&lt;BR /&gt;#if ((defined USB_HOST_CONFIG_IP3516HS) &amp;amp;&amp;amp; (USB_HOST_CONFIG_IP3516HS &amp;gt; 0U))&lt;BR /&gt;CLOCK_EnableUsbhs0HostClock(kCLOCK_UsbSrcUsbPll, 48000000U);&lt;BR /&gt;USBHSH-&amp;gt;PORTMODE &amp;amp;= ~(1UL &amp;lt;&amp;lt; 16);&lt;BR /&gt;USBHSH-&amp;gt;PORTMODE |= (1UL &amp;lt;&amp;lt; 17);&lt;BR /&gt;USBHSH-&amp;gt;PORTMODE &amp;amp;= ~(1UL &amp;lt;&amp;lt; 8);&lt;/P&gt;&lt;P&gt;for (volatile uint32_t d = 0; d &amp;lt; 500000; d++)&lt;BR /&gt;{&lt;BR /&gt;__NOP();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;#if ((defined FSL_FEATURE_USBHSH_USB_RAM) &amp;amp;&amp;amp; (FSL_FEATURE_USBHSH_USB_RAM &amp;gt; 0U))&lt;BR /&gt;for (int i = 0; i &amp;lt; (FSL_FEATURE_USBHSH_USB_RAM &amp;gt;&amp;gt; 2); i++)&lt;BR /&gt;{&lt;BR /&gt;((uint32_t *)FSL_FEATURE_USBHSH_USB_RAM_BASE_ADDRESS)[i] = 0U;&lt;BR /&gt;}&lt;BR /&gt;#endif&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void USB_HostIsrEnable(void)&lt;BR /&gt;{&lt;BR /&gt;IRQn_Type irqNumber = USB1_IRQn;&lt;BR /&gt;NVIC_SetPriority(irqNumber, USB_HOST_INTERRUPT_PRIORITY);&lt;BR /&gt;EnableIRQ(irqNumber);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;usb_status_t USB_HostApplicationInit(void)&lt;BR /&gt;{&lt;BR /&gt;usb_status_t status = kStatus_USB_Success;&lt;/P&gt;&lt;P&gt;USB_HostClockInit();&lt;BR /&gt;PRINTF("Clock Init done\r\n");&lt;/P&gt;&lt;P&gt;#if ((defined FSL_FEATURE_SOC_SYSMPU_COUNT) &amp;amp;&amp;amp; (FSL_FEATURE_SOC_SYSMPU_COUNT))&lt;BR /&gt;SYSMPU_Enable(SYSMPU, 0);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;status = USB_HostInit(CONTROLLER_ID, &amp;amp;g_HostHandle, USB_HostEvent);&lt;BR /&gt;if (status != kStatus_USB_Success)&lt;BR /&gt;{&lt;BR /&gt;PRINTF("USB_HostInit FAILED (status=%d)\r\n", status);&lt;BR /&gt;return status;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;PRINTF("USB_HostInit SUCCESS\r\n");&lt;BR /&gt;USB_HostIsrEnable();&lt;BR /&gt;PRINTF("USB host ISR enabled\r\n");&lt;/P&gt;&lt;P&gt;return status;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void USB_HostTaskFn(void *param)&lt;BR /&gt;{&lt;BR /&gt;#if ((defined USB_HOST_CONFIG_IP3516HS) &amp;amp;&amp;amp; (USB_HOST_CONFIG_IP3516HS &amp;gt; 0U))&lt;BR /&gt;USB_HostIp3516HsTaskFunction(param);&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void USB_HostTask(void *param)&lt;BR /&gt;{&lt;BR /&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;USB_HostTaskFn(param);&lt;BR /&gt;vTaskDelay(pdMS_TO_TICKS(1));&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void USB_HostApplicationTask(void *param)&lt;BR /&gt;{&lt;BR /&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;USB_HostHidGenericTask(param);&lt;BR /&gt;vTaskDelay(pdMS_TO_TICKS(1));&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void BOARD_InitHardware(void)&lt;BR /&gt;{&lt;BR /&gt;BOARD_InitBootPins();&lt;BR /&gt;BOARD_InitBootClocks();&lt;BR /&gt;BOARD_InitPeripherals();&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY);&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;extern "C" void USB1_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;if (g_HostHandle != NULL)&lt;BR /&gt;{&lt;BR /&gt;USB_HostIp3516HsIsrFunction(g_HostHandle);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;SEGGER_RTT_Init();&lt;BR /&gt;BOARD_InitHardware();&lt;/P&gt;&lt;P&gt;USB_HostApplicationInit();&lt;/P&gt;&lt;P&gt;xTaskCreate(USB_HostTask, "USB_Host", 2048, g_HostHandle, 3, NULL);&lt;BR /&gt;xTaskCreate(USB_HostApplicationTask, "HID_Generic", 2048, g_HostHandle, 2, NULL);&lt;/P&gt;&lt;P&gt;PRINTF("Starting scheduler...\r\n");&lt;BR /&gt;vTaskStartScheduler();&lt;/P&gt;&lt;P&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2026 18:51:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54605J256BD100-Won-t-attach-USB-clock/m-p/2370424#M59575</guid>
      <dc:creator>SOOTY1</dc:creator>
      <dc:date>2026-05-23T18:51:02Z</dc:date>
    </item>
  </channel>
</rss>

