Skip to content

Kinetis USB improvements and fixes #5877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2018

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Jan 18, 2018

Make the following improvements and fixes:

  1. Update the Kinetis USB driver so that endpointReadResult only reads the result of the last read and does not trigger a new read. Instead move the code to trigger new reads into endpointRead.
  2. Fix the race condition in controlIn caused by a call to EP0read() followed immediately by EP0readStage(). This is done by setting up to read the next setup packet (ignoring the status stage)
    in endpointReadResult rather than in EP0readStage. This makes the function EP0readStage unnecissary.
  3. Remove the Kinetis workaround in controlOut in USBDevice.cpp since point 2 fixes this bug. For more info on this see the PR which added this workaround - Fix KL25Z connect problem with some USB 3.0 hosts #414

Make the following improvements and fixes:

1.
Update the Kinetis USB driver so that endpointReadResult only reads the
result of the last read and does not trigger a new read. Instead
move the code to trigger new reads into endpointRead.

2.
Fix the race condition in controlIn caused by a call to
EP0read() followed immediately by  EP0readStage(). This is done by
setting up to read the next setup packet (ignoring the status stage)
in endpointReadResult rather than in EP0readStage. This makes the
function EP0readStage unnecissary.

3.
Remove the Kinetis workaround in controlOut in USBDevice.cpp since
point 2 fixes this bug. For more info on this see the PR which
added this workaround - ARMmbed#414
@c1728p9
Copy link
Contributor Author

c1728p9 commented Jan 18, 2018

@Sissors in theory this should fix the USB stability problems on the K64F. Please test (you'll need to move USBDevice out of the unsupported folder) and let me know if this fixes the issues you were seeing. I tried your ram disk example from #4761, but couldn't reproduce your failure - it worked both before and after this change. When building in debug mode I did get Mutex 0x20003c84 error -6: Not allowed in ISR context but this was fixed by either building as release or pulling in the changes in #5874 (specifically commit Fix local static initialization in USB).

CC @mjrgh @larsgk @0xc0170 @Sissors @mmahadevan108 @ashok-rao

@c1728p9
Copy link
Contributor Author

c1728p9 commented Jan 18, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jan 18, 2018

Build : SUCCESS

Build number : 891
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5877/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jan 18, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 18, 2018

@Sissors
Copy link
Contributor

Sissors commented Jan 22, 2018

Didn't see the comment in my mailbox between all build related mails ;). I will try it one of the coming days to see if it solves those issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants