Hi Alexis
And thank you so much for replying.
When I run my USB-virtual_com based project i hear the port come in (sound in windows) but it fails immediately (sound again) with the following error in device manager:

My utility folder looks very similar to yours (you have extra: fsl_console, fsl_io filesfsl_log and fsl_str files that I think has nothing to do with the USB). My main function looks like this, I have boldfaced the call to what I think is the main entrance of the USB interface in the virtual_com.c file in the utilities folder created by checking the virtual_com utility:
int main(void) {
/* Init board hardware. */
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
printf("Hello World\n");
//B_APPInit();
USB_VcomInit();
/* Force the counter to be placed into memory. */
volatile static int i = 0 ;
/* Enter an infinite loop, just incrementing a counter. */
while(1) {
i++ ;
/* 'Dummy' NOP to allow source level single stepping of
tight while() loop */
__asm volatile ("nop");
}
return 0 ;
}
Stopping simulation, unplugging USB port and plugging again leads to same error, the virtual comport never appear properly under Ports in Device manager.
Since my post I have found an interesting example: "hello_world_virtual_com" under demo_apps in SDK import wizard. As the name implies is seems to use the virtual_com utility, at least the files and directories look very much like my USB-virtual_com based project. To my surprise when debugging this project the port fails exactly the same way as my project. But when stopping simulation, unplugging the USB connector and plugging it in again the port comes in under Ports in Device manager.
I have analyzed (eclipse compare files) USB files in both these projects and the most important files are exactly the same (usb_device_descriptor.c/.h, virtual_com.c/.h, usb_device_config.h). I found some minor difference in clock_config.c/.h.
I thought I could import the clock from the "hello_world_virtual_com" project into mine with import mex file, but it did not work I am not convinced that the small difference matters for USB, I have the 48MHz clock.
In contrast to these two examples, the example "dev_cdc_vcom_bm" under usb_examples in SDK import wizard has no problems, I can debug it and the above mentioned error never appears. (this is the example I have built on (copied from) when creating a new USB project with the recommended method of building new USB project from an example)
The error I get in the two first mentioned projects (Device descriptor request failed) directs my interest to the USB_DeviceCallback function in the virtual_com.c file. If I compare this function in "hello_world_virtual_com" or my own USB project (these two are equal) on one side to this function in dev_cdc_vcom_bm on the other side, there is a big difference. The latter seems to respond to much more cases in the switch function.
So to summarize:
- My USB project: port never come in under Ports in Device manager
- hello_world_virtual_com: port comes in when rebooted, not during debugging
- dev_cdc_vcom_bm: port always works fine (but is cumbersome transform to a new project)
Could the problem be that the USB_DeviceCallback does not serve some device descriptor request?
I would be happy for any comment.
Best regards,
Baldur