I'm having a serious problem getting the USB of ATSAMD51G18A running using Atmel Studio. I added the USB Device CDC Stack in Atmel start and after some tries with different clock configurations I finally found a combination where the USB is showing up in my Windows as a virtual COM port and gets an COM port number. Manufacturer and device ID is read correct. I only used the AFS4 example which only replies everything you send there. This works the first time when I plug the device into a new USB port (when Windows has to install the driver). If I unplug an plug into the same port or if I only reset the pcb or if I just reflash I can open the port but the serial terminal program (putty or termite) crashes after sensing one byte the the device runs in a while(1) routine in the dummy handler. Looks like if windows is too fast when it is not installing the driver and then the USB is not initialised direct, but there are no delays I can see.
There is no code from me in this project so there must be a problem with the framework.
Did anybody experience the same behaviour ?
Does anybody have a Atmel Studio project with ATSAMD51 using USB device running ?
Every help is appreciated.