espressif / esp-hosted

Hosted Solution (Linux/MCU) with ESP32 (Wi-Fi + BT + BLE)
Other
667 stars 151 forks source link

ESP32c3 doesn't work when docker image is there in yocto #199

Closed meera1310 closed 1 year ago

meera1310 commented 1 year ago

ESP32c3 was working fine in my yocto image. When I added docker service in my image then as soon as I run this command insmod esp32_spi.ko resetpin=297 my board goes into kernel panic mode

mantriyogesh commented 1 year ago

Okay. Thank you for explaining scenario.

  1. Can you please run tail -F /var/log/kern.log in seperate terminal and load the module in other terminal and get back both the logs?
  2. Same time, esp logs
  3. What is the libux platform/board you are using? Kernel version?
meera1310 commented 1 year ago

Processor: smarc-rzg2lc Kernel: 5.10.83-cip1+gitAUTOINC+e52825e45b Docker version 19.03.8-ce, build afacb8b7f0 esp32c3 side logs.odt module insert logs.odt

mantriyogesh commented 1 year ago
  1. Please let us know output of:

    $ cat init_script.sh

    init_script here should be very similar to rpi_init.sh.

  2. Also, I am not understanding if the crash is in minicom or in the module. Can you please run

    $ tail -F /var/log/kern.log &

    in separate terminal (different from console window) and minicom in another (again different than console) and get us all 4 window outputs (esp minicom, /var/log/kern.log, commands run terminal log, console log)

meera1310 commented 1 year ago

root@oldsilicon:~# cat esp32c3/init_script.sh mkdir /sys/kernel/config/device-tree/overlays/spi_driver

Disable default spidev driver

dtc spidev_disabler.dts -O dtb > spidev_disabler.dtbo cat spidev_disabler.dtbo > /sys/kernel/config/device-tree/overlays/spi_driver/dtbo insmod esp32_spi.ko resetpin=297

mknod /dev/esps0 c 221 0 chmod 666 /dev/esps0

root@oldsilicon:~# tail: cannot open `/var/log/kern.log' for reading: No such file or directory

mantriyogesh commented 1 year ago

Just rewriting the response with correct formatting:

root@oldsilicon:~# cat esp32c3/init_script.sh 
mkdir /sys/kernel/config/device-tree/overlays/spi_driver
# Disable default spidev driver
dtc spidev_disabler.dts -O dtb > spidev_disabler.dtbo
cat spidev_disabler.dtbo > /sys/kernel/config/device-tree/overlays/spi_driver/dtbo
insmod esp32_spi.ko resetpin=297

mknod /dev/esps0 c 221 0
chmod 666 /dev/esps0
mantriyogesh commented 1 year ago
  1. Where do you do steps mentioned in rpi_init.sh?

Like a. removing existing module, serial driver https://github.com/espressif/esp-hosted/blob/3769eea28bbbc59d8ea2aff425d62564b7fb3e68/esp_hosted_fg/host/linux/host_control/rpi_init.sh#L46-L53

b. https://github.com/espressif/esp-hosted/blob/3769eea28bbbc59d8ea2aff425d62564b7fb3e68/esp_hosted_fg/host/linux/host_control/rpi_init.sh#L169-L172

and remaining others.

Please port rpi_init.sh correctly for your platform. You will end up in issues similar to this if you bypass.

  1. Any of /var/log/messages or /var/log/syslog or /var/log/kern.log If nothing there, clean console log will be appreciated.. Need to get clear log, otherwise cannot understand the scenario for crash
meera1310 commented 1 year ago

root@oldsilicon:~# dmesg [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x412fd050] [ 0.000000] Linux version 5.10.83-cip1-yocto-standard (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 8.3.0, GNU ld (GNU Binutils) 2.31.1) #1 SMP PREEMPT Sat Feb 27 02:21:18 UTC 2021 [ 0.000000] Machine model: Renesas SMARC EVK based on r9a07g044c2 [ 0.000000] efi: UEFI not found. [ 0.000000] Reserved memory: created CMA memory pool at 0x0000000058000000, size 256 MiB [ 0.000000] OF: reserved mem: initialized node linux,cma@58000000, compatible id shared-dma-pool [ 0.000000] Reserved memory: created CMA memory pool at 0x0000000068000000, size 128 MiB [ 0.000000] OF: reserved mem: initialized node linux,multimedia, compatible id shared-dma-pool [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000048000000-0x00000000bfffffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000048000000-0x00000000bfffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000048000000-0x00000000bfffffff] [ 0.000000] On node 0 totalpages: 491520 [ 0.000000] DMA zone: 7680 pages used for memmap [ 0.000000] DMA zone: 0 pages reserved [ 0.000000] DMA zone: 491520 pages, LIFO batch:63 [ 0.000000] psci: probing for conduit method from DT. [ 0.000000] psci: PSCIv1.1 detected in firmware. [ 0.000000] psci: Using standard PSCI v0.2 function IDs [ 0.000000] psci: MIGRATE_INFO_TYPE not supported. [ 0.000000] psci: SMC Calling Convention v1.2 [ 0.000000] percpu: Embedded 23 pages/cpu s55576 r8192 d30440 u94208 [ 0.000000] pcpu-alloc: s55576 r8192 d30440 u94208 alloc=23*4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [ 0.000000] Detected VIPT I-cache on CPU0 [ 0.000000] CPU features: detected: GIC system register CPU interface [ 0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 483840 [ 0.000000] Kernel command line: root=/dev/mmcblk1p2 rootwait [ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 1511420K/1966080K available (13632K kernel code, 1112K rwdata, 3876K rodata, 2176K init, 431K bss, 61444K reserved, 393216K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU event tracing is enabled. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2 [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] GICv3: 480 SPIs implemented [ 0.000000] GICv3: 0 Extended SPIs implemented [ 0.000000] GICv3: Distributor has no Range Selector support [ 0.000000] GICv3: 16 PPIs implemented [ 0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000011940000 [ 0.000000] random: get_random_bytes called from start_kernel+0x318/0x4c8 with crng_init=0 [ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns [ 0.000004] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns [ 0.000130] Console: colour dummy device 80x25 [ 0.000512] printk: console [tty0] enabled [ 0.000549] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000) [ 0.000573] pid_max: default: 32768 minimum: 301 [ 0.000710] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.000734] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.002294] rcu: Hierarchical SRCU implementation. [ 0.002851] Detected Renesas RZ/G2L r9a07g044 [ 0.003079] EFI services will not be available. [ 0.003328] smp: Bringing up secondary CPUs ... [ 0.003797] Detected VIPT I-cache on CPU1 [ 0.003838] GICv3: CPU1: found redistributor 100 region 0:0x0000000011960000 [ 0.003890] CPU1: Booted secondary processor 0x0000000100 [0x412fd050] [ 0.004100] smp: Brought up 1 node, 2 CPUs [ 0.004113] SMP: Total of 2 processors activated. [ 0.004127] CPU features: detected: Privileged Access Never [ 0.004138] CPU features: detected: LSE atomic instructions [ 0.004149] CPU features: detected: User Access Override [ 0.004161] CPU features: detected: 32-bit EL0 Support [ 0.004171] CPU features: detected: Common not Private translations [ 0.004183] CPU features: detected: Data cache clean to the PoU not required for I/D coherence [ 0.004197] CPU features: detected: CRC32 instructions [ 0.004207] CPU features: detected: Speculative Store Bypassing Safe (SSBS) [ 0.004220] CPU features: detected: 32-bit EL1 Support [ 0.023173] CPU: All CPU(s) started at EL1 [ 0.023252] alternatives: patching kernel code [ 0.025694] devtmpfs: initialized [ 0.030910] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.030963] futex hash table entries: 512 (order: 3, 32768 bytes, linear) [ 0.040053] pinctrl core: initialized pinctrl subsystem [ 0.040893] DMI not present or invalid. [ 0.041218] NET: Registered protocol family 16 [ 0.042626] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations [ 0.042778] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.042930] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.043068] audit: initializing netlink subsys (disabled) [ 0.043362] audit: type=2000 audit(0.040:1): state=initialized audit_enabled=0 res=1 [ 0.043866] thermal_sys: Registered thermal governor 'step_wise' [ 0.044175] cpuidle: using governor menu [ 0.044324] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 0.044401] ASID allocator initialised with 65536 entries [ 0.069062] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages [ 0.069099] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages [ 0.069113] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages [ 0.069126] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages [ 0.070940] cryptd: max_cpu_qlen set to 1000 [ 0.140892] raid6: neonx8 gen() 2132 MB/s [ 0.208953] raid6: neonx8 xor() 1640 MB/s [ 0.277032] raid6: neonx4 gen() 2195 MB/s [ 0.345096] raid6: neonx4 xor() 1632 MB/s [ 0.413196] raid6: neonx2 gen() 2093 MB/s [ 0.481262] raid6: neonx2 xor() 1494 MB/s [ 0.549355] raid6: neonx1 gen() 1805 MB/s [ 0.617430] raid6: neonx1 xor() 1255 MB/s [ 0.685520] raid6: int64x8 gen() 1512 MB/s [ 0.753601] raid6: int64x8 xor() 772 MB/s [ 0.821690] raid6: int64x4 gen() 1640 MB/s [ 0.889782] raid6: int64x4 xor() 837 MB/s [ 0.957847] raid6: int64x2 gen() 1487 MB/s [ 1.025899] raid6: int64x2 xor() 752 MB/s [ 1.094001] raid6: int64x1 gen() 1142 MB/s [ 1.162058] raid6: int64x1 xor() 557 MB/s [ 1.162070] raid6: using algorithm neonx4 gen() 2195 MB/s [ 1.162080] raid6: .... xor() 1632 MB/s, rmw enabled [ 1.162091] raid6: using neon recovery algorithm [ 1.165507] iommu: Default domain type: Translated [ 1.166329] vgaarb: loaded [ 1.166692] SCSI subsystem initialized [ 1.166949] libata version 3.00 loaded. [ 1.167133] usbcore: registered new interface driver usbfs [ 1.167195] usbcore: registered new interface driver hub [ 1.167234] usbcore: registered new device driver usb [ 1.167870] mc: Linux media interface: v0.10 [ 1.167907] videodev: Linux video capture interface: v2.00 [ 1.167977] pps_core: LinuxPPS API ver. 1 registered [ 1.167989] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it [ 1.168014] PTP clock support registered [ 1.168653] renesas_mtu3 10001200.timer: ch0: used as clock source [ 1.168673] clocksource: 10001200.timer: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 18664368 ns [ 1.168723] renesas_mtu3 10001200.timer: ch1: used for clock events [ 1.168752] renesas_mtu3 10001200.timer: Renesas MTU3 driver probed [ 1.169621] Advanced Linux Sound Architecture Driver Initialized. [ 1.170100] Bluetooth: Core ver 2.22 [ 1.170193] NET: Registered protocol family 31 [ 1.170205] Bluetooth: HCI device and connection manager initialized [ 1.170223] Bluetooth: HCI socket layer initialized [ 1.170237] Bluetooth: L2CAP socket layer initialized [ 1.170258] Bluetooth: SCO socket layer initialized [ 1.170652] clocksource: Switched to clocksource arch_sys_counter [ 1.170882] VFS: Disk quotas dquot_6.6.0 [ 1.170953] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 1.176568] NET: Registered protocol family 2 [ 1.176792] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 1.177934] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear) [ 1.177989] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear) [ 1.178103] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear) [ 1.178378] TCP: Hash tables configured (established 16384 bind 16384) [ 1.178545] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear) [ 1.178593] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear) [ 1.178930] NET: Registered protocol family 1 [ 1.179393] RPC: Registered named UNIX socket transport module. [ 1.179420] RPC: Registered udp transport module. [ 1.179431] RPC: Registered tcp transport module. [ 1.179441] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 1.180209] PCI: CLS 0 bytes, default 64 [ 1.180899] kvm [1]: HYP mode not available [ 1.182393] Initialise system trusted keyrings [ 1.182618] workingset: timestamp_bits=46 max_order=19 bucket_order=0 [ 1.188455] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 1.189157] NFS: Registering the id_resolver key type [ 1.189204] Key type id_resolver registered [ 1.189215] Key type id_legacy registered [ 1.189304] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 1.189329] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering... [ 1.189363] jffs2: version 2.2. (NAND) \xc2\xa9 2001-2006 Red Hat, Inc. [ 1.226681] xor: measuring software checksum speed [ 1.231056] 8regs : 2281 MB/sec [ 1.234475] 32regs : 2887 MB/sec [ 1.238506] arm64_neon : 2451 MB/sec [ 1.238517] xor: using function: 32regs (2887 MB/sec) [ 1.238539] Key type asymmetric registered [ 1.238550] Asymmetric key parser 'x509' registered [ 1.238615] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244) [ 1.238783] io scheduler mq-deadline registered [ 1.238800] io scheduler kyber registered [ 1.240885] poeg-rzg2l 10049400.poegd: RZ/G2L POEG Driver probed [ 1.280208] SuperH (H)SCI(F) driver initialized [ 1.292122] loop: module loaded [ 1.294281] libphy: Fixed MDIO Bus: probed [ 1.295002] tun: Universal TUN/TAP device driver, 1.6 [ 1.295251] CAN device driver interface [ 1.295576] e1000e: Intel(R) PRO/1000 Network Driver [ 1.295589] e1000e: Copyright(c) 1999 - 2015 Intel Corporation. [ 1.295888] usbcore: registered new interface driver asix [ 1.295952] usbcore: registered new interface driver ax88179_178a [ 1.295993] usbcore: registered new interface driver cdc_ether [ 1.296028] usbcore: registered new interface driver net1080 [ 1.296061] usbcore: registered new interface driver cdc_subset [ 1.296098] usbcore: registered new interface driver zaurus [ 1.296140] usbcore: registered new interface driver simcom_wwan [ 1.296181] usbcore: registered new interface driver cdc_ncm [ 1.296398] VFIO - User Level meta-driver version: 0.3 [ 1.296635] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 1.296653] ehci-pci: EHCI PCI platform driver [ 1.296710] ehci-platform: EHCI generic platform driver [ 1.297377] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 1.297431] ohci-pci: OHCI PCI platform driver [ 1.297496] ohci-platform: OHCI generic platform driver [ 1.298400] usbcore: registered new interface driver usb-storage [ 1.298515] usbcore: registered new interface driver cp210x [ 1.298546] usbserial: USB Serial support registered for cp210x [ 1.298584] usbcore: registered new interface driver option [ 1.298610] usbserial: USB Serial support registered for GSM modem (1-port) [ 1.299209] renesas_usbhs 11c60000.usb: host probed [ 1.299233] renesas_usbhs 11c60000.usb: no transceiver found [ 1.299371] renesas_usbhs 11c60000.usb: gadget probed [ 1.299478] renesas_usbhs 11c60000.usb: platform init failed. [ 1.299615] renesas_usbhs 11c60000.usb: probe failed (-517) [ 1.300275] usbcore: registered new interface driver usbtouchscreen [ 1.300336] i2c /dev entries driver [ 1.304339] rzg2l-csi2 10830400.csi2: 2 lanes found [ 1.340793] device-mapper: ioctl: 4.43.0-ioctl (2020-10-01) initialised: dm-devel@redhat.com [ 1.372084] ledtrig-cpu: registered to indicate activity on CPUs [ 1.372128] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping .... [ 1.372614] clocksource: timer@12801400: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns [ 1.372650] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 21474836475ns [ 1.372676] /soc/timer@12801400: used for clocksource [ 1.373054] /soc/timer@12801800: used for clock events [ 1.373736] usbcore: registered new interface driver usbhid [ 1.373753] usbhid: USB HID core driver [ 1.375429] spi-nor spi0.0: mt25qu512a (65536 Kbytes) [ 1.376011] 5 fixed-partitions partitions found on MTD device spi0.0 [ 1.376041] Creating 5 MTD partitions on "spi0.0": [ 1.376057] 0x000000000000-0x000000080000 : "u-boot" [ 1.377345] 0x000000080000-0x0000000c0000 : "env" [ 1.378486] 0x0000000c0000-0x000000100000 : "dtb" [ 1.383406] 0x000000800000-0x000001800000 : "rootfs" [ 1.387384] 0x000002000000-0x000002100000 : "test-area" [ 1.391227] IPVS: Registered protocols (TCP, UDP) [ 1.391310] IPVS: Connection hash table configured (size=4096, memory=64Kbytes) [ 1.391538] IPVS: ipvs loaded. [ 1.391556] IPVS: [rr] scheduler registered. [ 1.391826] Initializing XFRM netlink socket [ 1.392247] NET: Registered protocol family 10 [ 1.393129] Segment Routing with IPv6 [ 1.393248] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver [ 1.393749] NET: Registered protocol family 17 [ 1.393828] Bridge firewalling registered [ 1.393841] can: controller area network core [ 1.393898] NET: Registered protocol family 29 [ 1.393911] can: raw protocol [ 1.393925] can: broadcast manager protocol [ 1.393940] can: netlink gateway - max_hops=1 [ 1.394103] Key type dns_resolver registered [ 1.394508] registered taskstats version 1 [ 1.394527] Loading compiled-in X.509 certificates [ 1.395605] Btrfs loaded, crc32c=crc32c-generic [ 1.403451] thermal emergency: not set value [ 1.405631] gpio-265 (gpio_sd0_pwr_en): hogged as output/high [ 1.405679] gpio-442 (gpio_sd0_dev_sel): hogged as output/high [ 1.405709] gpio-434 (sd1_pwr_en): hogged as output/high [ 1.406425] pinctrl-rzg2l 11030000.pin-controller: pinctrl-rzg2l support registered [ 1.409666] 1004b800.serial: ttySC0 at MMIO 0x1004b800 (irq = 64, base_baud = 0) is a scif [ 2.792921] printk: console [ttySC0] enabled [ 2.798211] 1004bc00.serial: ttySC1 at MMIO 0x1004bc00 (irq = 69, base_baud = 0) is a scif [ 2.808864] renesas_spi 1004b000.spi: DMA available [ 2.814349] ------------[ cut here ]------------ [ 2.819000] /soc/spi@1004b000/spidev@1: buggy DT: spidev listed directly in DT [ 2.826262] WARNING: CPU: 0 PID: 97 at drivers/spi/spidev.c:742 spidev_probe+0xf8/0x1d0 [ 2.834235] Modules linked in: [ 2.837284] CPU: 0 PID: 97 Comm: kworker/0:8 Not tainted 5.10.83-cip1-yocto-standard #1 [ 2.845253] Hardware name: Renesas SMARC EVK based on r9a07g044c2 (DT) [ 2.851761] Workqueue: events deferred_probe_work_func [ 2.856881] pstate: 60c00005 (nZCv daif +PAN +UAO -TCO BTYPE=--) [ 2.862861] pc : spidev_probe+0xf8/0x1d0 [ 2.866766] lr : spidev_probe+0xf8/0x1d0 [ 2.870668] sp : ffff8000119eb7a0 [ 2.873966] x29: ffff8000119eb7a0 x28: ffff00000a9e0800 [ 2.879258] x27: 0000000000000001 x26: ffff00000999d900 [ 2.884549] x25: 0000000000000008 x24: ffff8000114160e0 [ 2.889840] x23: ffff80001140ffe0 x22: 0000000000000000 [ 2.895131] x21: ffff00000a9e1000 x20: ffff00000a9e1000 [ 2.900421] x19: 0000000000000000 x18: 0000000000000010 [ 2.905712] x17: 0000000000000001 x16: 0000000000000019 [ 2.911002] x15: 0000000000000106 x14: ffff8000119eb460 [ 2.916293] x13: 00000000ffffffea x12: ffff8000113e5768 [ 2.921583] x11: 0000000000000003 x10: ffff8000113cd728 [ 2.926873] x9 : ffff8000113cd780 x8 : 0000000000017fe8 [ 2.932164] x7 : c0000000ffffefff x6 : 0000000000000001 [ 2.937454] x5 : 0000000000057fa8 x4 : 0000000000000000 [ 2.942745] x3 : 00000000ffffffff x2 : ffff8000113756f8 [ 2.948035] x1 : c5227baf23a4ef00 x0 : 0000000000000000 [ 2.953327] Call trace: [ 2.955762] spidev_probe+0xf8/0x1d0 [ 2.959323] spi_drv_probe+0x84/0xe8 [ 2.962883] really_probe+0xec/0x3c8 [ 2.966442] driver_probe_device+0x58/0xb8 [ 2.970520] device_attach_driver+0x84/0xc8 [ 2.974857] bus_for_each_drv+0x7c/0xd0 [ 2.978675] device_attach+0xe8/0x148 [ 2.982492] device_initial_probe+0x14/0x20 [ 2.986657] bus_probe_device+0x9c/0xa8 [ 2.990475] device_add+0x3c8/0x718 [ 2.993948] spi_add_device+0xbc/0x1a8 [ 2.997681] of_register_spi_device+0x1f4/0x398 [ 3.002192] spi_register_controller+0x43c/0x790 [ 3.006789] devm_spi_register_controller+0x44/0xa0 [ 3.011645] rspi_probe+0x2fc/0x558 [ 3.015118] platform_drv_probe+0x54/0xa8 [ 3.019108] really_probe+0xec/0x3c8 [ 3.022667] driver_probe_device+0x58/0xb8 [ 3.026744] device_attach_driver+0x84/0xc8 [ 3.031082] bus_for_each_drv+0x7c/0xd0 [ 3.034899] device_attach+0xe8/0x148 [ 3.038717] device_initial_probe+0x14/0x20 [ 3.042881] bus_probe_device+0x9c/0xa8 [ 3.046700] deferred_probe_work_func+0x88/0xc0 [ 3.051213] process_one_work+0x1e8/0x360 [ 3.055204] worker_thread+0x210/0x480 [ 3.058937] kthread+0x154/0x158 [ 3.062152] ret_from_fork+0x10/0x34 [ 3.065711] ---[ end trace 4ffbb315719ff6b3 ]--- [ 3.070567] renesas_spi 1004b000.spi: probed [ 3.075761] ravb 11c20000.ethernet: no valid MAC address supplied, using a random one [ 3.083963] libphy: ravb_mii: probed [ 3.089359] ravb 11c20000.ethernet eth0: Base address at 0x11c20000, 8e:01:a1:44:21:8f, IRQ 160. [ 3.126686] ehci-platform 11c50100.usb: EHCI Host Controller [ 3.132387] ehci-platform 11c50100.usb: new USB bus registered, assigned bus number 1 [ 3.140314] ehci-platform 11c50100.usb: irq 165, io mem 0x11c50100 [ 3.158662] ehci-platform 11c50100.usb: USB 2.0 started, EHCI 1.10 [ 3.165476] hub 1-0:1.0: USB hub found [ 3.169263] hub 1-0:1.0: 1 port detected [ 3.174137] ehci-platform 11c70100.usb: EHCI Host Controller [ 3.179845] ehci-platform 11c70100.usb: new USB bus registered, assigned bus number 2 [ 3.187749] ehci-platform 11c70100.usb: irq 166, io mem 0x11c70100 [ 3.206663] ehci-platform 11c70100.usb: USB 2.0 started, EHCI 1.10 [ 3.213460] hub 2-0:1.0: USB hub found [ 3.217251] hub 2-0:1.0: 1 port detected [ 3.222048] ohci-platform 11c50000.usb: Generic Platform OHCI controller [ 3.228794] ohci-platform 11c50000.usb: new USB bus registered, assigned bus number 3 [ 3.236745] ohci-platform 11c50000.usb: irq 163, io mem 0x11c50000 [ 3.333306] hub 3-0:1.0: USB hub found [ 3.337100] hub 3-0:1.0: 1 port detected [ 3.341913] ohci-platform 11c70000.usb: Generic Platform OHCI controller [ 3.348649] ohci-platform 11c70000.usb: new USB bus registered, assigned bus number 4 [ 3.356597] ohci-platform 11c70000.usb: irq 164, io mem 0x11c70000 [ 3.453310] hub 4-0:1.0: USB hub found [ 3.457108] hub 4-0:1.0: 1 port detected [ 3.461911] renesas_usbhs 11c60000.usb: host probed [ 3.466832] renesas_usbhs 11c60000.usb: no transceiver found [ 3.472592] renesas_usbhs 11c60000.usb: gadget probed [ 3.477880] renesas_usbhs 11c60000.usb: probed [ 3.526793] ov5645 0-003c: ov5645_write_reg: write reg error -6: reg=3103, val=11 [ 3.534289] ov5645 0-003c: could not set init registers [ 3.539517] ov5645 0-003c: could not power up OV5645 [ 3.544864] i2c-riic 10058000.i2c: registered with 100000Hz bus speed [ 3.554573] i2c-riic 10058400.i2c: registered with 100000Hz bus speed [ 3.563750] pcf85363 2-0051: registered as rtc0 [ 3.569307] pcf85363 2-0051: setting system clock to 2023-02-06T09:01:39 UTC (1675674099) [ 3.578119] wm8978 2-001a: Failed to issue reset: -6 [ 3.583298] i2c-riic 10058800.i2c: registered with 100000Hz bus speed [ 3.591956] rz-ssi-pcm-audio 10049c00.ssi: DMA enabled [ 3.593508] renesas_sdhi_internal_dmac 11c10000.mmc: Got CD GPIO [ 3.601583] of_cfs_init [ 3.605728] of_cfs_init: OK [ 3.608776] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 3.618538] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 3.625242] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 [ 3.626078] ALSA device list: [ 3.633896] cfg80211: failed to load regulatory.db [ 3.637019] No soundcards found. [ 3.654834] renesas_sdhi_internal_dmac 11c00000.mmc: mmc0 base at 0x0000000011c00000, max clock rate 133 MHz [ 3.677671] genirq: Setting trigger mode 3 for irq 187 failed (rzg2l_gpio_irq_set_type+0x0/0x2a8) [ 3.686924] renesas_sdhi_internal_dmac 11c10000.mmc: mmc1 base at 0x0000000011c10000, max clock rate 133 MHz [ 3.698398] Waiting for root device /dev/mmcblk1p2... [ 3.756272] mmc1: new ultra high speed SDR50 SDHC card at address aaaa [ 3.763392] mmcblk1: mmc1:aaaa SS32G 29.7 GiB [ 3.771774] mmcblk1: p1 p2 [ 3.786719] mmc0: new HS200 MMC card at address 0001 [ 3.792426] mmcblk0: mmc0:0001 G1M15L 29.6 GiB [ 3.797196] mmcblk0boot0: mmc0:0001 G1M15L partition 1 31.5 MiB [ 3.803295] mmcblk0boot1: mmc0:0001 G1M15L partition 2 31.5 MiB [ 3.809441] mmcblk0rpmb: mmc0:0001 G1M15L partition 3 4.00 MiB, chardev (242:0) [ 3.818079] mmcblk0: p1 p2 [ 3.822127] EXT4-fs (mmcblk1p2): INFO: recovery required on readonly filesystem [ 3.829533] EXT4-fs (mmcblk1p2): write access will be enabled during recovery [ 3.843183] random: fast init done [ 3.859406] EXT4-fs (mmcblk1p2): recovery complete [ 3.866057] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null) [ 3.874230] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. [ 3.895126] devtmpfs: mounted [ 3.900067] Freeing unused kernel memory: 2176K [ 3.904718] Run /sbin/init as init process [ 3.908814] with arguments: [ 3.908818] /sbin/init [ 3.908821] with environment: [ 3.908824] HOME=/ [ 3.908827] TERM=linux [ 4.227556] systemd[1]: systemd 244 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR -SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid) [ 4.230744] usb 4-1: new full-speed USB device number 2 using ohci-platform [ 4.249335] systemd[1]: Detected architecture arm64. [ 4.297362] systemd[1]: Set hostname to . [ 4.493907] hub 4-1:1.0: USB hub found [ 4.499808] hub 4-1:1.0: 3 ports detected [ 4.664797] systemd[1]: /lib/systemd/system/docker.socket:6: ListenStream= references a path below legacy directory /var/run/, updating /var/run/docker.sock \xe2\x86\x92 /run/docker.sock; please update the unit file accordingly. [ 4.779624] random: systemd: uninitialized urandom read (16 bytes read) [ 4.786587] systemd[1]: system-getty.slice: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling. [ 4.799029] systemd[1]: (This warning is only shown for the first unit using IP firewalling.) [ 4.811319] systemd[1]: Created slice system-getty.slice. [ 4.822679] usb 4-1.2: new full-speed USB device number 3 using ohci-platform [ 4.830882] random: systemd: uninitialized urandom read (16 bytes read) [ 4.839642] systemd[1]: Created slice system-serial\x2dgetty.slice. [ 4.862886] random: systemd: uninitialized urandom read (16 bytes read) [ 4.871306] systemd[1]: Created slice User and Session Slice. [ 4.891272] systemd[1]: Started Dispatch Password Requests to Console Directory Watch. [ 4.915167] systemd[1]: Started Forward Password Requests to Wall Directory Watch. [ 4.939051] systemd[1]: Reached target Host and Network Name Lookups. [ 4.962964] systemd[1]: Reached target Paths. [ 4.981890] cp210x 4-1.2:1.0: cp210x converter detected [ 4.995016] systemd[1]: Reached target Remote File Systems. [ 5.004941] usb 4-1.2: cp210x converter now attached to ttyUSB0 [ 5.022974] systemd[1]: Reached target Slices. [ 5.042965] systemd[1]: Reached target Swap. [ 5.066265] systemd[1]: Listening on Syslog Socket. [ 5.087287] systemd[1]: Listening on initctl Compatibility Named Pipe. [ 5.098693] usb 4-1.3: new full-speed USB device number 4 using ohci-platform [ 5.119751] systemd[1]: Listening on Journal Audit Socket. [ 5.139428] systemd[1]: Listening on Journal Socket (/dev/log). [ 5.163523] systemd[1]: Listening on Journal Socket. [ 5.183712] systemd[1]: Listening on Network Service Netlink Socket. [ 5.207533] systemd[1]: Listening on udev Control Socket. [ 5.227358] systemd[1]: Listening on udev Kernel Socket. [ 5.228772] usb 4-1.3: not running at top speed; connect to a high speed hub [ 5.260158] systemd[1]: Mounting Huge Pages File System... [ 5.266152] option 4-1.3:1.0: GSM modem (1-port) converter detected [ 5.272880] usb 4-1.3: GSM modem (1-port) converter now attached to ttyUSB1 [ 5.281350] option 4-1.3:1.1: GSM modem (1-port) converter detected [ 5.288868] usb 4-1.3: GSM modem (1-port) converter now attached to ttyUSB2 [ 5.297322] option 4-1.3:1.2: GSM modem (1-port) converter detected [ 5.304318] usb 4-1.3: GSM modem (1-port) converter now attached to ttyUSB3 [ 5.311680] option 4-1.3:1.3: GSM modem (1-port) converter detected [ 5.318225] usb 4-1.3: GSM modem (1-port) converter now attached to ttyUSB4 [ 5.325602] option 4-1.3:1.4: GSM modem (1-port) converter detected [ 5.332127] usb 4-1.3: GSM modem (1-port) converter now attached to ttyUSB5 [ 5.344494] simcom_wwan 4-1.3:1.5 wwan0: register 'simcom_wwan' at usb-11c70000.usb-1.3, SIMCOM wwan/QMI device, ea:4f:c9:14:33:64 [ 5.347891] systemd[1]: Mounting POSIX Message Queue File System... [ 5.383810] systemd[1]: Mounting Kernel Debug File System... [ 5.410300] systemd[1]: Mounting Temporary Directory (/tmp)... [ 5.434129] systemd[1]: Condition check resulted in Create list of static device nodes for the current kernel being skipped. [ 5.450479] systemd[1]: Starting File System Check on Root Device... [ 5.478101] systemd[1]: Starting Journal Service... [ 5.497410] systemd[1]: Starting Load Kernel Modules... [ 5.515782] systemd[1]: Starting udev Coldplug all Devices... [ 5.536464] systemd[1]: Mounted Huge Pages File System. [ 5.544774] systemd[1]: Mounted POSIX Message Queue File System. [ 5.553641] systemd[1]: Mounted Kernel Debug File System. [ 5.561828] systemd[1]: Mounted Temporary Directory (/tmp). [ 5.655932] mmngr: loading out-of-tree module taints kernel. [ 5.663403] rgnmm_drv mmngr: assigned reserved memory node linux,multimedia [ 5.768894] systemd[1]: Started Journal Service. [ 5.915687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null) [ 6.027283] systemd-journald[161]: Received client request to flush runtime journal. [ 8.054741] random: crng init done [ 8.058164] random: 7 urandom warning(s) missed due to ratelimiting [ 10.683352] audit: type=1325 audit(1675674106.612:2): table=filter family=2 entries=4 op=xt_replace pid=232 comm="connmand" [ 10.769511] RTL8211F Gigabit Ethernet 11c20000.ethernet-ffffffff:07: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=11c20000.ethernet-ffffffff:07, irq=185) [ 10.820060] audit: type=1325 audit(1675674106.748:3): table=nat family=2 entries=5 op=xt_replace pid=232 comm="connmand" [ 52.031289] audit: type=1006 audit(1675674147.960:4): pid=273 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=1 res=1 [ 133.911654] audit: type=1325 audit(1675674229.840:5): table=nat family=2 entries=5 op=xt_replace pid=327 comm="iptables" [ 133.923517] audit: type=1325 audit(1675674229.848:6): table=filter family=2 entries=4 op=xt_replace pid=329 comm="iptables" [ 133.937270] audit: type=1325 audit(1675674229.860:7): table=filter family=2 entries=6 op=xt_replace pid=331 comm="iptables" [ 133.950485] audit: type=1325 audit(1675674229.868:8): table=filter family=2 entries=8 op=xt_replace pid=333 comm="iptables" [ 133.963232] audit: type=1325 audit(1675674229.880:9): table=filter family=2 entries=10 op=xt_replace pid=335 comm="iptables" [ 133.974880] audit: type=1325 audit(1675674229.892:10): table=filter family=2 entries=11 op=xt_replace pid=337 comm="iptables" [ 133.986393] audit: type=1325 audit(1675674229.896:11): table=filter family=2 entries=12 op=xt_replace pid=338 comm="iptables" [ 134.050745] audit: type=1325 audit(1675674229.976:12): table=nat family=2 entries=7 op=xt_replace pid=344 comm="iptables" [ 134.071766] audit: type=1325 audit(1675674230.000:13): table=nat family=2 entries=8 op=xt_replace pid=346 comm="iptables" [ 134.093222] audit: type=1325 audit(1675674230.020:14): table=filter family=2 entries=12 op=xt_replace pid=349 comm="iptables" [ 134.902944] process 'docker/tmp/qemu-check140870943/check' started with executable stack

