-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues in Spi Communication and clock synchronisationbetween Rasberrypi host and esp32s3 in the esphosted fg implementation #479
Comments
Can you please use same git commit, preferably hosted master on ESP and host? |
|
host dmesg from system boot up
|
wires are too long. You can limit the clock using
Solution is already available for Raspberry Pi, which is your host. Porting is not needed in your case. However, it is important to note the important hardware considerations from porting guide. Additionally, I couldn't find the esp log, yet, which is crucial for debugging. |
hi we have set the clock as 10mhz only
|
You have reattached the dmesg log. What is flashed on esp chipset? Where are esp chipset logs? Where is /boot/firmware/config.txt? Also confirm the raspberry and esp connections. which pins connected to what. |
With respect to esp32s3 we have flashed ESP-Hosted-FG-release_0.0.5.tgz for esp32 s3 wroom 1
|
Flash latest master on esp and use same commit on host. dtoverlay=spidev_disabler |
Once you flash the
Also verify the connection. use smaller 10cm, equal and good quality wires. |
please find the esp logs for the repository which we flashed which is ESP-Hosted-FG-release_0.0.5.tgz [ 0.210489] No Local Variables are initialized for Method [_PDC] [ 0.210491] Initialized Arguments for Method [_PDC]: (1 arguments defined for method invocation) [ 0.210505] ACPI Error: Aborting method _PR.CPU0.PDC due to previous error (AE_AML_OPERAND_TYPE) (20210730/psparse-529) |
As mentioned in #479 (comment), Please use latest master code from esp-hosted at both places, esp and host. Complete documentation of how to flash the ESP and host is available under https://github.com/espressif/esp-hosted/blob/master/README.md |
Please note, slave flashing and getting log on the slave chipsets is different from that of hosts. For ESP-Hosted to work:
|
please find the git commit on the esp32 side
|
please find the git commit in host rpi side
|
Sure. Check other things mentioned in #479 (comment) |
Hi sir I (589) SPI_DRIVER: Hosted SPI queue size: Tx:20 Rx:20 I (589) SPI_DRIVER: Hosted SPI queue size: Tx:20 Rx:20 |
please find the kernal logs from host side dmesg
|
hi sir sdkconfig
|
from sdkconfig, I could see,
From code: esp-hosted/esp_hosted_fg/esp/esp_driver/network_adapter/main/spi_slave_api.c Lines 114 to 129 in 3769eea
I assume you have not changed the code anywhere.
|
Hi Sir We have rechecked the connections properly |
|
Hi sir |
Either test in user space as said earlier or logic analyser as last sort. Problem is your spi pins, miso, clk, cs right now. Other gpios also need testing later. For now very sure of these tree keys not correct. |
Hi sir |
You meant 'esp32_spi.ko' . So yes, this should get you wifi on spi built on kernel module side. |
it is worth to cross check your gpios are working fine first for spi. Once SPI gpios are correct, you can also check handshake and data ready gpios are correct or not. |
Hi sir
|
log for |
log for Contral command test using 10mhz |
latest kernel log with both 40mhz in spidev test [ 347.770073] SPI Interrupt Handler called, IRQ: 55 [ 347.771656] SPI Interrupt Handler called, IRQ: 55 itas@raspberrypi:~/esp32_project/spi_test $ |
latest esp32 log I (634) gpio: GPIO[2]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (662) SPI_DRIVER: Hosted SPI queue size: Tx:20 Rx:20 I (702) NETWORK_ADAPTER: entering reciieved_task after intilisation I (844) NETWORK_ADAPTER: Initial set up done E (896) NETWORK_ADAPTER: data sent len:22 E (901) NETWORK_ADAPTER: Successfully send an item to a specific queue[0] E (909) NETWORK_ADAPTER: sends the item (queue_type) to the front of the meta_to_host_queue |
We might need some steps to reproduce this @sreejitharikath . It looks like the network queue remained paused. we had observed this issues very long back, but exact steps if you could let us know, we can try at our side. Also please be noted, this issue may need some time to address (maybe in next week) |
Hi Sir Please be informed that we have not done any specfice test than control command test available in the test.c available in the directory https://github.com/espressif/esp-hosted/tree/master/esp_hosted_fg/host/linux/host_control/c_support itas@raspberrypi:~/esp-hosted/esp_hosted_fg/host/linux/host_control/c_support $ sudo ./test.out get_fw_version Enable heartbeat with duration 20 Control response timed out after 30 sec Response not received Control response timed out after 30 sec Response not received Segmentation fault Other than that we have spi dev test with the following combinations
Other than this we have not done any specfic test. |
Did you check the module param in rpi_init.sh? The config should be provided through it. Spi slave frequency cannot be just set to anything. It should be supported by slave. 50mhz is nowhere supported for any ESP chipset for spi as slave. Did you verify your transport ported is correct first? |
Hi Sir Based on checking the steps mentioned in the porting guide and implementing the rawtp test to check the spi communication we found the following • Again had checked hardware connections with respect to the documentation and also verified continuity. gpiochip0: GPIOs 512-569, parent: platform/fe200000.gpio, pinctrl-bcm2711: gpiochip1: GPIOs 570-577, parent: platform/soc:firmware:gpio, raspberrypi-exp-gpio, can sleep: • Checked the gpio for handshake, dataready and reset found like this • We have got 506,522 and 527 as reset,handshake and spi datat ready respectively. what is meant by new gpio mentioned in the porting guide.
|
log of rpi side when transmitted data from esp to host using rawtp [ 5105.277818] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.279203] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.280598] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.281980] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.283370] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.284761] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.286153] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.287540] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.288928] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.290312] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.291696] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.293084] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.294470] esp32_spi: esp_spi_transaction: entered slave_ready [ 5105.296736] SPI Interrupt Handler called, IRQ: 55 [ 5107.664867] systemd-journald[272]: /dev/kmsg buffer overrun, some messages lost. [ 5539.775568] esp32_spi: esp_spi_transaction: entered slave_ready [ 5540.605164] esp32_spi: esp_spi_transaction: entered slave_ready [ 5540.606938] esp32_spi: esp_spi_transaction: entered slave_ready [ 5557.154541] esp32_spi: esp_spi_transaction: entered slave_ready [ 5557.156137] esp32_spi: esp_spi_transaction: entered slave_ready [ 5557.421374] esp32_spi: esp_spi_transaction: entered slave_ready [ 5557.426980] esp32_spi: esp_spi_transaction: entered slave_ready [ 5557.428553] esp32_spi: esp_spi_transaction: entered slave_ready itas@raspberrypi:~/esp-hosted/esp_hosted_fg/host/linux/host_control $ |
Please lower log like:
You can instead print (start 32 bytes of) frame in single line. From the logs, it is clearly visible, that spi is not working in expected manner. please state:
|
Based on our last communication please find the information furnished below.
|
log for raw tp transportation from host to esp in host side |
I am not understanding, why would you go for higher frequency if lower frequency is not working? Once you get everything running on low frequency like 5m or 10m, then step-wise increase till your host ans slave support and are both interoperable. Porting guide states it explicitly at https://github.com/espressif/esp-hosted/blob/master/esp_hosted_fg/docs/Linux_based_host/porting_guide.md#spi-timing-issues----tuning
Please use low freq, get it working first. |
This is max slave spi clock freq supported for S3. Please use 5MHZ first. Get everything working (first to get TX and RX raw throughput working). Once everything tested fine, increase SPI clock from host in 1MHz step. If using wires, you may not go beyond 30MHz. If using PCB, can go till 40MHz. |
Hi Sir • SPI clock frequency for esp32s3 could be changed from macro SPI_CLK_MHZ in esp/esp_driver/network_adapter/main/spi_slave_api.c for esp hosted ng setup for fg setup this macro SPI_CLK_MHZ is not available.
|
Hi Sir Given the timing and synchronization challenges with the SPI communication between the ESP32S3 and Raspberry Pi, here’s a step-by-step approach based on which we are currently executing the test. |
Let me review the logs and comments you have posted tomorrow and get back to you on this. |
Checklist
How often does this bug occurs?
always
Expected behavior
virtual serial interface espso is not created after runing esphosted fg in both rpi4b and esp32s3 even after flashing their respective repositories from github
Actual behavior (suspected bug)
when runing the commad bash -x ./rpi_init.sh wifi=spi
[ 204.596250] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/spi@7e204000/spidev@0/status
[ 204.627263] esp32_spi: loading out-of-tree module taints kernel.
please help me in fixing this why after the module is inserted it is exiting why iam getting warning of memory leakage , why iam getting message that kernel is getting tainted
Error logs or terminal output
Steps to reproduce the behavior
see error
bash -x ./rpi_init.sh wifi=spi
Project release version
ESP-Hosted-FG-release_0.0.5.tgz for rpi4b and ESP-Hosted-FG-release_0.0.5.tgz for esp32 s3 wroom 1
System architecture
ARM 32-bit (Raspberry Pi 32-bit)
Operating system
Linux
Operating system version
PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)" NAME="Raspbian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=raspbian ID_LIKE=debian
Shell
Bash
Additional context
SPI Initialization: The esp32_spi module is initialized successfully with SPI bus 0, Chip Select 0, and SPI mode 2. The GPIOs for handshake and data ready are correctly set.
Resets and Reinitializations: The logs show multiple resets of the ESP32 and reinitializations of the SPI module. This might be triggered by specific actions like resetting the ESP32 or reloading the module.
Potential Overlay Warning: The warning about a potential memory leak when removing the overlay
why esps0 is not created or enabled why module is getting exit
The text was updated successfully, but these errors were encountered: