Tiny Core Base > Raspberry Pi

USB gadget kernel module with RPi zero

<< < (9/18) > >>

ladnar:
So, if piCore can't do the "cmdline.txt", "modules-load=dwc2,g_ether", then, do I have to do something else in its place?

Or is that what I am doing, here, manually, with all the plugging and unplugging and file-shuttling and modprobing and stuff? I am the module loader here, and thus this "normal" step can be skipped?

Obviously not, since I am bad at loading/implementing kernel, modules? I could use some automation!

I hope I don't have to assemble or compile or link the object files? (.ko is an object file, right?) I mean, I read about it in a book once, but never had to perform where it counts?

I'll just fumble around with a few other things until I get desperate enough to try "old school", blob-making, machine code.

I can try using a Raspbian master-board-card with my purported-putative-picore-slave?

Or I can try using my picore (11) master with my two (functioning) Raspbian slaves?

That should suffice for today's work. There is a Star trek TOS marathon (AKA soap commercial delivery vehicle) on today, and I want my HDMI-TV back for "fun stuff".

ladnar:
OK, I dmesg-ed the picore master-board-card. I didnt grep it or cat it or search it or even pipe | less it.  The last ten or twentey messages indicate that some USB device is trying hard to reach the master.

This device is device 7-14. The errors in getting recognized involve "failed to enumerate device", and "port3 attempt power cycle", and "error -110", and "device not accepting address 7 (thru-14?, etc.)", and "device descriptor read/64".

I was ifconfig-ing it, And I was lsusb-ing it. Perhaps this was creating the errors.  was also plugging and unplugging the slave-board-info-wire from the master-board-10-hub-strip, i.e. info-wire. Both boards are powered from their dedicated USB power jack.

OK, like I said, enough troubleshooting for today. I should read more, or understand more before I try again.

ladnar:
This is an excerpt of a PM I sent; a plea for help. But I might break out of this zombie thread, and start a new post somewhere; with "half-success" of my bramble-pi, I have experience to share, despite the flounderings my ramblings show, in this post.

"I HAVE been able to get Raspbian to do what I want; one board/SDcard for master, and a different board for slave. Also, I have a USB voltmeter-ammeter to check that both boards draw an independent power supply through their power USB-receptacles; leaving the other USB-data-receptacle to pass master and slave instructions and responses. I was worried that USB gadget mode would force the slave to try to obtain power through the master's "USB-info"-receptacle; but it does not.

(Although I have read some internet "horror stories" of fried boards due to cheap USB hubs and/or "newbies", like me, plugging things in wrong, and some "back-voltage"/"back-flow" occurring. But I don't really know much about this and just cross my fingers that it doesn't happen to me.)

So, what's the problem, you say? I would like to boot 10 "peripheral boards" --slaves--from one micro-SD card; a piCore9.0.3 that has been outfitted with ethernet gadget mode. That way, I can boot each one in sequence, eject and remove the card,  then boot the next one; and in this way use the same card to get the whole array of r-pi zeros up and running. And for the one master-picore board, I could afford a spare, extra SD-card, and just leave that one in while it runs the show.

I have followed many/most of johannkraus' instructions, blindly, in some instances, but still can't get ifconfig to show the picore slave as eth0 or usb0?

I have added modules, but I "picked and chose"? Maybe I needed to add the WHOLE 50 MB of modules? I am using piCore 9.0.3 for the slave board, and I have downloaded the entire 50 MB and unzipped it on my laptop. I then dragged and dropped the files I wanted onto flashdrive, and brought flashdrive over to the booted picore 9.0.3. The modules i dl-ed were for Linux kernel 4.9.22. (I also have the unzipped modules file for picore 11; but have not used them; my picore 11 card is a master, for now).

The master-picore is the latest version. Picore 11.0. But that shouldn't matter.

I have run depmod -a. The modules (folders) that i have added to /lib/modules .../drivers/"et-cetra" , have been added to the opt/.filetool.lst list, and saved, and I have used the backup command. I have ensured that I have the dependencies for the g_ether function; there are four listed in the modules.dep file.

I actually manually transferred the modules.dep file from the 4.9.22-modules package to the picore. I'm pretty sure its added to .filetool.lst and used the backup command after that too.

I have altered the config.txt final line to read dtoverlay=dwc2. I have used # to comment out the line [RPI3] and the line below it.

I have not altered the cmdline.txt file in any way; in contrast to the Rapbian method of ethernet-gadgeting.

