I created a processor expert USBHS and USBPHY module and added the initialization code that it generated to my K65 executable. During the initialization, the USBHS code runs first (there isn't actually anything generated for the PHY init) and the MCU resets when it attempts to access the USBHS PORTSC1 register. I would have expected the PHY to need to be initialized first (and the PLL locked) before the USBHS could be initialized. Am I missing something?
The generated code attempts to clear some bits on the USBHS_PORTSC1 register. For some of the values (PTC) it looks like it only clears the first bit rather than the entire field. Is the code not generated correctly? There are not a lot of things I can change without it complaining that it won't work (clock gates, endianness). I have the USBHS set to device mode.