SMatt

Members
  • Content count

    5
  • Joined

  • Last visited

About SMatt

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    Bologna
  • Interests
    ICT, Electronics, Embedded System
  1. I tried again to follow this guide for mass storage and seems that it works In particular after doing "insmod /mnt/g_mass_storage.ko file=/tmp/my_file " I receive the same messages as the guide but without the last line where udc bind to driver g_mass_storage. When i connect the board to the host I'm able to detect the device, so the devicetree and the peripheral configuration i think are good. After that I came back in menuconfig to set again the webcam gadget but it still doesn't work
  2. Hi, I tried different configuration for jumpers before to connect the boart but seems also there's no changes with both jumpers shorted/unshorted. I also have a particular message when I load the modules, sometimes i have this: zynq> insmod libcomposite.ko zynq> insmod videobuf2-vmalloc.ko zynq> insmod usb_f_fs.ko zynq> insmod usb_f_uvc.ko zynq> insmod g_webcam.ko g_webcam gadget: uvc_function_bind g_webcam gadget: Webcam Video Gadget g_webcam gadget: g_webcam ready and sometimes i have this: zynq> insmod libcomposite.ko zynq> insmod videobuf2-vmalloc.ko zynq> insmod usb_f_fs.ko zynq> insmod usb_f_uvc.ko zynq> insmod g_webcam.ko udc-core: couldn't find an available UDC - added [g_webcam] to list This message makes to think me that the boart is not setted to act as devices, but i have setted the dr_mode in the .dts file first in "peripheral" and then in "otg" but it still doesn't act as device when i generate de thevicetree and connect the OTG port to the host PC. (In attachment my zynq-zed.dts) When loading module complete successfully (first case) in /dev I don't see anything that can be linked with the gadget and sys/kernel/config is empty (I cannot find the configfs folder). After that i find this example and I tried to follow these instruction : https://wiki.tizen.org/wiki/USB/Linux_USB_Layers/Configfs_Composite_Gadget/Usage_eq._to_g_webcam.ko This is what i have: zynq> cd home zynq> ls default eth web zynq> cd web zynq> ls g_ffs.ko gadgetfs.ko usb_f_uvc.ko g_mass_storage.ko libcomposite.ko videobuf2-vmalloc.ko g_webcam.ko usb_f_fs.ko zynq> insmod libcomposite.ko zynq> insmod videobuf2-vmalloc.ko zynq> insmod usb_f_fs.ko zynq> insmod usb_f_uvc.ko zynq> insmod g_webcam.ko g_webcam gadget: uvc_function_bind g_webcam gadget: Webcam Video Gadget g_webcam gadget: g_webcam ready zynq> mount -t configfs none /sys/kernel/config / I copied this line from http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver to mount configfs zynq> cd /sys/kernel/config/usb_gadget zynq> mkdir g1 zynq> cd g1 zynq> mkdir configs/c.1 zynq> mkdir functions/uvc.usb0 zynq> mkdir strings/0x409 zynq> mkdir configs/c.1/strings/0x409 zynq> echo 0x3290 > idProduct zynq> echo 0x18ec > idVendor zynq> echo serial > strings/0x409/serialnumber zynq> echo manufacturer > strings/0x409/manufacturer zynq> echo UVC Gadget > strings/0x409/product zynq> echo "Conf 1" > configs/c.1/strings/0x409/configuration zynq> echo 120 > configs/c.1/MaxPower zynq> mkdir -p functions/uvc.usb0/streaming/uncompressed/u/360p zynq> cat <<EOF > functions/uvc.usb0/streaming/uncompressed/u/360p/dwF rameInterval > 666666 > 1000000 > 5000000 > EOF zynq> mkdir functions/uvc.usb0/streaming/header/h zynq> cd functions/uvc.usb0/streaming/header/h zynq> ln -s ../../uncompressed/u zynq> cd ../../class/fs zynq> ln -s ../../header/h zynq> cd ../../class/hs zynq> ln -s ../../header/h zynq> cd ../../../control zynq> mkdir header/h zynq> ln -s header/h class/fs zynq> ln -s header/h class/ss zynq> cd ../../../ zynq> echo 2048 > functions/uvc.usb0/streaming_maxpacket -/bin/ash: can't create functions/uvc.usb0/streaming_maxpacket: Permission denid zynq> ls UDC bMaxPacketSize0 functions strings bDeviceClass bcdDevice idProduct bDeviceProtocol bcdUSB idVendor bDeviceSubClass configs os_desc zynq> cd functions/uvc.usb0 zynq> ls aname aname aname control streaming zynq> echo 2048 > streaming_maxpaket -/bin/ash: can't create streaming_maxpaket: Permission denied zynq> cd streaming zynq> ls class color_matching header mjpeg uncompressed zynq> cd .. zynq> ls -a . .. aname aname aname control streaming zynq> mkdir streaming_maxpaket mkdir: can't create directory 'streaming_maxpaket': Operation not permitted zynq> echo 2048 > streaming_maxpaket -/bin/ash: can't create streaming_maxpaket: Permission denied zynq> ls aname aname aname control streaming zynq> cd .. zynq> ls uvc.usb0 zynq> echo 2048 > streaming_maxpaket -/bin/ash: can't create streaming_maxpaket: Permission denied zynq> cd .. zynq> ld -/bin/ash: ld: not found zynq> ls UDC bMaxPacketSize0 functions strings bDeviceClass bcdDevice idProduct bDeviceProtocol bcdUSB idVendor bDeviceSubClass configs os_desc zynq> echo 2048 > functions/uvc.usb0/streaming_maxpacket -/bin/ash: can't create functions/uvc.usb0/streaming_maxpacket: Permission denid zynq> I don't know why I can't finsh the procedure, I missed only two command to finish all procedure and to connect de gadget to UDC. About the libguvc, i seen this wonderful library but it's not opensource -.-" Yes, I tried the mass storage and the ethernet gadget but they don't work. At the end of configuration in mass storage, when I instert the last command i receive this: zynq> echo "ci_hdrc.0" > UDC ash: write error: No such device I also tryed the ethernet gadget but with same result, in this case i receive a permiss denied message when I insert: zynq> ln -s functions/rndis.rn0 configs/c1.1/ After all it still to have such problems to bind the gadget to the usb OTG. I don't know what it could be in different cases but I think that the main problem is that the kernel is unable to connect the gadget to the driver because the board is not in device mode :/ Sorry for my long reply, I'm trying to describe clearly my case to let you understand what i have. Thanks for your time!! zynq-zed.dts
  3. Hi @sbobrowicz, I've found the dependency!! Before to load the g_webcam.ko module I have to load other module first. This is what i have: U-Boot 2019 2017 - 12:21:04 +0200 Model:velopment Board Board: DRAM: ECC disabled 51MMC: hci@e010000: 0 (SD) ected s25fl256s_64k with page size 256 Bytes, erase size 64 KiB, total 64 MiB *** Warning - bad CRC, using default environment In: serial@e0001000 Out: serial@e0001000 Err: serial@e0001000 Model: Zynq Zed Development Board Board: Xilinx Zynq Net: ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id eth0: ethernet@e000b000 Hit any key to stop autoboot: 0 Zynq> TE1 E0 nknown command 'TE1' - try 'help' Zynq> ~x�~ Unknown command '~' - try 'help' Zynq> boot Device: sdhci@e0100000 Manufacturer ID: 1 OEM: 5041 Name: SR02G Tran Speed: 25000000 Rd Block Len: 512 SD version 1.0 High Capacity: No Capacity: 1.9 GiB Bus Width: 4-bit Erase Group Size: 512 Bytes reading uEnv.txt ** Unable to read file uEnv.txt ** Copying Linux from SD to RAM... reading uImage 3619840 bytes read in 616 ms (5.6 MiB/s) reading devicetree.dtb 9887 bytes read in 17 ms (567.4 KiB/s) reading uramdisk.image.gz 5429919 bytes read in 924 ms (5.6 MiB/s) ## Booting kernel from Legacy Image at 02080000 ... Image Name: Linux-4.9.0-xilinx-25595-g68e686 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3619776 Bytes = 3.5 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK ## Loading init Ramdisk from Legacy Image at 04000000 ... Image Name: Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 5429855 Bytes = 5.2 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 02000000 Booting using the fdt blob at 0x2000000 Loading Kernel Image ... OK Loading Ramdisk to 1e5f5000, end 1eb22a5f ... OK Loading Device Tree to 1e5ef000, end 1e5f469e ... OK Starting kernel ... Booting Linux on physical CPU 0x0 Linux version 4.9.0-xilinx-25595-g68e6869-dirty (rapper@rapper-HP-Pavilion-dv6-7 CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache OF: fdt:Machine model: Zynq Zed Development Board cma: Reserved 16 MiB at 0x1f000000 Memory policy: Data cache writealloc percpu: Embedded 14 pages/cpu @debcb000 s25932 r8192 d23220 u57344 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048 Kernel command line: PID hash table entries: 2048 (order: 1, 8192 bytes) Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Memory: 489252K/524288K available (5120K kernel code, 185K rwdata, 1408K rodata) Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xe0800000 - 0xff800000 ( 496 MB) lowmem : 0xc0000000 - 0xe0000000 ( 512 MB) pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB) modules : 0xbf000000 - 0xbfe00000 ( 14 MB) .text : 0xc0008000 - 0xc0600000 (6112 kB) .init : 0xc0800000 - 0xc0900000 (1024 kB) .data : 0xc0900000 - 0xc092e4c0 ( 186 kB) .bss : 0xc092e4c0 - 0xc0967698 ( 229 kB) Preemptible hierarchical RCU implementation. Build-time adjustment of leaf fanout to 32. RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2. RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2 NR_IRQS:16 nr_irqs:16 16 efuse mapped to e0800000 slcr mapped to e0802000 L2C: platform modifies aux control register: 0x72360000 -> 0x72760000 L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000 L2C-310 erratum 769419 enabled L2C-310 enabling early BRESP for Cortex-A9 L2C-310 full line of zeros enabled for Cortex-A9 L2C-310 ID prefetch enabled, offset 1 lines L2C-310 dynamic clock gating enabled, standby mode enabled L2C-310 cache controller enabled, 8 ways, 512 kB L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001 zynq_clock_init: clkc starts at e0802100 Zynq clock init sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af02s Switching to timer-based delay loop, resolution 3ns clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537s timer #0 at e080a000, irq=17 Console: colour dummy device 80x30 console [tty0] enabled Calibrating delay loop (skipped), value calculated using timer frequency.. 666.) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) CPU: Testing write buffer coherency: ok CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 Setting up static identity map for 0x100000 - 0x100058 CPU1: thread -1, cpu 1, socket 0, mpidr 80000001 Brought up 2 CPUs SMP: Total of 2 processors activated (1333.33 BogoMIPS). CPU: All CPU(s) started in SVC mode. devtmpfs: initialized VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4 clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 191s pinctrl core: initialized pinctrl subsystem NET: Registered protocol family 16 DMA: preallocated 256 KiB pool for atomic coherent allocations cpuidle: using governor menu hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers. hw-breakpoint: maximum watchpoint size is 4 bytes. zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0840000 zynq-pinctrl 700.pinctrl: zynq pinctrl initialized vgaarb: loaded SCSI subsystem initialized media: Linux media interface: v0.10 Linux video capture interface: v2.00 pps_core: LinuxPPS API ver. 1 registered pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@> PTP clock support registered EDAC MC: Ver: 3.0.0 FPGA manager framework fpga-region fpga-full: FPGA Region probed Advanced Linux Sound Architecture Driver Initialized. clocksource: Switched to clocksource arm_global_timer NET: Registered protocol family 2 TCP established hash table entries: 4096 (order: 2, 16384 bytes) TCP bind hash table entries: 4096 (order: 3, 32768 bytes) TCP: Hash tables configured (established 4096 bind 4096) UDP hash table entries: 256 (order: 1, 8192 bytes) UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) NET: Registered protocol family 1 RPC: Registered named UNIX socket transport module. RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. Trying to unpack rootfs image as initramfs... rootfs image is not initramfs (no cpio magic); looks like an initrd Freeing initrd memory: 5304K (de5f5000 - deb23000) hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available futex hash table entries: 512 (order: 3, 32768 bytes) workingset: timestamp_bits=30 max_order=17 bucket_order=0 jffs2: version 2.2. (NAND) (SUMMARY) �𩩩 2001-2006 Red Hat, Inc. io scheduler noop registered io scheduler deadline registered io scheduler cfq registered (default) dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330 dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Eve6 e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 143, base_baud = 3125000) is s console [ttyPS0] enabled [drm] Initialized brd: module loaded loop: module loaded libphy: Fixed MDIO Bus: probed CAN device driver interface libphy: MACB_mii_bus: probed macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 () Marvell 88E1510 e000b000.etherne:00: attached PHY driver [Marvell 88E1510] (mii) e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k e1000e: Copyright(c) 1999 - 2015 Intel Corporation. ULPI transceiver vendor/product ID 0x0451/0x1507 Found TI TUSB1210 ULPI transceiver. ULPI integrity check: passed. mousedev: PS/2 mouse device common for all mice i2c /dev entries driver EDAC MC: ECC not enabled Xilinx Zynq CpuIdle Driver started sdhci: Secure Digital Host Controller Interface driver sdhci: Copyright(c) Pierre Ossman sdhci-pltfm: SDHCI platform and OF driver helper mmc0: Invalid maximum block size, assuming 512 bytes mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA ledtrig-cpu: registered to indicate activity on CPUs fpga_manager fpga0: Xilinx Zynq FPGA Manager registered NET: Registered protocol family 10 sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver NET: Registered protocol family 17 can: controller area network core (rev 20120528 abi 9) NET: Registered protocol family 29 can: raw protocol (rev 20120528) can: broadcast manager protocol (rev 20161123 t) can: netlink gateway (rev 20130117) max_hops=1 Registering SWP/SWPB emulation handler hctosys: unable to open rtc device (rtc0) of_cfs_init of_cfs_init: OK ALSA device list: No soundcards found. RAMDISK: gzip image found at block 0 mmc0: new SD card at address 7e47 mmcblk0: mmc0:7e47 SR02G 1.88 GiB mmcblk0: p1 p2 EXT4-fs (ram0): couldn't mount as ext3 due to feature incompatibilities EXT4-fs (ram0): mounted filesystem without journal. Opts: (null) VFS: Mounted root (ext4 filesystem) on device 1:0. Starting rcS... ++ Mounting filesystem mount: mounting /dev/mmcblk0p1 on /mnt failed: No such file or directory mount: mounting /dev/mmcblk0 on /mnt failed: No such file or directory ++ Setting up mdev ++ Starting telnet daemon ++ Starting http daemon ++ Starting ftp daemon ++ Starting ssh daemon random: sshd: uninitialized urandom read (32 bytes read) rcS Complete zynq> cd home zynq> ls default g_webcam.ko usb_f_fs.ko g_ffs.ko gadgetfs.ko usb_f_uvc.ko g_mass_storage.ko libcomposite.ko videobuf2-vmalloc.ko zynq> insmod libcomposite.ko zynq> insmod videobuf2-vmalloc.ko zynq> insmod usb_f_fs.ko zynq> insmod usb_f_uvc.ko zynq> insmod g_webcam.ko g_webcam gadget: uvc_function_bind g_webcam gadget: Webcam Video Gadget g_webcam gadget: g_webcam ready zynq> After all, it seems that the gadget is created but it still not bind to driver and obiviously when i try to connect the boart to the host, nothing happen :/ Thanks for reply! -Mattia
  4. Hi guys, thank for your reply. Thanks @jpeyron, hope some linux expert read this post and help me. Hi @sbobrowicz,I'm following this question in xilinx forum (I am mattsini1 in xilinx forum) and I'm still waiting for reply from nicothenico. I also set dr_mode to "peripheral" in my device tree because it supports only three value as i read in wiki xilinx: Mode Value of dr_mode host host device peripheral OTG otg I also tried to set the parameters to 'M' in menuconfig but I see that in fs/configfs the configfs.ko module still not generate.
  5. Hi all, I'm new in this world and I hope someone could help me in this issue I'm working on a project in the Uniersity where I would like to use the Zedboard as UVC device to stream video from FPGA to the host. I'm able to build, configure and run the kernel from SD but I'm having some problem to connect the Zedboard as peripheral mode and to detect it as UVC gadget. In particular I've configured the kernel to act in peripheral mode following this instruction : http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver To let the Zedboard act as gadget I started from this guide and then I configured the kernel for USB Webcam gadget enabling these option: <*> USB functions configurable through configfs [*] USB Webcam function <*> USB Gadget Drivers (USB Webcam Gadget) At the end of building kernel process I have the g_webcam.ko and the libcomposite.ko modules. After that I boot the linux on the Zedboard and I tried to load the modules with insmod command but having this issue: Welcome to Linaro 12.11 (GNU/Linux 4.9.0-xilinx-25595-g68e6869-dirty armv7l) * Documentation: https://wiki.linaro.org/ root@linaro-ubuntu-desktop:~# cd / root@linaro-ubuntu-desktop:/# ls bin dev home lost+found mnt proc run selinux sys usr boot etc lib media opt root sbin srv tmp var root@linaro-ubuntu-desktop:/# cd home root@linaro-ubuntu-desktop:/home# cd linaro root@linaro-ubuntu-desktop:/home/linaro# ls examples.desktop g_webcam.ko g_zero.ko libcomposite.ko root@linaro-ubuntu-desktop:/home/linaro# insmod libcomposite.ko root@linaro-ubuntu-desktop:/home/linaro# insmod g_webcam.ko insmod: error inserting 'g_webcam.ko': -1 Unknown symbol in module root@linaro-ubuntu-desktop:/home/linaro# I also tried to connect the Zedboard to a Windows host and obviously nothing succeed. Could someone help me please? Thanks. -Mattia