AnsweredAssumed Answered

USB VCOM not working on MKL26Z128VFM4

Question asked by Amit Bhoskar on Jan 22, 2020
Latest reply on Jan 23, 2020 by Sabina Bruce

I am trying to get the VCOM working on MKL26Z128VFM MCU using the SDK 2.2.0 generated for development board FRDM-MKL26Z. I got started with the SDK example for USB_Device_CDC_VCOM_BM & was expecting it to be running on my MCU. But to no luck it did not work.

   It didn't even show message like Device not Recognized etc to tell that Enumeration is being done.

Nothing happens for USB device. No msg like Device not Recognized.

   The main() runs OK, confirmed by LED_Toggle in while(1).

The App_Init() call for USB_Clock_Initialization, USB_IRQ_Enable_n_Priority setting & USB_DeviceRun() gets executed & in App_Task() call, it waits for the flags that are never set in my case. The code is as follow-

 

void APPInit(void)
{
   uint8_t irqNo;

   

#if defined(USB_DEVICE_CONFIG_KHCI) && (USB_DEVICE_CONFIG_KHCI > 0)
   uint8_t khciIrq[] = USB_IRQS;
   irqNo = khciIrq[CONTROLLER_ID - kUSB_ControllerKhci0];


   SystemCoreClockUpdate();


   CLOCK_EnableUsbfs0Clock(USB_FS_CLK_SRC, USB_FS_CLK_FREQ);
#endif

 

   s_cdcVcom.speed = USB_SPEED_FULL;
   s_cdcVcom.attach = 0;
   s_cdcVcom.cdcAcmHandle = (class_handle_t)NULL;
   s_cdcVcom.deviceHandle = NULL;

 

   if (kStatus_USB_Success != USB_DeviceClassInit(CONTROLLER_ID, &s_cdcAcmConfigList,                      &s_cdcVcom.deviceHandle))
   {
      usb_echo("USB device init failed\r\n");
   }
   else
   {
      usb_echo("\nUSB device CDC virtual com demo\r\n");
      s_cdcVcom.cdcAcmHandle = s_cdcAcmConfigList.config->classHandle;
   }

   NVIC_SetPriority((IRQn_Type)irqNo, USB_DEVICE_INTERRUPT_PRIORITY);
   EnableIRQ((IRQn_Type)irqNo);
   USB_DeviceRun(s_cdcVcom.deviceHandle);
}

Please guide me on this.

 

Regards-

Amit

Outcomes