Skip to content
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

Merging forks #31

Open
tobozo opened this issue Mar 4, 2023 · 12 comments
Open

Merging forks #31

tobozo opened this issue Mar 4, 2023 · 12 comments

Comments

@tobozo
Copy link
Owner

tobozo commented Mar 4, 2023

@suarezvictor your fork is very impressive and I wish I found it earlier.

Before starting to integrate your changes, I need to establish an exhaustive board list to handle to the workflow matrix that will run the build tests. Did I miss any device?

  • ESP32-Wroom
  • ESP32-Wrover
  • ESP32-C3
  • ESP32-S2
  • ESP32-S3
  • Teensy
@suarezvictor
Copy link

suarezvictor commented Mar 4, 2023 via email

@suarezvictor
Copy link

suarezvictor commented Mar 4, 2023

I'd really like support for FS devices at 12mbps, and that way test a game controller
Do you know of a good library that does good packet decoding of various types of hardware? I wasn't able to find even a mouse handler that supports both 8-bit protocol and 12-bit protocol (I'm currently assuming 12-bit)

@tobozo
Copy link
Owner Author

tobozo commented Mar 4, 2023

I'd really like support for FS devices at 12mbps

12mbps sound way over limit with the USB 1.0 specifications of this USB driver, unless you're talking of using tinyusb?

Do you know of a good library that does good packet decoding of various types of hardware?

The USB_Host_Shield library is a very good source of inspiration.

I wasn't able to find even a mouse handler that supports both 8-bit protocol and 12-bit protocol

Neither did I when I played with the ESP32-WUD, so I made a tinyusb descriptor for absolute mouse that uses signed 16bits values.

@suarezvictor
Copy link

I'm talking about pushing this exact core to 12mbps, the teensy runs at 600MHz...
Great to know about absolute mouse! they may use it with touchscreens, I have one and didn't figure out how it works, they may use absolute coordinates
regardind the host shield library I'll take a look

what about keeping a C interface and a C++ wrapper for those that require it? C++ in FPGA environments is a bit harder

@tobozo
Copy link
Owner Author

tobozo commented Mar 4, 2023

have you seen the this teensy library? it seems to handle mass storage, filesystem and game controllers altogether

separating C++ wrapper from C interface sounds good but I've never tried FPGA devices before, do I need additional hardware such as an oscilloscope or other special tools to play with that?

@suarezvictor
Copy link

yes, the teeny library may be useful
I've seen a more complete one but can't remember it now
btw such a library doesn't support 12-bit mouse protocol (all my mouses are like that so it may be the norm), see https://github.com/PaulStoffregen/USBHost_t36/blob/master/mouse.cpp#L63

In regards to the C interface, i think that's mandatory. you can do C++ in the FPGA but it's not as usual (indeed I implemented a complete UI with mouse/keyboard support in C++ and using C++ libraries)

go get a FPGA! you need nothing for simple to intermediate things
indeed you can run simulated designs with verilator on your PC at useable speeds (i.e. run a linux console with a custom CPU done in the FPGA)

@tobozo
Copy link
Owner Author

tobozo commented Mar 4, 2023

@suarezvictor
Copy link

a good driver should detect the protocol, like windows and Linux do
I've seen no embedded development with such a capability

@tobozo
Copy link
Owner Author

tobozo commented Mar 4, 2023

it's not the driver's job to negociate a story between USB devices, windows and linux/mac use different strategies anyway.

For example a problem with libraries derived from tinyUSB is that their descriptor/reports are macro based, which makes it nearly impossible to have variable ID or device order, thus rendering any mixed-device implementation limited to some situations only (e.g. can't add hybrid absolute mouse/keyboard as device number 1 to a windows laptop with an existing touchpad if a second mouse already exists on the bus).

Otherwise there's a way to identify the OS if you manage to capture some low level reports, then you can apply some different magic to your report descriptors depending on the situation.

@suarezvictor
Copy link

are we talking about doing a USB host right? so the host hast to adapt to the device capabilities

@suarezvictor
Copy link

suarezvictor commented Mar 4, 2023

we need to split the development in a module that communicates with USB devices (packet exchanging), an other that does the decoding and interpretation of packets, the latest one should be really general... just one implementation for all platforms

@tobozo
Copy link
Owner Author

tobozo commented Mar 5, 2023

Tried for a dozen hours but I can't get my head around those tinyusb changes, whatever I try doesn't compile with ESP32. I guess it's enough research for a sunday :-)

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

No branches or pull requests

2 participants