mantriyogesh commented 1 year ago

I did not see any esp32 kernel module prints in this log. Nevertheless, worth noting that kernel does point you that the DT you have is not correct. From your log:

 /soc/spi@1004b000/spidev@1: buggy DT: spidev listed directly in DT

spidev has to be be disabled 'correctly' from you device tree. unless that done, both spidev and esp32 kernel module will crash for unexpected reasons.

meera1310 commented 1 year ago

This whole functionality was working since 2 months before I haven't added docker in my image. This wifi feature we have tested so many times, along with that all the functionalities are working fine. As soon as I added docker my esp32c3 stopped working.

mantriyogesh commented 1 year ago

I understand the pain. Let's go stepwise.

  1. Docker setup - I am trying to understand, how the docker is relevant & what it could change from device tree / config. Can you state why the docker was needed and how it was related for building, or it was altogether for some other software dependency and you needed for that (Non ESP-Hosted user space application)

  2. Do you have any full dmsg log saved that time, when it was working? It will be easy hint to compare what went wrong.

  3. I still think that spidev should be properly disabled. in your case, spidev is trying to probe, it is failing. Did it start to probe after your docker installation (and was not invoking before docker installation)? https://elixir.bootlin.com/linux/v5.10.83/source/drivers/spi/spidev.c#L736 says it is mostly because your 'compatible' string is incorrect, should be small thing to fix.

  4. Also, please change your shell script such that it will 'remove/delete the nodes which it intend to create'. https://github.com/espressif/esp-hosted/issues/199#issuecomment-1418619623

  5. Once these things are good, let us try to module and capture the logs.

