-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
ulp_riscv_i2c crash (IDFGH-8880) #10301
Comments
Having the exact same issue, esp32-s2-saola-1-v1.2 |
Hi @schafon, |
Hi there, I'm a complete noob with C, I usually code in Arduino so I'm way off my comfort zone. Thank you for looking into it! I'm looking forward to use this code! |
I don't think it is related (at least not directly). I have tested it by placing ulp_riscv_delay_cycles() in a loop. When a count is reached, it wakes main cpu and it runs fine. In an infinite loop, the cocpu stays asleep. That said, I have had trouble with the internal temperature sensor using the main cpu in the past. It uses an infinite loop to scan for a condition (scary). Which brings me to another issue, I see ulp_riscv_i2c.c also uses infinite loops to scan for the tx/rx interrupt. If that interrupt never arrives unfortunate things happen. For my purpose, I have modified ulp_riscv_i2c.c to at least make use the ack error and timeout flags provided by RTC_I2C_INT_ST_REG but, even that does not fix the reported issue. The closest, possibly related, issue I could find was: #9455 |
Hi guys, I know it's been only two weeks and that you probably have other issues with higher priority but I'm developing a product that I want to sell and this is the only thing standing in my way. |
Hi @schafon, |
Thank you so much!! It works! |
Thank you @sudeep-mohanty. I too can confirm that the patch works. |
Thank you for confirming @Veldmonster ! |
This commit fixes an issue where in the ULP RISC-V I2C example causes a spurious wakeup of the main CPU because of a Trap signal when the ULP core does not meet the wakeup threshold values. This was due to the fact that the RTC_CNTL_COCPU_DONE signal was being set before the RTC_CNTL_COCPU_SHUT_RESET_EN signal which was causing the the ULP RISC-V core to not reset properly on each cycle. Closes #10301
This commit fixes an issue where in the ULP RISC-V I2C example causes a spurious wakeup of the main CPU because of a Trap signal when the ULP core does not meet the wakeup threshold values. This was due to the fact that the RTC_CNTL_COCPU_DONE signal was being set before the RTC_CNTL_COCPU_SHUT_RESET_EN signal which was causing the the ULP RISC-V core to not reset properly on each cycle. Closes #10301
This commit fixes an issue where in the ULP RISC-V I2C example causes a spurious wakeup of the main CPU because of a Trap signal when the ULP core does not meet the wakeup threshold values. This was due to the fact that the RTC_CNTL_COCPU_DONE signal was being set before the RTC_CNTL_COCPU_SHUT_RESET_EN signal which was causing the the ULP RISC-V core to not reset properly on each cycle. Closes #10301
Answers checklist.
IDF version.
ESP-IDF v5.1-dev-2061-g7869f4e151
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
CMD
Development Kit.
Olimex ESP32-S2-DevKit-Lipo
Power Supply used.
USB
What is the expected behavior?
The ESP should remain in deep sleep while polling the BMP180 every 20ms when either temperature or pressure exceeds the thresholds defined in bmp180_defs.h. The ESP should wakeup and print before going back to sleep.
What is the actual behavior?
The ESP32-S2 enters deep sleep and then wakeup again. With message "Not a ULP-RISC V wakeup (cause = 11)". Thereafter it just hangs until physical reset.
Steps to reproduce.
Step1: Use example, esp-idf-master\examples\system\ulp_riscv\i2c with bmp180 i2c sensor connected
Step2: Configure esp-idf for an esp32s2
Step3: Edit bmp180_defs.h set the value of EXAMPLE_UT_THRESHOLD and EXAMPLE_UP_THRESHOLD to a higher value such that it will not trigger an instant wakeup.
Step4: Build, flash and monitor
Debug Logs.
More Information.
The same problem is exhibited with another i2c device (vl53l1x) irrespective of using an ESP32-S2 or ESP32-S3.
The text was updated successfully, but these errors were encountered: