AnsweredAssumed Answered

Processor Expert Dual Speed USB generated code missing speed detection

Question asked by Lucas Magasweran on Mar 2, 2016
Latest reply on Mar 4, 2016 by isaacavila

I'm using Processor Expert 3.0.1.b150806, Kinetis Design Studio 3.0.0, and the KSDK 1.3.0 (1.0.0.b150914) and a K26 MCU. The MCU USB PHY supports high/full/low-speeds but the Processor Expert code does not produce code that works for High Speed.


The fsl_usb_descriptor options are "Low speed", "Full speed", and "Dual speed". Using Processor Expert to configure a Full-Speed USB descriptor (Device Speed) works. When configured for "Dual speed" both a "High speed" and a "Full speed" "Device description is created (I assume for backwards compatibility with USB 1.1).


An issue I found is the generated USB descriptor code (e.g. usbDsc1.c:USB_Desc_Get_Descriptor()) does not return the High Speed descriptor even when the USBHS_PORTSC1[HSP] indicates this is a High Speed port.


I suspect this is because there is no generated code that updates the variable usbDsc1_CurrentUsbSpeed, used by usbDsc1.c:USB_Desc_Get_Descriptor(), when the port is changed or reset.


As a workaround I added the following line to my main() before the Processor Expert's PE_low_level_init().


usbDsc1_USB_Desc_Set_Speed(0, USB_SPEED_HIGH); // first argument is not used


Is there a better way to fix this issue?


I could not find where the Processor Expert generated code comes from and patching the KSDK makes it difficult to version the project because changes are overridden by the KSDK installed on the developer's host. Can anyone point me in the right direction so I can put together a proper patch and validate it before sending it for review? Or are these Processor Expert components closed source?