openwrt-zsun icon indicating copy to clipboard operation
openwrt-zsun copied to clipboard

USB Gadget mode, any success?

Open stevelord opened this issue 8 years ago • 15 comments

Hi guys,

The Hackspace.pl wiki mentions USB gadget mode. I'm interested in trying it out, and was wondering if anyone has managed the steps described, which are:

Port the code
Remove the bootstrap resistor setting USB to host mode
Remove the card reader PCB and rewire the the USB signal pins

Has anyone managed this so far? If so, care to share your findings/code?

stevelord avatar Jul 10 '16 21:07 stevelord

I'm also very interested in this feature. If anyone has information on using the Zsun in USB Gadget mode, then please share your findings.

frakman1 avatar Jul 23 '16 18:07 frakman1

I'm interested, too. I did some googling, and found this: https://marc.info/?a=136188979700002&r=1&w=3 https://patchwork.linux-mips.org/patch/4968/ . Apparently, (unless I'm misreading) the patches were revised multiple times and sent, but they were never approved/pushed upstream... I wonder how much would it cost to (back) port them and push them to upstream + openwrt.

pqyptixa avatar Jul 29 '16 00:07 pqyptixa

Also, there is a repo in github owned (I guess) by the person that made these patches: https://github.com/neykov/chipidea-openwrt , but it seems to be a bit older than the latest patchset ("Latest commit b4b579b on 28 Feb 2013" vs March 28 show in the linux-mips.org link above).

pqyptixa avatar Jul 29 '16 00:07 pqyptixa

Digging a bit more... v3 of the patches: https://www.linux-mips.org/archives/linux-mips/2013-04/msg00009.html As plntyk @ #openwrt pointer out, looks like there never was a v4: https://www.google.com/search?q=%22PATCH+v4+*%5D+usb%3A+chipidea%22+%22Neykov%22

pqyptixa avatar Jul 29 '16 06:07 pqyptixa

Hope someone will port this

Phant0mC0der avatar Aug 11 '17 22:08 Phant0mC0der

USB gadget is working in LEDE trunk (unfortunately it has not been included in the first stable release).

Here's a quick port I made some time ago: https://github.com/Emeryth/source/tree/zsun

Emeryth avatar Aug 11 '17 23:08 Emeryth

Is it possible to make zsun as rndis usb gadget?

Phant0mC0der avatar Aug 12 '17 00:08 Phant0mC0der

Yes, I've tested it.

Emeryth avatar Aug 12 '17 00:08 Emeryth

Hi @Emeryth,

sorry for the question, does g_ether works without any hardware modifications ?

If yes, I was wondering if it is possible to post some compiled images as I believe g_ether is very useful.

Thank you

catalinii avatar Nov 23 '17 01:11 catalinii

I'd like to use that too but using LEDE which ignores my wishes or I just am a victim of pebcak. :-(

So probably I only can impatiently wait for a new LEDE release? Could it be "officially" supported then?

Where is the petition we need to sign? ;-)

drawkula avatar Jan 05 '18 04:01 drawkula

I've modded my old-PCB ZSUN by removing the card reader board and headers, then jumped D+ and D- to USB connector, and finally removed G13 resistor (well, the hard way, I yanked it with a pair of tweezers since its too tiny for the iron).

zsun_gadget (please ignore my crude soldering job)

On the original OpenWRT image (from here) the PC can detect the presence of an invalid device plugged in, while on an LEDE image (from here) nothing really happens. I haven't got time to compile my own kernel and image so I'd say it could be just a false hope.

x-magic avatar Jun 04 '18 15:06 x-magic

The USB gadget driver for AR9331 is not present in OpenWrt or LEDE 17.01.4. You have to compile LEDE trunk with one of the USB gadget modules.

Emeryth avatar Jun 04 '18 15:06 Emeryth

@emeryth thanks mate

I guess hardware-wise I'm good? (Please tell me yes🤞)

Cheers

x-magic avatar Jun 04 '18 15:06 x-magic

Yes, it looks that way. Remember that you will need to reduce the size of the LEDE kernel image by disabling some options (or it won't fit in the zsun's kernel partition). There's discussion about it in the thread you posted.

Emeryth avatar Jun 04 '18 15:06 Emeryth

@Emeryth Fantastic! Thanks for the tips.

x-magic avatar Jun 04 '18 23:06 x-magic