Summary
I worked through NXP support to identify the workaround in the SDK. The workaround is implemented in a single example within the SDK. The USB.6 errata states "the software work-around is implemented on the SDK software platform for the LPC546xx device and must be used to avoid this issue", which I find to be harmfully misleading at best. If you use the SDK and the USB stack in your application, the workaround for errata USB.6 is NOT APPLIED. You will see failures on about 20% of your units in production with some hosts & hubs! The good news is that the workaround is effective, but you must manually modify your USB code to apply it.
Details
I submitted Case #00220077 to NXP on Jun 27, 2019, and nxf46116 was assigned to the case. She initially tried to find the workaround in the SDK. Like me, she didn't find the workaround, so she contacted an application engineer. On July 11, 2019, I received a response:
I receive an answer from the application engineer, it looks like this workaround is only implemented in the dev_hid_mouse example...
The workaround is only in one specific example of the SDK, and only in the bare metal version. As of SDK 2.5 with the LPC54608, see USB_Device_HsPhyChirpIssueWorkaround in:
boards\lpcxpresso54608\usb_examples\usb_device_hid_mouse\bm\mouse.c
Here is a brief description of the USB.6 errata:
- LPC546xx attempts to connect to the USB host. The host may signal K-J chirp pairs to request high-speed.
- If the LPC does not see the K-J pairs (the defect), then it will incorrectly be in full-speed mode. Future communication will fail.
I have built approximately 450 units so far using the LPC54608, and testing found 63 failed to establish a connection with one specific Windows 10 PC and hub configuration (14%). However, this testing is not exhaustive of this issue, and I suspect some liability with other units in other configurations.
Here is how this workaround works:
- When the LPC negotiates full-speed mode, don't trust it. Enter the test_force_enable USB test mode which forces the device into high-speed mode.
- Wait for 100 ms and attempt to see if the frame number changes. If the LPC is receiving SOF, then the host is in high-speed mode.
- Disable the test_force_enable test mode.
- Whether the host is in high-speed mode or full-speed mode, the LPC is now in violation of the USB spec. Disconnect, wait 510 ms, and reconnect. The host will then renegotiate. For some reason, the LPC will see the high-speed K-J chirp pairs this time and work correctly. If the host is really full-speed, don't do this workaround again and accept the full-speed connection.
Even with the workaround, the LPC546xx will violate the USB specification which is a non-starter for some applications. The errata should clearly state this!
With this workaround applied, I have confirmed that all previously failing units now correctly connect to the Windows 10 host. I also previously observed a particularly unusual hub that even caused "working" devices to later disconnect when the device started full-rate data streaming at 8 MB/s. This hub is perhaps slightly out of spec. With this fix applied, I no longer observe these disconnects. Testing on Linux and macOS also works.
Thank you to nxf46116 for your support in identifying this critical issue for my product. Unfortunately, I am disturbed by the "LPC5456xx Errata sheet" USB.6 write-up which is misleading at best. Although an example of the workaround may be found in the SDK, neither me nor Alexis could find it. If an application uses the SDK platform, this workaround is not applied by the SDK. All chips of any complexity have errata, and sometimes the errata fixes do not work as well as hoped. However, this USB.6 LPC546xx errata is the first one I have encountered in my career that gave a harmfully misleading statement (lie?) about the workaround being applied.