Summary:
I have created a custom board using the ATSAMD51G19A MCU and cannot figure out how to get USB CDC working on it. I mistakenly thought the API was the same as the SAMD11 with "standard" ASF when designing the board and now am on the hook to get this thing working.
I cannot decipher this Atmel "Start" system. It is not very intuitive to me, I am experiencing freezing every time I click items during configuration. Any documentation sources, or examples would be very great.
I am really struggling with getting the USB even attached to the system, any help is appreciated, steps taken so far below:
Note:
The board is configured with a 12MHz external clock. There is no 32KHz external crystal.
Goal:
Create a simple USB-CDC example to read and write a string to the console, to be hooked into a SCPI parser.
Current State:
- System does not initialize USB. The USB device does not appear in device manager.
- It does program, and blinking LEDs works as expected. Presumably this validates the board is properly wired.
- No shorts measured during continuity testing of USB
Steps Taken:
- Code
- usb_d_init();
- usb_d_enable();
- usb_d_attach();
- Clock
- Clocks have been configured to 48MHz. Initially DFLL was used with clock recovery mode selected as used in the SAMD11 project, however, the system reported errors.
- Clocks are configured now using DPLL0. I had to scale the XOSC1 down with CLK2 to 3MHz to be <3.2MHz for DPPL0 according to the error messages.
- I am not sure if the clock is even working as expected.
- Documentation
- I have reviewed the ASF4 API Reference manual for USB
- The considerations for SAM D21 USB were considered, (This is SAMD51) and USB recovery mode was tried as explained in Clocks
- I have been unable to find additional example code for USB-CDC, The USB Stack documentation appears to be outdated (works with SAMD11 though)
- I do not know of other resources
- Additional Resources Considered