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

Added support for Adafruit NRF52832 Feather #640

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ar664
Copy link

@ar664 ar664 commented May 28, 2021

Used this pr as a reference:
#614

I successfully flashed it and it went through USB.Init without error.
Will report back when I have tested it with my original xbox controller. If anyone would like to test it in the mean time, feel free to do so.

@Lauszus
Copy link
Collaborator

Lauszus commented May 28, 2021

Looks good. Can you also add it to the list of supported boards: https://github.com/felis/USB_Host_Shield_2.0#boards and the CI: https://github.com/felis/USB_Host_Shield_2.0/blob/master/.github/workflows/main.yml#L48?

@ar664
Copy link
Author

ar664 commented May 28, 2021

Would the CI be like this?

pio ci --lib="." --board=adafruit_feather_nrf52832 --project-option="build_flags=-Wno-sign-compare -Wno-unused-function -Wno-unused-variable"

How do I test this?

@Lauszus
Copy link
Collaborator

Lauszus commented May 29, 2021

Simply add it to the other NRF52 board i.e:

pio ci --lib="." --board=adafruit_feather_nrf52840 --board=adafruit_feather_nrf52832 --project-option="build_flags=-Wno-sign-compare -Wno-unused-function -Wno-unused-variable"

Then commit and push it and the CI will trigger and build it automatically.

@ar664
Copy link
Author

ar664 commented May 29, 2021

It working was a false positive. I ran the board_qc sketch and I get this.

Reading REVISION register... Die revision invalid. Value returned: FF
Unrecoverable error - test halted!!
0x55 pattern is transmitted via SPI

I have the duinofun mini board and have the SPI connected correctly after checking the pins with the MAX3421E datasheet. Do I need to connect the Reset pin in the MAX3421E

Edit: I believe my host shield is defective. I ordered one of the same type and another one of a different type. I'll update you when I receive and test them.

@ar664
Copy link
Author

ar664 commented Jun 7, 2021

Do I need to modify my setup with any pull down resistors?

  • Serial is working
  • SPI is correctly wired, given MAX3421E spec sheet
  • Nrf52832 spec says it's able to output 3.3v 500ma, so I assume the host is able to be powered
  • The SS Pin measured 3.3V
  • I don't have oscilloscope, but I measure a peak of .4V from the SPI signals.

Don't mind the mess, but here is a visual of the current setup. (If you need a diagram lmk).

Nrf52832Setup

In addition to the before example 00 is also returned by both sometimes with board_qc.

Reading REVISION register... Die revision invalid. Value returned: 00
Unrecoverable error - test halted!!
0x55 pattern is transmitted via SPI

Both of them come up with the same result with XBOXONE example:

OSC did not start

or

XBOX USB Library Started
BSP Library : 0.22.1
Bootloader  : s132 6.1.1
Serial No   : FC7C7CD0DB9ECC34

but no input is detected and no white light indicator on the xbox controller.

The xbox controller does vibrate indicating that power was received.
I'm using a powered usb hub to power the whole thing with an external power supply, should be good up to 5v 2000ma. I've ran usb hdd's off of it.

@xxxajk
Copy link
Contributor

xxxajk commented Jun 7, 2021

If you still get unreliable operation, there's two things that can cause this that many people do not realize.
1: Keep SPI lines as short as possible
2: If you can't use shorter wires, lower the SPI speed.
3: A combination of 1 and 2.

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.

3 participants