So, I get two kinds of behavior in my setup. I can use a picore master and raspbian slave; and a raspbian master and picore slave. Right now, both of these setups show, under dmesg, that the slave board is trying to reach the master (there are several types of error messages; I might detail them below, if I can't figure this out in less than a week). Failled to enumerate. Device is trying to power. error -110. failed with error -16. failed with error -22. etc etc etc.

Now with picore as master and raspbian slave, lsusb registers a USB device is there, but ifconfig does not show any eth0 or usb0.

****ASIDE: (Hmmmm... now that I think of it, this is CURIOUS behavior? A Raspbian slave works fine if the master board is Raspbian too? Which indicates that the piCore11, master-SD card, is the one that can't handle the ethernet-gadget devices? hmmmm? It can register them in lsusb, but not configure them and assignan IP? hmmmm?)***********

With raspbian as master and picore as slave, neither lsusb or ifconfig registers a USB device.

The dmesg USB errors are different for these two different setups. I suppose this will be my next clue.

And, just for completion's sake, I'll describe further, the final two possible setups; with raspbi-master and raspi-slave, the setup works and usb0 and usb1 show up under ifconfig, and are assigned IP addresses. And for picore-master and picore-slave, the thing I am trying to achieve, nothing under ifconfig. (I haven't checked the dmesg ? maybe it will show evidence of the slave trying to get recognized on the bus, and getting errors/failure notices?).

The dmesg messages are definitely related to my plugging and unplugging the slave board to the USB-10-receptacle strip that I have connected to the USB-info-receptacle of the master board. The master board is in charge of this 10-receptacle-strip and dmesg notices when things are plugged and unplugged.

OK, well I hope this enough to adequately help you to troubleshoot with me. It would be VERY helpful. In the meantime, I will do some more research on the particular errors encountered in dmesg. I will write them out longhand and type them up and maybe post my tragedies on the forum post, in the hopes somebody will take pity on me.

A last ditch desperation would be to wipe the picore 9.0.3; start over with picore 11; load ALL the modules, 50 MB worth (Whoah! 800 MB for picore11/Linux-4.19.81 !) ; repeat the steps johannkraus listed about depmod, and persistency. and try again? But I don't really want to start over. I feel like I am close to success."

ladnar:
OK, I  think I have my head screwed on straight here. I put ALL of the drivers from the 4.9.22 modules zip file onto the piCore-9.0.3, soon-to-be-gadgetized micro-SD card.

I checked modules,dep ( in vi editor ), and it has 1559 entries; this is the same as if I opened up that file (taken straight from the 4.9.22 modules zipped file) on my laptop; 1559 lines.

The original modules.dep that comes with the 9.0.3 image is only like 180 lines.

There are 1900+ items in the 4.9.22 modules zip (or tar or xyz or whatever it was) file. Because I was using command line interface (I haven't figured out desktop TCZ stuff yet) I am not certain I left the original modules and structures in tact? I might have just overwritten the old modules with all the 1900+ QTY new modules? Do these 1900+ new modules need a special "implementation" command?

Anybody sensing any problems yet? I would like to think I am done with modprobe and depmod and dependency-searching and LKM-and-.ko "kernel stuff"?

johannkraus mentions
--- Quote ---after adding dwc2 overlay to config.txt and modprobe dwc2 in Raspbian there is another tty in dev -> ttyGS0.
--- End quote ---
and I stumbled across this link https://linux.die.net/sag/hwutils.html . I haven't digested / cogitated it yet?

I dunno. Lunchtime. Miore later, If I get motivated.

Rich:
Hi ladnar
There are kernel module extensions available. This is a list of extensions available for piCore 9:
http://tinycorelinux.net/9.x/armv6/tcz/info.lst
You can open the file in a web browser and search for  4.9.22  for the names of the kernel module extensions.

Or you can run these commands to see the names of the 18 extensions:

--- Code: ---tc@E310:~/zzz$ wget http://tinycorelinux.net/9.x/armv6/tcz/info.lst
--2020-10-01 16:36:03--  http://tinycorelinux.net/9.x/armv6/tcz/info.lst
Resolving tinycorelinux.net... 89.22.99.37
Connecting to tinycorelinux.net|89.22.99.37|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21994 (21K) [text/plain]
Saving to: 'info.lst'

info.lst                                               100%[==========================================================================================================================>]  21.48K  --.-KB/s    in 0.09s   

2020-10-01 16:36:03 (246 KB/s) - 'info.lst' saved [21994/21994]

tc@E310:~/zzz$ grep 4.9.22 info.lst
alsa-modules-4.9.22-piCore.tcz
ax25-4.9.22-piCore.tcz
bluetooth-4.9.22-piCore.tcz
filesystems-4.9.22-piCore.tcz
graphics-4.9.22-piCore.tcz
ipv6-4.9.22-piCore.tcz
net-bridging-4.9.22-piCore.tcz
netfilter-4.9.22-piCore.tcz
net-sched-4.9.22-piCore.tcz
net-usb-4.9.22-piCore.tcz
ppp-modules-4.9.22-piCore.tcz
raid-dm-4.9.22-piCore.tcz
rtc-4.9.22-piCore.tcz
usbip-4.9.22-piCore.tcz
usb-serial-4.9.22-piCore.tcz
v4l-dvb-4.9.22-piCore.tcz
w1-4.9.22-piCore.tcz
wireless-4.9.22-piCore.tcz
tc@E310:~/zzz$
--- End code ---

You might want to check if any of them contain the modules you need.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version