-
Notifications
You must be signed in to change notification settings - Fork 147
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
ESP32C3 not respond when porting to imx6 platform #200
Comments
Thank you @yruigg for much detailed debug. Can you please add some points for how did you port your solution? |
As you say rpi worked fine, I assume, you have used the same code base to build the kernel module at the imx. |
Also, any chance you hold logic analyzer? |
|
I can give you the spi mode changed firmware, but issue doesn't seem to be for spi transaction. If the interrpts are coming from the ESP-Hosted pins, esp-hosted/esp_hosted_ng/host/spi/esp_spi.c Lines 67 to 74 in 29208b6
And esp-hosted/esp_hosted_ng/host/spi/esp_spi.c Lines 76 to 83 in 29208b6
Then I think base spi working. And only might be timing issue. This might happen some times if the received data is bit shifted (due to spi timing) Anyway, I will add some debug prints at spi tx and rx along with spi mode changed firmware s, which would point the issue. |
we add print in two interrupt_handler funcitons as blow
we do insmod command with esp32_spi.ko and get dmesg
|
Yes. this is great. This most likely this looks timing issue. We will add debug logs in ESP firmware & Host for TX and RX to understand the scenario. |
OK. Thanks. |
We get waveform in SPI_MODE 2 . Seems that bytes at MOSI are all zeros. And MISO has a strange rise. |
Yes the images look problem. I am not sure why the pins are showing spikes like this. any capacitors etc involved? I think it is better to do some home work, before jumping directly to the project. SPI transport:
|
oh okay. Please find the readme.txt from the tarball: This tarball contains firmware binaries for esp32-c3 for SPI modes (1, 2 & 3). |
The SPI debug logs of tx & rx at host can be added as:
at line 612, just above esp-hosted/esp_hosted_ng/host/main.c Lines 611 to 616 in fe0b105
|
Freezing the SPI speed from Host: Also, for time being, comment these two line: esp-hosted/esp_hosted_ng/host/spi/esp_spi.c Lines 216 to 217 in fe0b105
And
to your expected frequency. As you are aware, with the so much debugs prints enabled, this firmware could be used for debugging only(unfit for production level). |
Hi. Now ESP host is working at imx6. I use SPI_MODE_0 for imx6 host, and SPI_MODE_3 for esp32c3 firmware. I did some tests with espsta0 and everything works fine. Thanks for you help.
|
Okay. Great!! |
2023.02.13_NG_B1.0.2_GH200_SPIMode3_NoDebug.tgz |
Please do let me know once you are okay to close this thread. |
I am okay to close this thread. And could you provide different SPI_MODE firmware when new version release? |
Yes, I understand the problem (We are working on this config problem also). Anyway, Just add message here once you decide to upgrade in future. I will get what you need exactly. |
Hi,
I have successfully used the NG repository on RaspberryPi 4B+ platform and tested the Wifi and Blutooth function. I am running esp32-c3 in spi mode for both wifi and bluetooth, everything is working well. dmesg shown in screenshot below.
But things turn bad when I try to port this to imx6ull platform. My host has debian os. We have modified our dtb and driver code matching with our hardware. I can load driver esp32_spi.ko at host successfully, but it stuck after register SPI bus. Here are some logs we collected.
dmesg from imx6ull
uart console from esp32c3
I read some issues from this repository and make some attempts, here are something i know:
Now I am stuck and confused. Should we change SPI_MODE both in host and in esp32 firmware? But we do not have the NG esp firmware source code and do not know how to modify. Please help.
The text was updated successfully, but these errors were encountered: