espressif / esp-hosted

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

esp-hosted-ng version 1.0.2 compile error #198

Closed gauthamikosanam closed 1 year ago

gauthamikosanam commented 1 year ago

May I know the solution for this rm -rf .o sdio/.o spi/.o .ko make ARCH=arm CROSS_COMPILE=/opt/toolchains/gcc-linaro-7.3.1-2018.05-i686_arm-linux-gnueabihf/bin -C /lib/modules/5.14.0-1056-oem/build M=/home/gauthami/Desktop/esp-hosted-release-ng-v1.0.2(1)/esp-hosted-release-ng-v1.0.2/esp_hosted_ng/host clean /bin/sh: 1: Syntax error: "(" unexpected make: *** [Makefile:55: clean] Error 2

mantriyogesh commented 1 year ago

Hello @gauthamikosanam ,

Thank you very much for using ESP-Hosted-NG. Can you please either of:

  1. Rename esp-hosted-release-ng-v1.0.2(1) to esp-hosted-release-ng-v1.0.2 and retry building <- preferred solution
  2. OR escape the (
gauthamikosanam commented 1 year ago

Thanks for the reply...I renamed and compiled the code....getting the below error....could you please help me out arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mrecord-mcount’

mantriyogesh commented 1 year ago

Can you please send output of:

$ cat /etc/*elease $ uname -a $ arm-linux-gnueabihf-gcc -v

what is the host you are using, if I may get to know? I suspect you are using incompatible toolchain to build. You can completely uninstall the toolchain and install it again.

Alternatively, if your expected host has development environment, you can build directly there (cross compilation not needed that case then)

gauthamikosanam commented 1 year ago

Thanks for your reply....May I know the toolchain to build? gauthami@gauthami-Latitude-3420:~/Documents/esp-hosted/esp_hosted_ng/host$ cat /etc/*elease DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS" NAME="Ubuntu" VERSION="20.04.4 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.4 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal

gauthami@gauthami-Latitude-3420:~/Documents/esp-hosted/esp_hosted_ng/host$ uname -a Linux gauthami-Latitude-3420 5.14.0-1056-oem #63-Ubuntu SMP Fri Dec 16 14:32:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

gauthami@gauthami-Latitude-3420:~/Documents/esp-hosted/esp_hosted_ng/host$ arm-linux-gnueabihf-gcc -v Using built-in specs. COLLECT_GCC=arm-linux-gnueabihf-gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabihf/9/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --without-target-system-zlib --enable-libpth-m2 --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-multilib --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- --includedir=/usr/arm-linux-gnueabihf/include Thread model: posix gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)

gauthamikosanam commented 1 year ago

I am using atmel a5d2x processor.So in my board having esp32-wroom32ue wifi module.To install the packages am using yocto environment version 2.5.So am loading the boot images into the board and running the application.So I want to know how to load this wifi module driver in yocto......?Can you please briefly explain me......

mantriyogesh commented 1 year ago

destination machine, for which you are building is 32bit arm? (Reason I am asking, you are cross compiling for 32bit arm).

Anyway, worth to check, https://www.youtube.com/watch?v=gm7lEJS3IuY Use 'hf' if you know what you are doing.

gauthamikosanam commented 1 year ago

In usr/bin path arm-linux-gnueabihf is there.....but still getting error....Can you please provide some solution for this issue.... make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -C /lib/modules/5.14.0-1056-oem/build M=/home/gauthami/Documents/esp-hosted/esp_hosted_ng/host clean make[1]: Entering directory '/usr/src/linux-headers-5.14.0-1056-oem' make[1]: Leaving directory '/usr/src/linux-headers-5.14.0-1056-oem' make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -C /lib/modules/5.14.0-1056-oem/build M=/home/gauthami/Documents/esp-hosted/esp_hosted_ng/host modules make[1]: Entering directory '/usr/src/linux-headers-5.14.0-1056-oem' CC [M] /home/gauthami/Documents/esp-hosted/esp_hosted_ng/host/esp_bt.o arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mrecord-mcount’

mantriyogesh commented 1 year ago

Uninstall hf and install non hf version. Uninstall and install with some correct reference. Did you check the video mentioned above?

mantriyogesh commented 1 year ago

https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

mantriyogesh commented 1 year ago

Should cross compilation for target happen through /lib/modules/5.14.0-1056-oem/build?

In general, while using yocto on target, we build kernel with bitbake under yocto environment. As you said, you have worked with yocto, I'm assuming you already know some alternative way, how you are currently doing it.

gauthamikosanam commented 1 year ago

For cross compiler we are using /opt/toolchains/gcc-linaro-7.3.1-2018.05-i686_arm-linux-gnueabihf/bin.Till now for any packages we need then with the help of yocto using bitbake we are adding the packages and taking the boot images and loading it to the target.So for wifi esp32 wroom 32ue module I want to add this driver in yocto and want to use it in my application.May I know the procedure for that?

gauthamikosanam commented 1 year ago

How to load the esp-hosted-ng driver and compile in the kernel for atmel Rugged Board A5d2x?May I know the process for that?

mantriyogesh commented 1 year ago

Hello @gauthamikosanam ,

Apologies, but we are no experts on build systems. You can use the compiler supported for your device. Getting the platform up is outside scope of ESP-Hosted.

You can have a look at
https://developer.ruggedboard.com/g5-system-development-guide/yocto-compilation-for-rugged-board-a5d2x https://github.com/linux4sam/meta-atmel

We do not have specific platform instructions as the platforms vary from user to user and there are very high number of platforms present. For porting the ESP-Hosted to your platform, please check porting guide https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/porting_guide.md and https://github.com/espressif/esp-hosted/blob/master/esp_hosted_ng/docs/porting_guide.md

In this doc, you would be asked to change rpi_init.sh with your own KERNEL, ARCH, CROSS_COMPILE, CC, etc variables. You also need to configure the desired peripheral (transport we call it in ESP-Hosted such as SPI, SDIO, UART) on your board , which will be usable by ESP-Hosted kernel module.

gauthamikosanam commented 1 year ago

Hello@mantriyogesh I have taken the ver 0.2 and compiled with kernel version 4.9,generated esp32_sdio.ko.when I try to do insmod in my board getting error.

root@rugged-board-a5d2x-sd1:/data# insmod esp32_sdio.ko esp32_sdio: version magic '4.9.151-linux4sam_5.8+-04825-g17ec695 mod_unload ARMv7 p2v8 ' should be '4.9.151-linux4sam_5.8+-04826-gef5e9ce04-d' esp32_sdio: version magic '4.9.151-linux4sam_5.8+-04825-g17ec695 mod_unload ARMv7 p2v8 ' should be '4.9.151-linux4sam_5.8+-04826-gef5e9ce04-d' insmod: can't insert 'esp32_sdio.ko': invalid module format

Can you please help me out on this...

mantriyogesh commented 1 year ago

You do not have correct linux headers installed against expected linux kernel version. As you are building on target linux, you can check the modinfo for module built and uname -a should match

mantriyogesh commented 1 year ago

This may happen some times as SoCs do not always maintain this matching headers. You can search how to install exact matching linux kernel headers for your SoC.

For example, raspberry also might have similar issue, there is one way to match kernel headers using rpi-source.
https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/Linux_based_readme.md#211-raspberry-pi-specific-setup

Anyway above link is just for reference, do not use on your board. You would need to find similar alternative for your SoC.

Basically, you need following command working:

ls /lib/modules/$(uname -r)/build/

build directory here will be populated once you have correct linux headers installed

gauthamikosanam commented 1 year ago

Hi I have inserted the kernel module in my board.Whether it is properly loaded ? modprobe esp32_sdio.ko root@rugged-board-a5d2x-sd1:/data# lsmod Not tainted esp32_sdio 11736 0 - Live 0xbf000000 If it is properly loaded then I am not able to scan the espsta0.May I know the reason. ifconfig espsta0 up ifconfig: SIOCGIFFLAGS: No such device root@rugged-board-a5d2x-sd1:/data# ifconfig espsta0 ifconfig: espsta0: error fetching interface information: Device not found Can I know the solution for this?

mantriyogesh commented 1 year ago

To get what is current state, I need logs,

Host -

  1. /var/log/kern.log or /var/log/messages
  2. running complete log (as as above)

ESP -

  1. minicom log for ESP

Have you followed the porting guide for ESP-Hosted? https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/porting_guide.md & https://github.com/espressif/esp-hosted/blob/master/esp_hosted_ng/docs/porting_guide.md

mantriyogesh commented 1 year ago

Please port rpi_init.sh for your platform. You can omit/comment the things you do not need. but the sequence of building/loading kernel module should be as close as rpi_init.sh.

You need reset pin and pull-up. By the way, these all information are already captured in porting guide.

gauthamikosanam commented 1 year ago

Hi, I am using atmel sama5d2x processor. Modprobe the esp32_sdio kernel module in my board and created a node. lsmod Not tainted esp32_sdio 11736 0 - Live 0xbf000000 root@rugged-board-a5d2x-sd1:/data# mknod /dev/esps0 c 221 0 root@rugged-board-a5d2x-sd1:/data# chmod 666 /dev/esps0 root@rugged-board-a5d2x-sd1:/data# ls /dev/ /dev/console /dev/mtd2ro /dev/rfkill /dev/tty33 /dev/tty60 /dev/cpu_dma_latency /dev/mtd3 /dev/rtc0 /dev/tty34 /dev/tty61 /dev/esps0 /dev/mtd3ro
this is the dmesg log from minicom root@rugged-board-a5d2x-sd1:/data# dmesg Booting Linux on physical CPU 0x0 Linux version 4.9.151-linux4sam_5.8+-04826-gef5e9ce04-dirty (root@0d4c4bb56531) (gcc version 7.3.0 (GCC) ) #4 Thu Feb 9 07:22:22 UTC 2023 CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache OF: fdt:Machine model: RUGGED BOARD A5D2X cma: Failed to reserve 64 MiB Memory policy: Data cache writeback On node 0 totalpages: 16384 free_area_init_node: node 0, pgdat c0b34b24, node_mem_map c3f6b000 Normal zone: 144 pages used for memmap Normal zone: 0 pages reserved Normal zone: 16384 pages, LIFO batch:3 CPU: All CPU(s) started in SVC mode. pcpu-alloc: s0 r0 d32768 u32768 alloc=1
32768 pcpu-alloc: [0] 0 Built 1 zonelists in Zone order, mobility grouping off. Total pages: 16240 Kernel command line: console=ttyS0,115200 console=tty0 earlyprintk root=/dev/mmcblk0p2 rw rootwait PID hash table entries: 256 (order: -2, 1024 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 54004K/65536K available (7168K kernel code, 215K rwdata, 1184K rodata, 1024K init, 220K bss, 11532K reserved, 0K cma-reserved) Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xc4800000 - 0xff800000 ( 944 MB) lowmem : 0xc0000000 - 0xc4000000 ( 64 MB) modules : 0xbf000000 - 0xc0000000 ( 16 MB) .text : 0xc0008000 - 0xc0800000 (8160 kB) .init : 0xc0a00000 - 0xc0b00000 (1024 kB) .data : 0xc0b00000 - 0xc0b35fc8 ( 216 kB) .bss : 0xc0b35fc8 - 0xc0b6d208 ( 221 kB) NR_IRQS:16 nr_irqs:16 16 L2C-310 ID prefetch enabled, offset 2 lines L2C-310 dynamic clock gating enabled, standby mode enabled L2C-310 cache controller enabled, 8 ways, 128 kB L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000 clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 11654027029 ns sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns Console: colour dummy device 80x30 console [tty0] enabled Calibrating delay loop... 326.86 BogoMIPS (lpj=1634304) 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 Setting up static identity map for 0x20100000 - 0x20100058 devtmpfs: initialized VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1 clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns futex hash table entries: 256 (order: -1, 3072 bytes) pinctrl core: initialized pinctrl subsystem NET: Registered protocol family 16 DMA: preallocated 256 KiB pool for atomic coherent allocations cpuidle: using governor menu AT91: PM: standby: standby, suspend: ulp0 AT91: mode = 0x20401, ploarity = 0400 tcb_clksrc: tc0 at 10.750 MHz clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 186464433812 ns at_xdmac f0010000.dma-controller: 16 channels, mapped at 0xc4883000 at_xdmac f0004000.dma-controller: 16 channels, mapped at 0xc4885000 AT91: Detected SoC family: sama5d2 AT91: Detected SoC: sama5d27c 64MB SiP, revision 2 VDDANA: supplied by VDDIN_3V3 advref: supplied by VDDANA SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb at91_i2c f8028000.i2c: could not find pctldev for node /ahb/apb/pinctrl@fc038000/i2c0_default, deferring probe media: Linux media interface: v0.10 Linux video capture interface: v2.00 Advanced Linux Sound Architecture Driver Initialized. Bluetooth: Core ver 2.22 NET: Registered protocol family 31 Bluetooth: HCI device and connection manager initialized Bluetooth: HCI socket layer initialized Bluetooth: L2CAP socket layer initialized Bluetooth: SCO socket layer initialized clocksource: Switched to clocksource tcb_clksrc NET: Registered protocol family 2 TCP established hash table entries: 1024 (order: 0, 4096 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) UDP hash table entries: 256 (order: 0, 4096 bytes) UDP-Lite hash table entries: 256 (order: 0, 4096 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. workingset: timestamp_bits=14 max_order=14 bucket_order=0 squashfs: version 4.0 (2009/01/31) Phillip Lougher jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc. JFS: nTxBlock = 421, nTxLock = 3375 io scheduler noop registered (default) pinctrl-at91-pio4 fc038000.pinctrl: atmel pinctrl initialized [drm] Initialized brd: module loaded loop: module loaded atmel_usart_serial.0.auto: ttyS1 at MMIO 0xf801c000 (irq = 33, base_baud = 5125000) is a ATMEL_SERIAL atmel_usart_serial.1.auto: ttyS0 at MMIO 0xf8020000 (irq = 34, base_baud = 5125000) is a ATMEL_SERIAL console [ttyS0] enabled atmel_usart_serial.2.auto: ttyS2 at MMIO 0xf8024000 (irq = 35, base_baud = 5125000) is a ATMEL_SERIAL atmel_usart_serial.3.auto: ttyS3 at MMIO 0xfc008000 (irq = 39, base_baud = 5125000) is a ATMEL_SERIAL atmel_usart_serial.4.auto: ttyS4 at MMIO 0xfc00c000 (irq = 40, base_baud = 5125000) is a ATMEL_SERIAL atmel_qspi f0024000.spi: mx25l25645g (32768 Kbytes) 7 ofpart partitions found on MTD device f0024000.spi Creating 7 MTD partitions on "f0024000.spi": 0x000000000000-0x000000010000 : "at91bootstrap" 0x000000010000-0x000000020000 : "bootloader env" 0x000000020000-0x0000000a0000 : "bootloader" 0x0000000a0000-0x0000000b0000 : "device tree" 0x0000000b0000-0x0000005b0000 : "kernel" 0x0000005b0000-0x000001bb0000 : "rootfs" 0x000001bb0000-0x000002000000 : "data" atmel_spi fc018400.spi: DMA TX channel not available, SPI unable to use DMA atmel_spi fc018400.spi: Atmel SPI Controller using PIO only atmel_spi fc018400.spi: Using FIFO (16 data) atmel_spi fc018400.spi: Atmel SPI Controller version 0x311 at 0xfc018400 (irq 178) libphy: Fixed MDIO Bus: probed CAN device driver interface m_can fc050000.can: m_can device registered (irq=48, version=31) libphy: MACB_mii_bus: probed random: fast init done Micrel KSZ8081 or KSZ8091 f8008000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f8008000.ethernet-) macb f8008000.ethernet eth0: Cadence GEM rev 0x00020203 at 0xf8008000 irq 28 (04:91:62:d3:7a:c6) PPP generic driver version 2.4.2 PPP BSD Compression module registered PPP Deflate Compression module registered usbcore: registered new interface driver asix usbcore: registered new interface driver ax88179_178a usbcore: registered new interface driver cdc_ether usbcore: registered new interface driver net1080 usbcore: registered new interface driver cdc_subset usbcore: registered new interface driver zaurus usbcore: registered new interface driver cdc_ncm usbcore: registered new interface driver qmi_wwan ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver ehci-atmel: EHCI Atmel driver ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver ohci-atmel: OHCI Atmel driver at91_ohci 400000.ohci: USB Host Controller at91_ohci 400000.ohci: new USB bus registered, assigned bus number 1 at91_ohci 400000.ohci: irq 18, io mem 0x00400000 usb usb1: New USB device found, idVendor=1d6b, idProduct=0001 usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: Product: USB Host Controller usb usb1: Manufacturer: Linux 4.9.151-linux4sam_5.8+-04826-gef5e9ce04-dirty ohci_hcd usb usb1: SerialNumber: at91 hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected usbcore: registered new interface driver cdc_acm cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters usbcore: registered new interface driver cdc_wdm usbcore: registered new interface driver usb-storage usbcore: registered new interface driver usbserial usbcore: registered new interface driver usbserial_generic usbserial: USB Serial support registered for generic usbcore: registered new interface driver ftdi_sio usbserial: USB Serial support registered for FTDI USB Serial Device usbcore: registered new interface driver option usbserial: USB Serial support registered for GSM modem (1-port) usbcore: registered new interface driver pl2303 usbserial: USB Serial support registered for pl2303 rtc rtc0: invalid alarm value: 1900-1-1 0:0:0 at91_rtc f80480b0.rtc: rtc core: registered f80480b0.rtc as rtc0 at91_rtc f80480b0.rtc: AT91 Real Time Clock driver. i2c /dev entries driver AT91: Starting after general reset sama5d4_wdt f8048040.watchdog: initialized (timeout = 16 sec, nowayout = 0) usbcore: registered new interface driver bfusb usbcore: registered new interface driver btusb sdhci: Secure Digital Host Controller Interface driver sdhci: Copyright(c) Pierre Ossman sdhci-pltfm: SDHCI platform and OF driver helper sdhci-at91 b0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz mmc0: SDHCI controller on b0000000.sdio-host [b0000000.sdio-host] using ADMA ledtrig-cpu: registered to indicate activity on CPUs atmel_aes f002c000.aes: version: 0x500 atmel_aes f002c000.aes: Atmel AES - Using dma0chan0, dma0chan1 for DMA transfers atmel_sha f0028000.sha: version: 0x510 atmel_sha f0028000.sha: using dma0chan2 for DMA transfers atmel_sha f0028000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512 atmel_tdes fc044000.tdes: version: 0x703 atmel_tdes fc044000.tdes: using dma0chan3, dma0chan4 for DMA transfers atmel_tdes fc044000.tdes: Atmel DES/TDES usbcore: registered new interface driver usbhid usbhid: USB HID core driver at91-sama5d2_adc fc030000.adc: setting up trigger as external_rising at91-sama5d2_adc fc030000.adc: version: 800 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 Bluetooth: HIDP (Human Interface Emulation) ver 1.2 Bluetooth: HIDP socket layer initialized at91_i2c f8028000.i2c: can't get DMA channel, continue without DMA support at91_i2c f8028000.i2c: Using FIFO (16 data) at24 0-0050: 256 byte 24c02 EEPROM, writable, 8 bytes/write at91_i2c f8028000.i2c: AT91 i2c bus driver (hw version: 0x704). at91_rtc f80480b0.rtc: setting system clock to 2012-01-01 00:00:10 UTC (1325376010) ALSA device list: No soundcards found. Waiting for root device /dev/mmcblk0p2... mmc0: new high speed SDHC card at address aaaa mmcblk0: mmc0:aaaa SC16G 14.8 GiB mmcblk0: p1 p2 EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities EXT4-fs (mmcblk0p2): recovery complete EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) VFS: Mounted root (ext4 filesystem) on device 179:2. devtmpfs: mounted Freeing unused kernel memory: 1024K EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered random: sshd: uninitialized urandom read (32 bytes read) atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan5 for rx DMA transfers atmel_usart_serial atmel_usart_serial.1.auto: using dma0chan6 for tx DMA transfers random: crng init done

unable to scan the network interface

root@rugged-board-a5d2x-sd1:/data# ifconfig -a can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:16 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:48

eth0 Link encap:Ethernet HWaddr 04:91:62:D3:7A:C6
BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:28 Base address:0x8000

lo Link encap:Local Loopback
LOOPBACK MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

the 3rd pin gpio is high only....checked with multimeter

Can I know the solution for this?

mantriyogesh commented 1 year ago

Hello @gauthamikosanam

Caution: little longer but detailed reply ahead.

Check the log as mentioned in https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/SDIO_setup.md#3-checking-the-setup-for-sdio

You should ideally get (1)


[   69.245969] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[   69.253368] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[   69.256622] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[   69.258842] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[   69.258939] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[   69.259035] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[   69.260840] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[   69.260939] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[   69.261040] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)

Basically CIS info u should get, if the sdio is detected. In your case the SDIO card is not probed.

It might be either of A. sdio is not correctly configured or instance is not created B. Wires are either loose or longer than 6cm C. Device Tree might have have very high sdio freq set (you can set it to 25 or 50MHz) D. the sdhci or sdhost support is not enabled in your Linux. You might want to check how to enable sdio or sdmmc or sdhci support in your Linux SoC. Generally it will be through Linux config like .config or similar. you might want to change the config and rebuild and load Linux.

(2)

[   76.892073] esp32: loading out-of-tree module taints kernel.
[   76.893083] esp32: Resetpin of Host is 6
[   76.893202] esp32: Triggering ESP reset.

This log will tell you that sdio kernel module is inserted (just inserted. Whether inserted module is working correctly or not, will be detailed ahead)

E. Check command $ lsmod | grep -I esp if the kernel module inserted or not. This is independent of step (1) above. In your log I can't see any esp32 trace. So doubtful if the module has inserted or not

(3)

[   77.665287] esp_probe: ESP network device detected
[   77.877892] Features supported are:
[   77.877901]   * WLAN
[   77.877906]   * BT/BLE
[   77.877911]     - HCI over SDIO
[   77.877916]     - BT/BLE dual mode
[   78.096179] esp_sdio: probe of mmc1:0001:2 failed with error -22

F. This will mean that the bootup or init event is received from ESP (first transaction from ESP to Host worked)

Note:

gauthamikosanam commented 1 year ago

Hello Sir, In the device tree, I have added the below lines. sdmmc0: sdio-host@a0000000 { compatible = "espressif,esp32_sdio"; resetpin = <6>; clock-rate = <1000000>; bus-width = <4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sdmmc0_default>; non-removable; status = "okay"; }; But unable to see the log of esp32 related when I boot the kernel in my soc atmel sam a5d2x target board. Shall we connect the anydesk sir if possible.

mantriyogesh commented 1 year ago
  1. Hello, Can you please help me get complete device tree

A)

Zip the all possible of Device Tree where dts, dtc and dtsi are available. This is easier to understand.

B. Last resort if step (1A) is not possible. create dts from device dtb booted (basically reverse of compiling dtb to dts: This is too much info, hard to debug https://unix.stackexchange.com/questions/289563/how-to-list-the-kernel-device-tree

Disclaimer: A. Please keep in mind, that getting the platform up is outside the scope of ESP-Hosted, we are just trying to help you out. B. Anyway if you loose the data or device not booting or stuck in bootloop, we will not be held responsible for that. C. We are not master of Device Tree configs & DT varies for all the boards/SoCs.

  1. Possible problem in DT

    resetpin = <6>;

    Looks very odd in this config Also clock is much small, some times this also creates problem. Use 50M Clock

  2. Possibly sdmmc0 is in use. In general, you always try to use the peripheral, which is not used. Basically enable the disabled peripheral, say sdmmc1 (if available)

  3. Are you cross compiling? Please attach .config or Linux kernel config used CONFIG_MMC_SDHCI or similar config (CONFIG_MMC_SDHOST ? ) if disabled, should be changed to CONFIG_MMC_SDHCI=y and rebuild and reload kernel image

gauthamikosanam commented 1 year ago

Hello Sir, a5d2x-rugged_board.zip Yes am using cross compilation given by a5d2x processor. https://github.com/rugged-board/poky

mantriyogesh commented 1 year ago

Hello Sir, a5d2x-rugged_board.zip Yes am using cross compilation given by a5d2x processor. https://github.com/rugged-board/poky

You can call me Yogesh ! These are current configs. Can you please send the original configs, to identify the differences you had made?

gauthamikosanam commented 1 year ago

Please find it below. a5d2x-rugged_board.zip

mantriyogesh commented 1 year ago

Please find it below. a5d2x-rugged_board.zip

orig dts,dtsi? dtb is binary format.

gauthamikosanam commented 1 year ago

previously we used to take the boot images from support team...we didnt changed the source code....now i installed the yocto and kernel source from rugged board a5d2x and started editing the source code.and compiled.

mantriyogesh commented 1 year ago

modified_a5d2x-rugged_board_2023.02.10_NG_1.0.2.tgz

You are free to try the changes done in the files dts and dtsi attached.

Just to re-iterate, We are not masters of Linux DTs & Any kind of loss (including the data or device) or any type of device malfunction that may occur, we will not be held responsible for that.

gauthamikosanam commented 1 year ago

Hi yogesh, I am getting this trace . esp32: Initialization. esp_reset function reset pin 3 GPIOPIN INVALID -1 esp32: Resetpin of Host . esp32: Resetpin of Host is 3 esp32: Triggering ESP reset. root@rugged-board-a5d2x-sd1:/lib/modules/4.9.151-linux4sam_5.8+-04826-gef5e9ce04-dirty/kernel/drivers/mmc/host/esp32# lsmod | grep -I esp esp32_sdio 11928 0 - Live 0xbf000000

But still not getting mmc1 and esp_probe: ESP network device detected logs in my code.... Is there any changes I need to do?

mantriyogesh commented 1 year ago

Kernel module inserted (step(2))

esp32: Initialization. esp_reset function reset pin 3 GPIOPIN INVALID -1 esp32: Resetpin of Host . esp32: Resetpin of Host is 3 esp32: Triggering ESP reset.

This really means that the kernel module is inserted fine (Step (2) above). Although it seems the resetpin used is incorrect. You might want to find out how the pin numbers are assigned for your board from the your SoC's datasheet. Links might be useful to check which GPIOs are in use. https://stackoverflow.com/questions/16033748/how-do-can-i-find-out-which-linux-driver-is-hogging-my-gpio https://unix.stackexchange.com/questions/485324/how-to-identify-gpio-pin-numbers-is-gpio-driver-loaded https://www.thegoodpenguin.co.uk/blog/stop-using-sys-class-gpio-its-deprecated/

Next things

For the kernel module to work correctly, esp_probe() function should be automatically called. Before that, It should sense that there is SD type of device connected. Basically, Next thing you really need to focus on how to get step (1) working mmc1: queuing unknown CIS tuple in kern.log as discussed in prior comment.

Possible reasons are listed, can you please try one by one? Also I hope you have attached the SDIO pull ups (depends upon which ESP32 chipset you use.) https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sd_pullup_requirements.html

There are some ESP32 chipset types, where in built pull-ups are also provided like ESP32-WROVER-Kit. For the chip you use, please refer above link.

mantriyogesh commented 1 year ago

Hello @gauthamikosanam

Any thing got progressed ahead?

gauthamikosanam commented 1 year ago

Hi Yogesh, Thanks for your concern to know the status of mine. I have checked that we are using PD5 gpio for enable pin (3rd pin). But how to write in dts file I am checking....because am not that much familiar of handling dts files. esp _probe function is not automatically called in my case....how to proceed further could youp please let me know? This is my board having wifi module. This is the reset or enable pin of my board wifi module. enable pin of wifi module

mantriyogesh commented 1 year ago

Okay.

  1. Have you changed & loaded the sdio DT as provide earlier?

  2. Take a backup of your existing DT and logs such as /var/log/kern/log.log before doing the DT changes. 3.When new DT in place, at least you should be able to see the CIS traces (check step (1) above).

  3. Also it is worth to check if ESP out and MMC input pin are correctly connected for each function. You can use multimeter to check this.

  4. I am not sure if you had added the expected pull-up registers (check prior posts above) already or not. If not, this circuitry will not work.

  5. Even to Linux detect the ESP as SD(IO), ESP would need correct firmware flashed. I have not received a single ESP32 side log till now from you. But then how will you yourself really confirm if ESP32 is booted or flashed with correct firmware software? I suggest you check how to retrieve log for ESP32 and get us the log.

gauthamikosanam commented 1 year ago

I have changed and loaded the previous DT file but am stucking when it is booting. Hit any key to stop autoboot: 0 => pri arch=arm baudrate=115200 board=rugged_board_a5d2x board_name=rugged_board_a5d2x bootargs=console=ttyS0,115200 console=tty0 earlyprintk root=/dev/mmcblk1p2 rw rootwait bootcmd=fatload mmc 1 0x21000000 a5d2x-rugged_board.dtb; fatload mmc 1 0x22000000 zImage; bootz 0x22000000 - 0x21000000 bootdelay=3 cpu=armv7 ethaddr=04:91:62:d3:7a:c6 fdtcontroladdr=23b56288 soc=at91 stderr=serial@f8020000 stdin=serial@f8020000 stdout=serial@f8020000 vendor=atmel

Environment size: 480/16380 bytes => boot 33551 bytes read in 20 ms (1.6 MiB/s) 4126424 bytes read in 266 ms (14.8 MiB/s)

Flattened Device Tree blob at 21000000

Booting using the fdt blob at 0x21000000 Loading Device Tree to 23b49000, end 23b5430e ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0 Linux version 4.9.151-linux4sam_5.8+-04826-gef5e9ce04-dirty (root@0d4c4bb56531) (gcc version 7.3.0 (GCC) ) #4 Thu Feb 9 07:22:22 UTC 2023 CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache OF: fdt:Machine model: RUGGED BOARD A5D2X cma: Failed to reserve 64 MiB Memory policy: Data cache writeback CPU: All CPU(s) started in SVC mode. Built 1 zonelists in Zone order, mobility grouping off. Total pages: 16240 Kernel command line: console=ttyS0,115200 console=tty0 earlyprintk root=/dev/mmcblk1p2 rw rootwait PID hash table entries: 256 (order: -2, 1024 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 54004K/65536K available (7168K kernel code, 215K rwdata, 1184K rodata, 1024K init, 220K bss, 11532K reserved, 0K cma-reserved) Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xc4800000 - 0xff800000 ( 944 MB) lowmem : 0xc0000000 - 0xc4000000 ( 64 MB) modules : 0xbf000000 - 0xc0000000 ( 16 MB) .text : 0xc0008000 - 0xc0800000 (8160 kB) .init : 0xc0a00000 - 0xc0b00000 (1024 kB) .data : 0xc0b00000 - 0xc0b35fc8 ( 216 kB) .bss : 0xc0b35fc8 - 0xc0b6d208 ( 221 kB) NR_IRQS:16 nr_irqs:16 16 L2C-310 ID prefetch enabled, offset 2 lines L2C-310 dynamic clock gating enabled, standby mode enabled L2C-310 cache controller enabled, 8 ways, 128 kB L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000 clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 11654027029 ns sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns Console: colour dummy device 80x30 console [tty0] enabled Calibrating delay loop... 326.86 BogoMIPS (lpj=1634304) 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 Setting up static identity map for 0x20100000 - 0x20100058 devtmpfs: initialized VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1 clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns futex hash table entries: 256 (order: -1, 3072 bytes) pinctrl core: initialized pinctrl subsystem NET: Registered protocol family 16 DMA: preallocated 256 KiB pool for atomic coherent allocations cpuidle: using governor menu AT91: PM: standby: standby, suspend: ulp0 clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 186464433812 ns at_xdmac f0010000.dma-controller: 16 channels, mapped at 0xc4883000 at_xdmac f0004000.dma-controller: 16 channels, mapped at 0xc4885000 AT91: Detected SoC family: sama5d2 AT91: Detected SoC: sama5d27c 64MB SiP, revision 2 VDDANA: supplied by VDDIN_3V3 advref: supplied by VDDANA SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb at91_i2c f8028000.i2c: could not find pctldev for node /ahb/apb/pinctrl@fc038000/i2c0_default, deferring probe media: Linux media interface: v0.10 Linux video capture interface: v2.00 Advanced Linux Sound Architecture Driver Initialized. Bluetooth: Core ver 2.22 NET: Registered protocol family 31 Bluetooth: HCI device and connection manager initialized Bluetooth: HCI socket layer initialized Bluetooth: L2CAP socket layer initialized Bluetooth: SCO socket layer initialized clocksource: Switched to clocksource tcb_clksrc NET: Registered protocol family 2 TCP established hash table entries: 1024 (order: 0, 4096 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) UDP hash table entries: 256 (order: 0, 4096 bytes) UDP-Lite hash table entries: 256 (order: 0, 4096 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. workingset: timestamp_bits=14 max_order=14 bucket_order=0 squashfs: version 4.0 (2009/01/31) Phillip Lougher jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc. JFS: nTxBlock = 421, nTxLock = 3375 io scheduler noop registered (default) pinctrl-at91-pio4 fc038000.pinctrl: atmel pinctrl initialized [drm] Initialized brd: module loaded loop: module loaded atmel_usart_serial.0.auto: ttyS1 at MMIO 0xf801c000 (irq = 31, base_baud = 5125000) is a ATMEL_SERIAL atmel_usart_serial.1.auto: ttyS0 at MMIO 0xf8020000 (irq = 32, base_baud = 5125000) is a ATMEL_SERIAL console [ttyS0] enabled atmel_usart_serial.2.auto: ttyS2 at MMIO 0xf8024000 (irq = 33, base_baud = 5125000) is a ATMEL_SERIAL atmel_usart_serial.3.auto: ttyS3 at MMIO 0xfc008000 (irq = 37, base_baud = 5125000) is a ATMEL_SERIAL atmel_usart_serial.4.auto: ttyS4 at MMIO 0xfc00c000 (irq = 38, base_baud = 5125000) is a ATMEL_SERIAL atmel_qspi f0024000.spi: mx25l25645g (32768 Kbytes) 7 ofpart partitions found on MTD device f0024000.spi Creating 7 MTD partitions on "f0024000.spi": 0x000000000000-0x000000010000 : "at91bootstrap" 0x000000010000-0x000000020000 : "bootloader env" 0x000000020000-0x0000000a0000 : "bootloader" 0x0000000a0000-0x0000000b0000 : "device tree" 0x0000000b0000-0x0000005b0000 : "kernel" 0x0000005b0000-0x000001bb0000 : "rootfs" 0x000001bb0000-0x000002000000 : "data" atmel_spi fc018400.spi: DMA TX channel not available, SPI unable to use DMA atmel_spi fc018400.spi: Atmel SPI Controller using PIO only atmel_spi fc018400.spi: Using FIFO (16 data) atmel_spi fc018400.spi: Atmel SPI Controller version 0x311 at 0xfc018400 (irq 176) libphy: Fixed MDIO Bus: probed CAN device driver interface m_can fc050000.can: m_can device registered (irq=46, version=31) libphy: MACB_mii_bus: probed random: fast init done Micrel KSZ8081 or KSZ8091 f8008000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=f8008000.ethernet-) macb f8008000.ethernet eth0: Cadence GEM rev 0x00020203 at 0xf8008000 irq 26 (04:91:62:d3:7a:c6) PPP generic driver version 2.4.2 PPP BSD Compression module registered PPP Deflate Compression module registered usbcore: registered new interface driver asix usbcore: registered new interface driver ax88179_178a usbcore: registered new interface driver cdc_ether usbcore: registered new interface driver net1080 usbcore: registered new interface driver cdc_subset usbcore: registered new interface driver zaurus usbcore: registered new interface driver cdc_ncm usbcore: registered new interface driver qmi_wwan ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver ehci-atmel: EHCI Atmel driver ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver ohci-atmel: OHCI Atmel driver at91_ohci 400000.ohci: USB Host Controller at91_ohci 400000.ohci: new USB bus registered, assigned bus number 1 at91_ohci 400000.ohci: irq 18, io mem 0x00400000 usb usb1: New USB device found, idVendor=1d6b, idProduct=0001 usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: Product: USB Host Controller usb usb1: Manufacturer: Linux 4.9.151-linux4sam_5.8+-04826-gef5e9ce04-dirty ohci_hcd usb usb1: SerialNumber: at91 hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected usbcore: registered new interface driver cdc_acm cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters usbcore: registered new interface driver cdc_wdm usbcore: registered new interface driver usb-storage usbcore: registered new interface driver usbserial usbcore: registered new interface driver usbserial_generic usbserial: USB Serial support registered for generic usbcore: registered new interface driver ftdi_sio usbserial: USB Serial support registered for FTDI USB Serial Device usbcore: registered new interface driver option usbserial: USB Serial support registered for GSM modem (1-port) usbcore: registered new interface driver pl2303 usbserial: USB Serial support registered for pl2303 rtc rtc0: invalid alarm value: 1900-1-1 0:0:0 at91_rtc f80480b0.rtc: rtc core: registered f80480b0.rtc as rtc0 at91_rtc f80480b0.rtc: AT91 Real Time Clock driver. i2c /dev entries driver AT91: Starting after general reset sama5d4_wdt f8048040.watchdog: initialized (timeout = 16 sec, nowayout = 0) usbcore: registered new interface driver bfusb usbcore: registered new interface driver btusb sdhci: Secure Digital Host Controller Interface driver sdhci: Copyright(c) Pierre Ossman sdhci-pltfm: SDHCI platform and OF driver helper ledtrig-cpu: registered to indicate activity on CPUs atmel_aes f002c000.aes: version: 0x500 atmel_aes f002c000.aes: Atmel AES - Using dma0chan0, dma0chan1 for DMA transfers atmel_sha f0028000.sha: version: 0x510 atmel_sha f0028000.sha: using dma0chan2 for DMA transfers atmel_sha f0028000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512 atmel_tdes fc044000.tdes: version: 0x703 atmel_tdes fc044000.tdes: using dma0chan3, dma0chan4 for DMA transfers atmel_tdes fc044000.tdes: Atmel DES/TDES usbcore: registered new interface driver usbhid usbhid: USB HID core driver at91-sama5d2_adc fc030000.adc: setting up trigger as external_rising at91-sama5d2_adc fc030000.adc: version: 800 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 Bluetooth: HIDP (Human Interface Emulation) ver 1.2 Bluetooth: HIDP socket layer initialized at91_i2c f8028000.i2c: can't get DMA channel, continue without DMA support at91_i2c f8028000.i2c: Using FIFO (16 data) at24 0-0050: 256 byte 24c02 EEPROM, writable, 8 bytes/write at91_i2c f8028000.i2c: AT91 i2c bus driver (hw version: 0x704). at91_rtc f80480b0.rtc: setting system clock to 2012-01-01 00:01:17 UTC (1325376077) ALSA device list: No soundcards found. Waiting for root device /dev/mmcblk1p2...

I am not added any pull up registers in my board.

In driver I have added printf statement after init module like ep32 initialization.

when I modprobe the module again If I do dmesg am getting that statement .

after espreset function not able to get the messages because resetpin is not configured in dts file.

mantriyogesh commented 1 year ago

If this boot is stuck at,

Waiting for root device /dev/mmcblk1p2...

I think all the files expected and not copied to the correct expected place. I think your boot-loader loads from location /dev/mmcblk1p2. Do you have prior backup of it? Just check if dtb or any things to be copied are missed while copying in the expected path.

In driver I have added printf statement after init module like ep32 initialization. when I modprobe the module again If I do dmesg am getting that statement . after espreset function not able to get the messages because resetpin is not configured in dts file.

Can you please give output of

$ git log --oneline | head -1
$ git diff

at esp-hosted repo?

gauthamikosanam commented 1 year ago

Hi Yogesh, This is ths output . root@0d4c4bb56531:/home/kernel_source/linux-rba5d2x/drivers/mmc/host/esp32# ls adapter.h esp32_sdio.mod.c esp_api.h esp_bt.o esp_rb.c esp_serial.c LICENSE Makefile Module.symvers built-in.o esp32_sdio.mod.o esp_bt_api.h esp.h esp_rb.h esp_serial.h main.c Makefile_backup sdio esp32_sdio.ko esp32_sdio.o esp_bt.c esp_if.h esp_rb.o esp_serial.o main.o modules.order spi root@0d4c4bb56531:/home/kernel_source/linux-rba5d2x/drivers/mmc/host/esp32# git log --oneline | head -1 ef5e9ce04 added PPP and QMI default support in rugged board defconfig root@0d4c4bb56531:/home/kernel_source/linux-rba5d2x/drivers/mmc/host/esp32# git diff diff --git a/arch/arm/boot/dts/a5d2x-rugged_board_common.dtsi b/arch/arm/boot/dts/a5d2x-rugged_board_common.dtsi index 7b854d5..7853acc 100644 --- a/arch/arm/boot/dts/a5d2x-rugged_board_common.dtsi +++ b/arch/arm/boot/dts/a5d2x-rugged_board_common.dtsi @@ -91,11 +91,23 @@ };

            sdmmc0: sdio-host@a0000000 {
mantriyogesh commented 1 year ago
root@0d4c4bb56531:/home/kernel_source/linux-rba5d2x/drivers/mmc/host/esp32# ls
adapter.h      esp32_sdio.mod.c  esp_api.h     esp_bt.o  esp_rb.c  esp_serial.c  LICENSE  Makefile         Module.symvers
built-in.o     esp32_sdio.mod.o  esp_bt_api.h  esp.h     esp_rb.h  esp_serial.h  main.c   Makefile_backup  sdio
esp32_sdio.ko  esp32_sdio.o      esp_bt.c      esp_if.h  esp_rb.o  esp_serial.o  main.o   modules.order    spi

root@0d4c4bb56531:/home/kernel_source/linux-rba5d2x/drivers/mmc/host/esp32# git log --oneline | head -1
ef5e9ce04 added PPP and QMI default support in rugged board defconfig

root@0d4c4bb56531:/home/kernel_source/linux-rba5d2x/drivers/mmc/host/esp32# git diff
diff --git a/arch/arm/boot/dts/a5d2x-rugged_board_common.dtsi b/arch/arm/boot/dts/a5d2x-rugged_board_common.dtsi
index 7b854d5..7853acc 100644
--- a/arch/arm/boot/dts/a5d2x-rugged_board_common.dtsi
+++ b/arch/arm/boot/dts/a5d2x-rugged_board_common.dtsi
@@ -91,11 +91,23 @@
                };

                sdmmc0: sdio-host@a0000000 {
-                       bus-width = <8>;
+                       bus-width = <4>;
                        pinctrl-names = "default";
                        pinctrl-0 = <&pinctrl_sdmmc0_default>;
                        non-removable;
                        status = "okay";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       esp32: esp32_sdio@0 {
+                               reg = <0>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "okay";
+                               sdio_drv_name = "esp_sdio";
+                               compatible = "espressif,esp32_sdio";
+                               resetpin = <3>;
+                               //probe = <&esp_probe>;
+                       };
                };

                sdmmc1: sdio-host@b0000000 {
@@ -178,7 +190,7 @@
                        uart2: serial@f8024000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_uart2_default>;
-                               rtsgpio = <&pioA PIN_PC21 GPIO_ACTIVE_HIGH>;
+                       ///     rtsgpio = <&pioA PIN_PC21 GPIO_ACTIVE_HIGH>;
mantriyogesh commented 1 year ago

The images built with this driver tree is booting or not booting?

gauthamikosanam commented 1 year ago

Its booting but the reset pin is not taking from dts file that means am having doubt on this device tree....yogesh.

mantriyogesh commented 1 year ago

As one of prior reply, https://github.com/espressif/esp-hosted/issues/198#issuecomment-1425397661 resetpin placement is wrong.

I am not added any pull up registers in my board

If sd pull up link shared earlier says that your board needs pull-up, iit simply needs pull-up, otherwise even if you get sdio CIS (at some point ahead), the kernel driver will not work.

If you not able add now or don't wish to alter the board, you can move to spi solution. As asked in earlier post, did you verify the pin connections say using multimeter?

mantriyogesh commented 1 year ago

There are already many questions open this post. I am still waiting to get the ESP firmware log (if it is even starting and loading correctly?)

mantriyogesh commented 1 year ago

I also pointed to https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/porting_guide.md which explain all the requirements for kernel driver.

mantriyogesh commented 1 year ago

Also sdmmc might be getting used by system. try using sdmmc1. you can refer to the dts modified changes provided earlier. In any case, do not proceed with SDIO if you do not have pull-ups (if they are required for your ESP).

mantriyogesh commented 1 year ago

for reset pin, please refer how others do it: https://github.com/espressif/esp-hosted/issues/200#issuecomment-1418383327

Please do not copy paste, as it will not work. Refer to your SoC reference manual or datasheet for correct values.

gauthamikosanam commented 1 year ago

Hi Yogesh This is my .config file. config.zip CONFIG_MMC_SDHCI=y ,this was enabled. I am using esp ver 0.2. modprobe esp32_sdio resetpin=101 getting logs of esp32 esp32: Resetpin of Host is 101 esp32: Triggering ESP reset. lsmod esp32_sdio 11864 0 - Live 0xbf000000 I am using sdmmc1 is for sdcard and sdmmc0 is using for wifi device purpose. I am using esp32 wroom 32E module. I didnt understand the sd pull up requirements.Could you please let me know so that I can move forward.

mantriyogesh commented 1 year ago

https://github.com/espressif/esp-hosted/issues/198#issuecomment-1427732622

gauthamikosanam commented 1 year ago

Hi Yogesh, I have added sd pullup requirements. Added 10kohm resistor to ClK,CMD,DAT0-DAT3 pins of esp32 wroom 32E module. I have run the code of ver0.2. Able to enter into interface esp_init_interface_layer function.But esp network detected is not coming in my case..... esp32: Resetpin of Host is 101 esp32: Triggering ESP reset. I dont have any printf statements related to mmc1: queuing unknown CIS tuple 0x01 (3 bytes) in the driver....How do I check whether my sdio is detected or probed properly?

gauthamikosanam commented 1 year ago

Hi Yogesh, I have made some changes in the config file....Added the esp32 support in Kconfig file but still not able to receive the sdio logs in kernel. config.tar.gz

mantriyogesh commented 1 year ago

Get ESP log