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.
This was written from scratch using the datasheet and tested on a SAMD21 (using SparkFun SAMD21 Mini Breakout).
However, it should also work with SAMD51 boards, I don't have one for testing though.
USB Hub Issue
For some reason, when compiling the host/hid_controller example from tinyusb (modified by setting
CFG_TUH_HUB
to1
),GET_DESCRIPTOR
times out when connecting devices via USB hub.When I use tinyusb within my platformio project (which uses framework-arduino-samd for device initialization), devices connected via HUBs work without any issues.
I've compared the runtime values of all registers that should matter for USB, but could not find any meaningful difference.
Nevertheless, I must have missed one or some, because HUB connections are always working with the arduino samd framework but never with the tinyusb example.
BIG EDIT:
Even tho I triple-checked, it might be possible that I am still not enabling the correct pin for power delivery since at that time I had no means of measuring it - and the failure description looks kinda like it.
I am using the same Sparkfun board as in my previous PR to add that board.
The (unfortunately board-dependent) code I've added for this can be found in my updated version of hw/bsp/samd21/family.c:
Hardcoded to
PIN_PA28
because that is what I assumed to be the right pad that enables the host power delivery on my sparkfun board.Hope I will have time in the near future to set everything up again and try an active USB hub to see if that is the issue, but I think that is one thing that should be improved before this PR is merged since it should support all kinds of boards.