Do not worry, You had it already working earlier, means you fairly know the setup and eventually you will get it working.

meera1310 commented 1 year ago

(1) I have another image without docker and in that esp32c3 working fine: root@oldsilicon:~# docker -sh: docker: command not found root@oldsilicon:~# cd esp32c3/ esp32_spi.ko spidev_disabler.dts esp32c3-wifi-ap-mode-init.sh test.out init_script.sh wifi-ap-control.log pspl-dcu-kill-dnsmasq.py wifi-ap-dnsmasq.log spidev_disabler.dtbo
root@oldsilicon:~# cd esp32c3/ root@oldsilicon:~/esp32c3# sh init_script.sh [ 88.529226] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/spi@1004b000/spidev@1/status [ 88.568698] ESP32 peripheral is registered to SPI bus [1],chip select [0], SPI Clock [10] [ 88.921658] usb 4-1.1: new full-speed USB device number 5 using ohci-platform root@oldsilicon:~/esp32c3# [ 90.121987] [ 90.121987] Received INIT event from ESP32 peripheral [ 90.122002] EVENT: 2 [ 90.130806] EVENT: 1 [ 90.132987] EVENT: 0 [ 90.135218] ESP peripheral capabilities: 0xe8 [ 90.346532] EVENT: 3

(2) Also I have added this patch but /soc/spi@1004b000/spidev@1: buggy DT: spidev listed directly in DT this line remained same:

