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

Updated for Arduino Uno R4 maxima and wifi #779

Merged
merged 1 commit into from
May 2, 2024
Merged

Conversation

mjs513
Copy link
Contributor

@mjs513 mjs513 commented Jul 14, 2023

Updated for latest Arduino R4 boards (maxima/wifi).

Tested BT with PS4 and XBox, and wired PS4. Also ran QC sketches. All was on the Minima board

Copy link
Contributor

@xxxajk xxxajk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reformat with tabs as 8 spaces, otherwise, looks great!
Optional/additional/bonus points consideration: make a new definition in settings.h that reduces the teensy4 elif, and places it in one single place, in order to reduce constant similar long if/elif blocks. This is something I would have done years ago, and still have not had a chance to do.

@mjs513
Copy link
Contributor Author

mjs513 commented Jul 21, 2023

Sorry been sidetracked with other issues and projects. Looking at both the Github version and my version - there are no tabs in the files only spaces.

Sorry.

@xxxajk
Copy link
Contributor

xxxajk commented Jul 31, 2023

Sorry been sidetracked with other issues and projects. Looking at both the Github version and my version - there are no tabs in the files only spaces.

Sorry.

Yes, but they don't appear to be 8 space indents...

@Jtonna
Copy link

Jtonna commented Aug 2, 2023

Updated for latest Arduino R4 boards (maxima/wifi).

Tested BT with PS4 and XBox, and wired PS4. Also ran QC sketches. All was on the Minima board

Can confirm this allows compilation & uploads to go through, but in my
attempts to run the USB_desc using these changes with the R4 Minima & an ARCELI USB Host Shield & am getting the "OSC Did Not Start" issue. I know the shield is working as I've tested it on 3 Leonardos.

May I ask which USB host shield are you using & was there any special config needed for OSC to start in your testing?

@alejaxdro
Copy link

I just tested this with the Arduino R4 wifi and after getting the "OSC Did Not Start" issue, I remembered that this board requires power on VIN(I connected a 12v supply) when the Power Select Switch on the USB shield is set to VIN. Otherwise move the switch over to 5V and it also works fine, but I find this to pull too much current and the onboard regulator gets too hot. I'm also connecting to a hub and connecting 4 devices, so that would also push this setup over it's limit.

@esp32beans esp32beans mentioned this pull request Dec 12, 2023
@fraca7
Copy link
Contributor

fraca7 commented Jan 3, 2024

Hello. I was testing this on my new R4 Wifi board and got the "OSC did not start" error with both my shields (from different manufacturers). After digging a bit I found out the problem is at the SPI level; the board_qc sketch kept finding out the wrong die revision or failing at the "SPI long test" step, with the dreaded "0x55 pattern is transmitted via SPI" message.

To be honest I don't know anything about SPI but on a hunch I changed every occurence of

USB_SPI.beginTransaction(SPISettings(260000000, MSBFIRST, SPI_MODE0)); // The MAX3421E can handle up to 26MHz, use MSB First and SPI mode 0

in usbhost.h, replacing the 26000000 value with something else. It looks like when this value is <= 23500000 both of my shields work perfectly. Starting at 24000000 the board_qc sketch fails (so do the examples of course).

According to the Arduino forums this seems to happen to several people, so leaving this here for posterity.

@xxxajk
Copy link
Contributor

xxxajk commented Jan 5, 2024

Hello. I was testing this on my new R4 Wifi board and got the "OSC did not start" error with both my shields (from different manufacturers). After digging a bit I found out the problem is at the SPI level; the board_qc sketch kept finding out the wrong die revision or failing at the "SPI long test" step, with the dreaded "0x55 pattern is transmitted via SPI" message.

To be honest I don't know anything about SPI but on a hunch I changed every occurence of

USB_SPI.beginTransaction(SPISettings(260000000, MSBFIRST, SPI_MODE0)); // The MAX3421E can handle up to 26MHz, use MSB First and SPI mode 0

in usbhost.h, replacing the 26000000 value with something else. It looks like when this value is <= 23500000 both of my shields work perfectly. Starting at 24000000 the board_qc sketch fails (so do the examples of course).

According to the Arduino forums this seems to happen to several people, so leaving this here for posterity.

There was another MCU released by microchip that had SPI speed limits because of poor silicon design.
That said--

UHS3.0 does a quick speed verification test, which not only avoids the entire issue, but also allows really lousy SPI lines (ones that are too long) to be used, within limits, of course...

The only bad thing about UHS3 is that it will never be able to run on the classic uno, and the mega1280/2560 just barely have enough room (RAM is too small!) USB is a heavy lift!

The only reason that UHS2 "works" at all is because it cheats -- it doesn't actually do the enumeration properly to spec.
In order to avoid high RAM usage these cheats can cause strange issues with certain combinations of device drivers. It's why some will never work, and why some combinations don't.

@skhrlx
Copy link

skhrlx commented May 1, 2024

Using this, my mouse can only get 125hz polling rate, when I use it on my leonardo, my mouse gets the 1000hz, do you know what I can do? The information about the r4 + usbhostshield is very limited for now

@Lauszus
Copy link
Collaborator

Lauszus commented May 2, 2024

Sorry for the long delay. Merging it now.

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

Successfully merging this pull request may close these issues.

7 participants