-
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
Temperature sensor crashes RISC-V (IDFGH-8723) #10164
Comments
Hi @NoNullptr, Your basic steps seem correct to me. I have an internal test branch for adding support that does the same, but unfortunately we discovered that the results seems to be incorrect after entering deep sleep. The current theory is that we might need to adjust some sleep parameters to be able to correctly use the temp sensor during sleep, so right now the support for ulp temp sensor is blocked on that. The team responsible for the RTC part of the SW is looking at it, so as soon as this is resolved on their end we will be able to add support for it in IDF. |
Thank you for your response and looking into it, I am looking forward to having it resolved. |
This has been stale for quite some time now – is there any progress on this issue? |
@ESP-Marius So how is the status now? Any update? |
Hi, I am also very much interested in the topic. I also wasn't able to get it running. Is there any update? Best regards, |
Seems you not set REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_TSENS_DAC, tsens_dac);. Please check how esp-idf temperature sensor driver did. |
Some confidential information is not ready to be shown in trm.. Please refer to espressif driver. As for this issue we will close it because it's not an esp-idf issue. Feel free to comment it or reopen it if you got any update. Thanks! |
Hi @mythbuster5, thanks very much for your answer. I already tried including "REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_TSENS_DAC, 15)"; Problem is that I get a linker error that REGI2C_WRITE_MASK is not found (undefined reference to `regi2c_ctrl_write_reg_mask') Do you know how to solve that? Best, |
Yes, because that is confidential. Not all information is allowed to expose to user according to espressif confidential policy |
The way to solve that is refer to idf driver *_ll.h function tells you how to use esp chip register. |
Hi mythbuster5, thanks a lot for your help and support. The relevant function seems to be uint32_t m_esp_rom_regi2c_write_mask(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t msb, uint8_t lsb, uint8_t data). The problem is I only find the source code of this function in esp32-S2 documentation and while everything compiles fine it does not give me any valid temperature readings on my esp32-S3. I assume the problem is that a lot of definitions like for example I2C_RTC_SLAVE_ID_V are wrong (as they are taken from esp32-S2). For esp32-S3 I cannot find those variables. Attached are the two functions that I use. They do compile fine but unfortunetaly they don't give me any valid temperature measurements UNLESS the main core runs. Do you have any guideance for me? Best regards, uint32_t m_esp_rom_regi2c_write_mask(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t msb, uint8_t lsb, uint8_t data)
return old; int read_temperature()
return temperature; |
Answers checklist.
IDF version.
v5.1-dev-1626-g4b6d9c8ad3
Operating System used.
macOS
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
No response
Development Kit.
ESP32-S3-MINI-1U
Power Supply used.
USB
What is the expected behavior?
The Technical Reference Manual, chapter 39.4, states how to configure and read out the temperature sensor, namely:
This translate roughly to this:
This code, however, is an infinite loop at
while
which effectively crashes the coprocessor. From the ESP-IDF driver one can see that alsoSENS_TSENS_CLK_EN
andSENS_TSENS_XPD_FORCE
need to be enabled, that is,need to be set, too. The documentation also misses that
SENS_TSENS_DUMP_OUT
should be reset after making a readout.While this fixes the infinite loop, the read out values are wrong in deep sleep, always returning the value 1 or 127. I tried various register settings and compared various register values when running during deep sleep and during normal operation, but cannot find what needs to be set to read out the correct temperature during deep sleep; the technical reference manual is too lacking to be of much help.
What is the actual behavior?
An infinite loop when following the documentation. Wrong values after making the required fixes to not have an infinite loop.
Steps to reproduce.
Here's a minimal code that reads the temperature and pauses for about 1s in total ten times and then wakes up the main cpu:
Debug Logs.
No response
More Information.
No response
The text was updated successfully, but these errors were encountered: