USB VCOM not working on MKL26Z128VFM4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB VCOM not working on MKL26Z128VFM4

796 Views
amit_bhoskar
Contributor I

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.

pastedImage_2.png

   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-

pastedImage_1.png

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

0 Kudos
3 Replies

632 Views
amit_bhoskar
Contributor I

   I don't have a development board. We have our own custom hardware.

But the circuit for VCOM is well used for few years now, still I will check it once to confirm.

The .bin files from the shared link didn't work for me.

   And as I said I don't have FRDM-MKL26Z, can somebody just use the CDC_VCOM example from SDK for FRDM-MKL26Z, test it on  FRDM-MKL26Z & then share me that project to test on my hardware.

   Till then I'll test my hardware.

Regards-

Amit

0 Kudos

632 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Amit,

It is not a good practice to use an example made for the Freedom board on a different board. Unless your custom board is made to exact specifications of the freedom board. If this is not true, then it will not work as expected. I recommend that you create a new project and use the freedom example as a reference. Please mind how your board is designed to adequately program your board. 

Best Regards,

Sabina

0 Kudos

632 Views
mjbcswitzerland
Specialist V

Hi

Load a binary of a known good USB-CDC to your board to verify that there is not a HW issue:

https://www.utasker.com/kinetis/FRDM-KL26Z.html

Drag and drop it on the board when it appears as an external drive.

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]

0 Kudos