`static const struct of_device_id spidev_dt_ids[] = { { .compatible = "lwn,bk4" }, { .compatible = "dh,dhcom-board" }, { .compatible = "menlo,m53cpld" }, +{ .compatible = "spidev" }, {}, }; MODULE_DEVICE_TABLE(of, spidev_dt_ids);

(3) root@oldsilicon:~/esp32c3# cat init_script.sh

mkdir /sys/kernel/config/device-tree/overlays/spi_driver

Disable default spidev driver

dtc spidev_disabler.dts -O dtb > spidev_disabler.dtbo cat spidev_disabler.dtbo > /sys/kernel/config/device-tree/overlays/spi_driver/dtbo

if [ lsmod | grep esp32 | wc -l != "0" ]; then sudo rm /dev/esps0 if [ lsmod | grep esp32_sdio | wc -l != "0" ]; then sudo rmmod esp32_sdio &> /dev/null else sudo rmmod esp32_spi &> /dev/null fi fi

insmod esp32_spi.ko resetpin=297

mknod /dev/esps0 c 221 0 chmod 666 /dev/esps0 without_docker.odt

mantriyogesh commented 1 year ago

Please use github formatting. It helps to read better.

mantriyogesh commented 1 year ago

Anyway I am checking the logs.

mantriyogesh commented 1 year ago

https://github.com/espressif/esp-hosted/issues/199#issuecomment-1418742257 cannot be reference as failed log, as the module seems not loaded. Can you get the logs (non working setup)?

Please always get ESP side, dmesg logs and run log together. that way no need to repeat test for another log.

mantriyogesh commented 1 year ago

@meera1310 Did you get chance to test?

meera1310 commented 1 year ago

failure_logs.odt It looks like network traffic is the cause for this crash.

mantriyogesh commented 1 year ago

I am not sure, why I have to repeat this again, but Please always get ESP side, dmesg logs and run log together.

Anyway, with current log, I cannot deduce where the kernel crash originated. Please add entry and exit logs and try to localise which till which line the kernel crash is not occurred.

Add this definition to common header file like adapter.h

#define HOSTED_DBG printk(KERN_ERR "%s:%u \n", __func__, __LINE__)

and call it in all affected areas to point out which like is kernel crash.

mantriyogesh commented 1 year ago

any updates ahead?

mantriyogesh commented 1 year ago

Any updates ahead @meera1310 ?

meera1310 commented 1 year ago

It worked with fresh VLP image. I think so there might be some problems related to network configuration files. Thanks

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Yogesh @.> Sent: Wednesday, March 15, 2023 8:35:50 AM To: espressif/esp-hosted @.> Cc: Meera Shah @.>; Mention @.> Subject: Re: [espressif/esp-hosted] ESP32c3 doesn't work when docker image is there in yocto (Issue #199)

Any updates ahead @meera1310https://github.com/meera1310 ?

— Reply to this email directly, view it on GitHubhttps://github.com/espressif/esp-hosted/issues/199#issuecomment-1469241296, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVU5RPX2XM4RQZ4JI5ZM4FDW4EWY5ANCNFSM6AAAAAAUQEQADI. You are receiving this because you were mentioned.Message ID: @.***>

mantriyogesh commented 1 year ago

Great. Thanks for the response.

Could we please close this thread if you no more face issue?