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
Using ESPIDF to program on ESP32-C6 for receiving data with SPI (IDFGH-12704) #13691
Comments
It's most likely a printf issue.
|
@nopnop2002 I'm very sorry for the late response. I feel that the issue may lie in SPI communication. Currently, I'm using polling instead of interrupts for SPI communication and have lowered the sampling rate to ensure receiving correct information.I will try the method you mentioned and will reply later with the results. |
@wanckl I'm very sorry for the late response.I previously used the same settings in STM32, and I could receive correct information. Initially, I was communicating by receiving 9 bytes at once, which also encountered the aforementioned issue. Later, I changed it to receive one byte at a time. The problem was resolved after I disabled the task watchdog and interrupt watchdog, and set FreeRTOS config tick=100 to 1000. However, I'm not sure why this resolved the issue. |
usleep(10000) and vTaskDelay(1) both wait 10ms, but using usleep will cause a TaskWatchDog alert regardless of the wait time.
If you use usleep, you must disable task watchdog.
|
@nopnop2002 Thank you very much. Now I know function usleep will trigger the task watchdog, I will try it! |
To be precise, usleep() cannot avoid TaskWatchDog alerts. |
So only the vTaskDelay() function can avoid TaskWatchDog alerts? |
Yes. You are right.
|
Answers checklist.
IDF version.
5.2.1
Espressif SoC revision.
ESP32-C6
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
PowerShell
Development Kit.
ESP32-C6-DevKitC-1
Power Supply used.
USB
What is the expected behavior?
can obtain stable data like this
What is the actual behavior?
can't obtain stable data
Steps to reproduce.
this is my code.
Debug Logs.
More Information.
I'm using esp32-c6 and ads1292r to acquire ECG data. I have successfully established communication with the ADS1292R through SPI and am able to write to and read from the ADS1292R registers. I also use gpio interrupt to send queue, and create task to receive queue, then receive data from ads1292r. When I set sample rate to 125Hz, I can receive stable data from ads1292r without connecting to body. However, I can't obtain stable data when I set sample rate to 250Hz, and the received data is misaligned and wrong.
I think this might be due to issues with FreeRTOS task scheduling,but I'm not certain and don't know how to address this problem.I want to achieve to obtain right data .I would appreciate it if someone could give me some help!
The text was updated successfully, but these errors were encountered: