Just to make sure - as per the same manual you refer to, you first needed to "modprobe pch_udc" before loading the g_mass_storage one. You did that, didn't you?
Yes I did, but it keeps saying "can't load module g_mass_storage...: No such device"
Any idea that I can try ?
what Linux image are you using?
swpark, can you run the command "modprobe -l | grep g_mass" and post back the output please?
Thank you for answering.
Well, I got the g_mass_storage working by modifying .config when following "Basic Steps to Rebuild the Image" from Sergey's Blog - Malinov Family Web Presence
This is what I did.
- You can download the latest one from https://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=23197&lang=eng&wapkw=intel+quark+bsphttps://communities.intel.com/message/222895#222895
- And copy it to your build directory. In my case the file was named Board_Support_Package_Sources_for_Intel_Quark_v18.104.22.168z.
- Unzip the file:
7z x Board_Support_Package_Sources_for_Intel_Quark_v22.214.171.124z
- Unzip meta-clanton_v0.7.5.tar.gz:
tar xzvf meta-clanton_v1.0.0.tar.gz
- Change directory to meta-clanton_v1.0.0:
- Run setup.sh:
- Source poky/oe-init-build-env script, giving it the build directory (yocto_build) as a parameter:
source poky/oe-init-build-env yocto_build
Before you build, you might need to install additional linux packages: diffstat texinfo gawk chrpath autopoint autoconf automakesudo apt-get install diffstat texinfo gawk chrpath autopoint autoconf automake
bitbake linux-yocto-clanton -c menuconfig
(I added verbose debugging, see attached screeshot)
- Run bitbake to build the image:
- Note: image-full - SD card image, image-spi - SPI flash image.
- Wait several hours, and if everything goes well you'll get your image in tmp/deploy/images/ directory. It will include:
- The Linux kernel: bzImage--3.8-r0-clanton-YYYYMMDDhhmmss.bin (YYYYMMDDhhmmss - timestamp indicating the build start time)
- Initial RAM FS: core-image-minimal-initramfs-clanton-YYYYMMDDhhmmss.rootfs.cpio.gz
- File system image: image-full-clanton-YYYYMMDDhhmmss.rootfs.ext3
- Kernel modules: modules--3.8-r0-clanton-YYYYMMDDhhmmss.tgz (not really needed, they are already in the file system image)
- Grub configuration: boot/grub/grub.conf
- Copy these files to SD card renaming files as follows (resulting paths are relative to SD card's root):
- bzImage--3.8-r0-clanton-YYYYMMDDhhmmss.bin -> bzImage
- core-image-minimal-initramfs-clanton-YYYYMMDDhhmmss.rootfs.cpio.gz -> core-image-minimal-initramfs-clanton.cpio.gz
- image-full-clanton-YYYYMMDDhhmmss.rootfs.ext3 -> image-full-clanton.ext3
- boot/grub/grub.conf -> boot/grub/grub.conf
- Note that you can keep names or use different names for all files except of the image-full-clanton.ext3, and just update grub.conf with the correct names. The file system image must be named image-full-clanton.ext3 (initramfs will look for that) unless you update the configuration.
- Insert SD card to your Galileo board, reboot it.
- Once i reboot, and plug the USB cable into the other end(PC), then tried to copy many files and big size (600MB), and got following message from Galileo and PC keeps waiting.
Oct 17 09:54:03 clanton kern.debug kernel: [ 712.620340] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
Oct 17 09:54:03 clanton kern.debug kernel: [ 712.620744] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000002
Oct 17 09:54:03 clanton kern.debug kernel: [ 712.620826] mmc0: req done (CMD17): 0: 00000900 00000000 00000000 00000000
Oct 17 09:54:03 clanton kern.debug kernel: [ 712.620854] mmc0: 512 bytes transferred: 0
Oct 17 09:54:03 clanton kern.debug kernel: [ 712.621498] mmc0: starting CMD17 arg 000043c6 flags 000000b5
Oct 17 09:54:03 clanton kern.debug kernel: [ 712.621541] mmc0: blksz 512 blocks 1 flags 00000200 tsac 100 ms nsac 0
Oct 17 09:54:03 clanton kern.debug kernel: [ 712.621623] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
[ 942.522611] g_mass_storage gadget: full-speed config #1: Linux File-Backed Storage
[ 1024.267955] irq 41: nobody cared (try booting with the "irqpoll" option)
[ 1024.274713] Pid: 0, comm: swapper Not tainted 3.8.7-yocto-standard #1
[ 1024.277883] Call Trace:
[ 1024.277883] [<c106d324>] __report_bad_irq.isra.6+0x24/0xa0
[ 1024.277883] [<c11e16e2>] ? add_interrupt_randomness+0x132/0x160
[ 1024.277883] [<c106d562>] note_interrupt+0x162/0x1b0
[ 1024.277883] [<c1009017>] ? default_idle+0x17/0x30
[ 1024.277883] [<c106bb90>] handle_irq_event_percpu+0x70/0x140
[ 1024.277883] [<c12bef97>] ? printk+0x38/0x3a
[ 1024.277883] [<c106d670>] ? handle_simple_irq+0x50/0x50
[ 1024.277883] [<c106bc7c>] handle_irq_event+0x1c/0x30
[ 1024.277883] [<c106d6c2>] handle_edge_irq+0x52/0xd0
[ 1024.277883] <IRQ> [<c100401a>] ? do_IRQ+0x3a/0xb0
[ 1024.277883] [<c1046372>] ? hrtimer_start+0x22/0x30
[ 1024.277883] [<c12c37ec>] ? common_interrupt+0x2c/0x31
[ 1024.277883] [<c1009017>] ? default_idle+0x17/0x30
[ 1024.277883] [<c10097ff>] ? cpu_idle+0x4f/0x60
[ 1024.277883] [<c12bbb82>] ? rest_init+0x52/0x60
[ 1024.277883] [<c142e946>] ? start_kernel+0x2d5/0x2db
[ 1024.277883] [<c142e4a8>] ? repair_env_string+0x51/0x51
[ 1024.277883] [<c142e2d1>] ? i386_start_kernel+0x9b/0xa2
[ 1024.277883] handlers:
[ 1024.277883] [<e0694260>] pch_udc_isr [pch_udc]
[ 1024.277883] Disabling IRQ #41
root@clanton:/proc# more interrupts
0: 70 IO-APIC-edge timer
7: 1 IO-APIC-edge
8: 1 IO-APIC-edge rtc0
9: 0 IO-APIC-fasteoi acpi
16: 19561 IO-APIC-fasteoi mmc0, ohci_hcd:usb2
17: 10184 IO-APIC-fasteoi serial
19: 0 IO-APIC-fasteoi ehci_hcd:usb1
40: 2074 PCI-MSI-edge eth0
41: 200000 PCI-MSI-edge pch_udc
NMI: 0 Non-maskable interrupts
LOC: 25307 Local timer interrupts
SPU: 0 Spurious interrupts
PMI: 0 Performance monitoring interrupts
IWI: 0 IRQ work interrupts
RTR: 0 APIC ICR read retries
TRM: 0 Thermal event interrupts
THR: 0 Threshold APIC interrupts
MCE: 0 Machine check exceptions
MCP: 0 Machine check polls
root@clanton:/proc# cd /proc/irq/41
Would you give me some idea how to resolve this issue? I wonder if it's related to the hardware (Galileo), heard that there is a new version.
So you mean that after reconfiguring kernel you're now able to load the module and it somewhat works, but now you get a different error, the one related to the IRQ, is that correct?
Which kernel config options have you changed? I think it was more than just "verbose debugging" you listed, that one alone is unlikely to make the g_mass_storage load.
Yes. correct. g_mass_storage is working after I added some gadget modules, seems working. However, when copying bigger file (>600MB) and got debugging message.
I don't know much about the kernel configuration, but what I can tell is now, which file do you want to see? I found there are many .config files,
spark@k42:~/Downloads/meta-clanton_v1.0.0$ find . -name .config
I see. Let's see this one: ./yocto_build/tmp/sysroots/clanton/usr/src/kernel/.config
It may be the case that it's not Yocto- or Galileo-specific, what I'd suggest you to do is to look for g_mass_storage driver limitations and general operating conditions, maybe it's not intended for such big file transfers at all? That could help you to determinte the direction of further work - either within Yocto/Galileo (if it's specific to the board) or g_mass_storage driver itself (if it's not intended for such transfers).