You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can see there is no way to call that rtc_clk_cal function from MicroPython.
Since our project is "only" an assembler for ULP assembly code, support for calling that calibration function would need to be added to MicroPython instead.
Looking into workarounds: I do see that the ulp_set_wakeup_period function in ESP-IDF does some calibration to (see here) determine how many cycles the ULP should sleep for between wakeups.
The result of that calculation (period_cycles) is then stored in a register (using the REG_SET_FIELD macro), which the ULP could read. So potentially that number could be useful to work backwards from?
Reading the code though, it appears to calibrate against the "slow clock" instead of the "fast clock" (that the documentation refers to). Then again the S2/S3 variant of the code does have a branch where it calibrates to RTC_CAL_8MD256, so you would need to test whether this entire approach could be viable/useful.
For time critical code, it could be needed to calibrate the ulp clock.
https://docs.espressif.com/projects/esp-idf/en/v4.2/esp32/api-guides/ulp_instruction_set.html#note-about-instruction-execution-time
Does it is possible to do it with micropython-esp32-ulp lib ?
If not is there a workaround ?
Thanks
The text was updated successfully, but these errors were encountered: