I am implementing the USB stack (High Speed, EHCI controller) on a Kinetis MK26FN2M0VMI18 starting from the code generated by the latest MCUXpresso SDK.
I am trying to implement an USB Virtual COM device.
When using the project generated by the SDK the device is enumerated correctly.
However, I need to import the USB code, including initialization of clock and registers, in our existing project, so I tried to do this process with the greatest care. Nevertheless, the enumeration is not working: the PC is giving the message "Unrecognized USB device". The _usb_dci_usbhs_isr service routine is never called with EHCI_STS_INT set (the UI bit of USBHS_USBSTS register), which would imply serving the GET_DESCRIPTOR request from the PC. The interrupt is enabled: bit UE of USBHS_USBINTR is set correctly.
In the USBHS_USBSTS register, the SEI bit is set (this does not happen in the original MCUXpresso project). Documentation says "System Error - Set when an error is detected on the system bus".
What could I have missed in importing the USB code in our project? What are the possible causes of the SEI error?
Thank you.
Solved! Go to Solution.
The above problem turned out to be caused by the missing disabling of the MPU:
MPU_CESR_REG(MPU_BASE_PTR) &= ~MPU_CESR_VLD_MASK;
Now the device is enumerating correctly, at least at the first insertion. Possibly some problems sometimes when detaching and attaching again, to be verified.
The above problem turned out to be caused by the missing disabling of the MPU:
MPU_CESR_REG(MPU_BASE_PTR) &= ~MPU_CESR_VLD_MASK;
Now the device is enumerating correctly, at least at the first insertion. Possibly some problems sometimes when detaching and attaching again, to be verified.
The only difference in registers which might be related to USB, between working sample project and not working project is:
WORKING SAMPLE PROJECT NOT WORKING PROJECT
USBHS_USBSTS UI=1, SLI=1 UI=0 (never at 1), SLI=0, SEI=1
USBHS_PORTSC1 LS=00, SUSP=0 LS=10, SUSP=1
What can cause SEI=1 and SUSP=1?
Is the difference between values of LS field important? What is its meaning?
Please advise. Many thanks.