Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the PR
Add a HCD driver for NXP FRDM-KL25Z.
The HCD driver works with only HCD class.
Additional context
In order to operate as a USB host function, J21 must be shorted. The schematic is shown below.
This PR was tested on
cdc_msc_hid
example with a low speed mouse(Logitech M-UB48) and a full speed mouse(Logitech G403).When running with a HUB, some patches are needed to make buffers align 4 byte boundary and to make buffer length be in 4 byte unit. It seems that KL25Z's USB IP(ChipIdea Fullspeed OTG core) writes data into memory in 4 byte unit.
Current HUB class driver requests IN transfer with the following buffers. The buffers needs patches.
tinyusb/src/host/hub.c
Line 43 in ffb257a
tinyusb/src/host/hub.c
Line 45 in ffb257a
tinyusb/src/host/hub.c
Line 49 in ffb257a
After the patches are applied, the HCD driver works with a pair of a full speed hub and a full speed mouse. However it does not work with a pair of a full speed hub and a low speed mouse. A bus turnaround timeout error will be occurred.