-
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
Internal RC oscillator issues with 3.6V (IDFGH-11064) #12240
Comments
Hi, @peter3099 , I tested a few chips that kept sleeping and waking up at 300s intervals for one day and it didn't reproduce the problem you're experiencing. (I used a constant 3.6v power supply with no LDO in my test flow, and test with IDF deepsleep_wake stub_example) I have the following questions to confirm with you:
thanks. |
Hi @esp-wzh Thanks for doing the tests Answers to your questions
It might be that they are faulty but what was strange to me was that I didn't get any of these issues in the previous 100 board iteration and now out of 40 I get 4 that have a similar issue. Please let me knwo if there is anything you need from me |
I must add that I get the issue with the batteries connected and also with the 3.6V power supply(which shoudn't get any voltage drop during trasnmission) |
Hi~ @peter3099
If this issue is blocking your development, could you contact our commercial team and send back some of the faulty chips for us to test? |
@peter3099 I discussed this issue with the analog team and confirmed that the supply voltage does affect the RC oscillator circuit. The supply voltage of esp32 should be between 2.3V and 3.6V. It is not recommended to use such a boundary voltage as a normal supply voltage, because the function of the chip cannot be guaranteed once the voltage exceeds this threshold. |
Hi @esp-wzh thanks for all this. we are using this battery Voltage is flat at 3.6V until the battery dies. It is not rechargable. What I see with the oscilloscope was the voltage close to 3.67V in the ones that have more charge, but it is never above 3.67V. Could it be that been so close to the max voltage some board could be more susceptible than others and react differently? Yes, I am using the same chip batch as the previous one. We bought a 1000 of them. I cannot go back to 4.4.1 because of the breaking changes in v5 and because more lora module is new on the board so the commands are different. What are the contact details for the commercial team? Regards |
For the chip that has the problem on a 3.6V power supply, can you step the voltage down to 3.3v and confirm if the problem still exists? If you find that the chip still has this issue at voltages lower than 3.6V, you can report the issue via the link below |
The config LGTM, I believe this problem is not caused by software : ) |
Cool, I keep you posted on the test with 3.3V on the failing ESP32 |
Hi @esp-wzh I can confirm the issue still happens with regulated on the faulty ESP32. Question is: did they get broken with the 3.6V or they were faulty already? |
I already started a commercial claim |
More than a claim, a request :) |
Hi @esp-wzh just to let you know that I found 2 more devices out of the 40 ESP32 batch with the same issue.... They should sample every 5 minutes, have a look at the time between 16:00 and 16:35 That number is the count of motion while in deep sleep count by the ULP, it gets reset every time it samples, they usual max number is 15(1 motion every 20Seconds in 300 seconds sample), I know that the device never woke up as I see the number 37, so it means that it keep counting becuase it never woke up to reset it. The consumption I get using 3.6V is much lower than using 3.3V as I avoid the loses in the LDO due to the voltage drop. I would like to keep using this setup but I'm concern about this kind of issue. |
@peter3099 Thank you for your continued reporting. Yeah, you can try use EXT 32kHz crystal, compared to 8M RC it does not consume much power, typically < 5uA. The other thing I want to confirm: if not use ULP during sleep, does the problem recur? And how often does it recur on a faulty esp32, and does it recur with shorter sleep intervals? |
Hi @esp-wzh Let me check that, is the consumption with the ext 32KHz crystal better than the internal RC? I will check the ULP thing and come back to you with some details |
Hi @esp-wzh Could it be that this issue with the RTC is causing some issues with UART1 comunication. I have a module connected to UART1 and sometimes I get random issues where the module doesn't understand the commands I'm sending. In the ESP32 that have this RTC issue this random error happens more often, almost all the time.
This is the configuration for my UART, notice that I only got it working with source_clk = UART_SCLK_REF_TICK just wondering if the issues are related. All my devices are 3.6V capable |
Hi, @peter3099 , I don't think they are related, the two modules belong to different digital domains. It is recommended that you dump the raw data in UART1 communication and compare it with the data collected by the logic analyzer on the UART TX/RX pin. And what needs to be noted is that if you have enabled esp_pm or autolightsleep, you need to aquire the no_lightsleep power lock during UART transmission process to avoid going to lightsleep automatically. |
Hi @esp-wzh Now all my problem with the comunication are gone :) The RTC issue still happening but it looks like it happens less often when the frequency is higher Attached are my sdkconfig just in case it helps Thanks |
Does it happens on all chips? Which api are you using to calculate the sleep duration. |
@peter3099 It's good news! Change In our QA testing, we have tested a huge number of chips to confirm that the value of And if it's due to insufficient voltage, the wakeup should be stuck but not lost, so I think this parameter is not the direct cause of this problem. I would like to know after each wakeup, how do you configure the next wakeup time in your application? By deepsleep wake stub or ULP? Can you make sure that the configuration is correct? One more request, can you give the mac info for a few chips with this problem? You can dump it by command |
Hi @esp-wzh thanks for this, it looks like it is solving the issue in this
Do you mean for 150kHz RC? After each wake up and after finalizing my routine before calling esp_deep_sleep_start() To set my next deep sleep time When I do esptool.py -p COMx chip_id I get noting Can I do this change to dbg_atten_slp without modyfing my ESP-IDF files? At the moment I jsut made a change on rtc_sleep.c. Or are you going to implement this fix in the next release? Thanks |
Yes, if the rtc_clk chooses 150kHz RC and there's no other peripherals use RC8M during sleep, the RC8M will auto powerdown.
Can you print the wakeup cause and the value of
Sorry, my fault, it should be
Until the exact cause and explanation of this problem is found, this change will not be allowed to be merged into master, as the current version of the parameter has been working stably for many years now |
For esptool issue, please run it in IDF python env or
Yes, you must edit the IDF source code manually, because this part of the code was not designed to be configurable by the user.
Can you help to provide a minimum project to reproduce this problem? |
Hi @esp-wzh I can confirm the issue is resolved changing the dbg_atten_slp, I will try to get you a piece of the code so you can try it. So basically RTC_CNTL_DBG_ATTEN_DEFAULT=0 selects the 150kHz osc and put the other ones in off? Or does it something else? Thanks |
Hi! @peter3099 You can understand that this register controls the power drive capability of one of the analogue circuits inside the chip, you can choose a value between 0 and 3, the larger the value the weaker the drive capability, usually the circuit doesn't need a strong drive capability if the 8MRC is turned off during the sleep, so configure it to 3, if the 8MRC is kept on during the sleep it needs to increase the power drive capability, so configure it to 0, but it seems that on your chip, even sleep with only a 150K clock requires a strong drive capability to work properly. BTW, do you have any other questions on the reading chip mac info thing? This will help us trace the process information of the chip in your hand to help debug if the issue is a software issue. |
I forgot about the chip mac, let me try again. Thanks for the info |
3 of the mac Ids of ESP32 with issues with RTC |
hi @esp-wzh did anything came back from the mac Ids? |
Hi, @peter3099 Another point that needs to be clarified about the rtc_timer wake-up mechanism is that: after each wakeup the CPU needs to read the current rtc_timer tick value and reconfigure it by adding it to the wakeup period. So theoretically if one wakeup is lost, all subsequent wakeups should also be lost. It is still expected that you can provide a minimal reproducible project or send back an environment where it can be reproduced stably. thanks. |
Hi @esp-wzh thanks for that! I understand, I'm trying to minimize our sleep code so I can send it to you. Once thing I noticed is that with dbg_atten_slp values of 1 and 2 I get random wake up in between, like normally the device will wake up every 5 min and in some cases for this 2 devices I see random wake up 1 min apart, then the rest are ok and they are done every 5 min. Are values 1 and 2 correct values? Also with the value 3 it doesn't look like I'm lossing samples anymore. I will keep testing it. Thanks |
In terms of hardware design do you think we need to go for an external RTC or using the internal should be realiable enough? We don't need super precision I just need that it wakes up when it needs to wake up :) |
As previously described, the 0 to 3 control of the internal power drive capability is linear, and if 0/3 is valid and 1/2 is not, then I suspect that the current test data doesn't prove a significant correlation between power drive capability and wake-up loss issue. If your application accepts the increased cost of additional crystals, it is recommended to use it, which are indeed more power efficient and stable than internal clocks. |
perfect thanks man! |
@peter3099 If no more problems please help close this issue, thanks! |
Thanks @esp-wzh |
Hi @esp-wzh sorry for reopening this, but I wanted to know what is the status of this in IDF 5.1.2, do I still need to change out_config->dbg_atten_slp = RTC_CNTL_DBG_ATTEN_NODROP? Thanks |
Hi, @peter3099. According to the data of our batch testing, there is no evidence showing that the current IDF default parameters will cause the failure you encountered, so I am sorry that I cannot promote the change of this parameter in the master. If your test proves that modifying this value can indeed to fix the problem you encountered, you can maintain the patch yourself. What we can confirm is that changing the RTC_CNTL_DBG_ATTEN_DEFAULT value to 0 will not have any other negative effects except increasing power consumption. |
perfect thanks, so far I haven't got any power increase when using 0 or 3, the issue with deep sleep dissapeared but the power looks the same as before... |
Thanks for sharing the updates, feel free to reopen. |
Hi Just to confirm this still happens with 5.1.2. I will try to make the same changes to the IDF to see if that solves the issue. |
Answers checklist.
IDF version.
v5.1.1
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
PowerShell
What is the expected behavior?
Hello
We are currently having a random issue with ESP32-WROVER-E where we find that the internal 150kHz RC osccilator changes the time for waking up the ESP from deep sleep, it either goes shorter or longer.
the only 2 things we change in our design was moving from IDF 4.4 to 5.1.1 and we also stop using a voltage regulator for the supply on the ESP32. We now use the 3.6V directly from the disposable Lithium Battery with a super capacitor in parallel to help with current demand.
In the previous design with ESP IDF v4.4 and 3.3V regulated as power for the ESP32 we flash 100 boards and we got 0 issues with the internal RC oscillator
Now, with this new design after flashing 30 boards, 4 of them had this issue were the ESP will never wake up from deep sleep or it will wake up really often. This issue doesn't happen from the start, it ussually gets worse over time.
Will the VCC used for powering the ESP32 alter the internal RC oscillation? or could it be an issue with the IDF 5.1.1?
Thanks
What is the actual behavior?
ESP32 doesn't wake up from deep sleep at the correct time.
Steps to reproduce.
Supply ESP32 with 3.6V
Random issue were deep sleep doesn't wake up at the correct time and the RTC loses the value.
Build or installation Logs.
No response
More Information.
No response
The text was updated successfully, but these errors were encountered: