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

usb DFU not working #10

Closed
xogium opened this issue Feb 11, 2022 · 12 comments
Closed

usb DFU not working #10

xogium opened this issue Feb 11, 2022 · 12 comments

Comments

@xogium
Copy link

xogium commented Feb 11, 2022

I've been trying to use the default mangopi defconfig and am encountering some problems:

  • mtd subsystem is present along with spinand support in u-boot but lacking the gigadevice spi flash
  • usb controllers are notr detected

I fixed the first issue by simply enabling the gigadevice spi flash support in u-boot menuconfig, but no matter what I try I can't get DFU to work at all. Typing usb start just says, no usb controllers found.

How to solve this ?

@aodzip
Copy link
Owner

aodzip commented Feb 12, 2022

Are you use virtual machine?

@xogium
Copy link
Author

xogium commented Feb 12, 2022

Hi,
no, I am not using a virtual machine. This is on real hardware, both for the host pc and the board.

@aodzip
Copy link
Owner

aodzip commented Feb 18, 2022

are you using latest windows 10 or 11?

@xogium
Copy link
Author

xogium commented Feb 18, 2022

Hi,
I am using linux, not windows. I run up to date archlinux.

If that is any help, every time I upload u-boot in FEL mode, I get usb enumeration errors on my host, like these:

[219774.171849] usb 1-7: new full-speed USB device number 16 using xhci_hcd
[219774.388559] usb 1-7: device descriptor read/64, error -71
[219774.688568] usb 1-7: device descriptor read/64, error -71
[219774.985190] usb 1-7: new full-speed USB device number 17 using xhci_hcd
[219775.201898] usb 1-7: device descriptor read/64, error -71
[219775.498564] usb 1-7: device descriptor read/64, error -71
[219775.607852] usb usb1-port7: attempt power cycle
[219776.078530] usb 1-7: new full-speed USB device number 18 using xhci_hcd
[219776.105521] usb 1-7: Device not responding to setup address.
[219776.339005] usb 1-7: Device not responding to setup address.
[219776.545202] usb 1-7: device not accepting address 18, error -71
[219776.738532] usb 1-7: new full-speed USB device number 19 using xhci_hcd
[219776.765498] usb 1-7: Device not responding to setup address.
[219776.998964] usb 1-7: Device not responding to setup address.
[219777.205199] usb 1-7: device not accepting address 19, error -71
[219777.207814] usb usb1-port7: unable to enumerate USB device

Hope this helps.

@xogium
Copy link
Author

xogium commented Feb 18, 2022

But if not in FEL mode, I also get no usb at all in u-boot, though these errors then don't show up, of course. I think u-boot just doesn't have usb controllers needed for this board enabled in the build, or something to messed up in that enormous 2800+ lines patch you apply on top of it.

@xogium
Copy link
Author

xogium commented Feb 18, 2022

Oh, I also just was told that our boards are in fact r3c revision of mangopi not r3...

I have absolutely no clue what that might change though, given that the r3c schematics were never made public.

I know very little about it:

  • uart converter changed to uart1 instead of uart0
  • nand flash possibly changed from a windbond one to a gigadevice nand flash

And who knows what else ? One thing is sure though, we can't trust the r3 schematics any more than we could trust the r2 or r1 at this point, given we have no idea what got modified between r3 and r3c.
For all I know, usb is not even working as it should on this revision !

Are you authorized to disclose info about the r3c ? Do you have one of them, even ? Or is this some elusive revision ?

Dfrobot, which is the seller we bought these from, soled them as r3, not r3c.

@aodzip
Copy link
Owner

aodzip commented Feb 19, 2022

I see. In uboot the "usb" command won't help because "usb" is for Host, you can try "ums" or "dfu".

Most F1C200s run well , I have no idea why your board can't work yet.

I only have some report of Windows 10&11 have compatible issue with libusb.

@xogium
Copy link
Author

xogium commented Feb 19, 2022

Hmm, I see.

Still, this doesn't work either.

ums 0 mmc 0:2 doesn't make any peripheral show up on my host, despite the progress bar moving in u-boot.

As for dfu, trying to do something like dfu 0 mmc 0 or dfu 0 list shows me

"dfu_alt_info" env variable not defined!
exit not allowed from main input shell.

I'm very confused, am I missing a driver or should this work out of the box on linux and only windows needs a driver ?

@mangobuge
Copy link

try this: https://github.com/xboot/xfel
xfel spinand write

@xogium
Copy link
Author

xogium commented Feb 19, 2022

Woohoo !

Sorry... I'm just glad. It seems that xfel manages to both detect the flash and burn it. It is still burning as I write this so I don't know if it will be successful, but if that allows me to work around the broken DFU, I certainly will not say no !

Thanks for the recommendation.

That being said I'm still open to trying out to fix the DFU so if you have anything for me to test, don't hesitate, I'd be glad to help debug this.

@xogium
Copy link
Author

xogium commented Feb 19, 2022

For what its worth...

Dfrobot made a new version of their firmware, version 0.2. And the instructions on the wiki now works for linux. But I am not sure how they managed this given they appear to have their own private buildroot fork. So, whatever this is, it must be a software isue, not an hardware one.

@xogium
Copy link
Author

xogium commented Apr 3, 2022

Hi,
I solved this. As it turns out, the table for dfu isn't set at all in the u-boot env you carry, but it is set in the DfRobot buildroot fork, which was published upon us asking for it. Incidentally that also fixed my issue with auto boot which didn't work.

https://github.com/ouki-wang/buildroot-f1c-pinpong/blob/master/board/allwinner/suniv-f1c100s/uboot.env

Hope this helps others, should they encounter the same kind of issues.

@xogium xogium closed this as completed Apr 3, 2022
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

3 participants