Hi,
I'm using an ESP WROVER module ULP to count pulses and I realized that after performing an OTA update the ULP seems to do nothing, the ULP program changes in this update.
After looking in some posts, it looks that the ULP ends in an undetermined state after a esp_reset(); command. Is any way to reset the ULP or its PC in order to load and run the new program? prefereably without messing with the RTC_WDT.
Regards,
P
Reset the ULP after OTA update
Re: Reset the ULP after OTA update
Your best shot would be to gracefully shut it down before a soft reset, although it might not be possible to do this in all cases (eg. a failed assertion somewhere).
On startup, try to clear RTC_CNTL_ULP_CP_SLP_TIMER_EN and hope the ULP hits a halt soon? Fill ULP program memory with halt instructions? Have a SoC heartbeat, with the ULP ending itself if that's not updated for x ms (assuming the program is still intact, ULP running normally, etc)? Maybe there's a bit in a register somewhere to kill the ULP?
Or do a simple RTC reset and have 100% confidence that you have a clear slate... I know it sounds dirty but it's a lot cleaner than any of that^
On startup, try to clear RTC_CNTL_ULP_CP_SLP_TIMER_EN and hope the ULP hits a halt soon? Fill ULP program memory with halt instructions? Have a SoC heartbeat, with the ULP ending itself if that's not updated for x ms (assuming the program is still intact, ULP running normally, etc)? Maybe there's a bit in a register somewhere to kill the ULP?
Or do a simple RTC reset and have 100% confidence that you have a clear slate... I know it sounds dirty but it's a lot cleaner than any of that^
Re: Reset the ULP after OTA update
Hi boarchuz,
How would you do an RTC reset? from what I understand thats possible when hitting the EN pin or by disconnecting the module supply, any of them are possible in my project.
My idea is to do some OTA update without physically going to the place and "reset" it so the ULP would work.
Regards,
P
How would you do an RTC reset? from what I understand thats possible when hitting the EN pin or by disconnecting the module supply, any of them are possible in my project.
My idea is to do some OTA update without physically going to the place and "reset" it so the ULP would work.
Regards,
P
Re: Reset the ULP after OTA update
Code: Select all
#include "soc/rtc_cntl_struct.h"
#include "hal/wdt_types.h"
#include "hal/rwdt_ll.h"
void __attribute__((noreturn)) esp_rtc_reset(void)
{
rwdt_ll_write_protect_disable(&RTCCNTL);
rwdt_ll_disable(&RTCCNTL);
rwdt_ll_config_stage(&RTCCNTL, WDT_STAGE0, 0, WDT_STAGE_ACTION_RESET_RTC);
rwdt_ll_disable_stage(&RTCCNTL, WDT_STAGE1);
rwdt_ll_disable_stage(&RTCCNTL, WDT_STAGE2);
rwdt_ll_disable_stage(&RTCCNTL, WDT_STAGE3);
rwdt_ll_set_sys_reset_length(&RTCCNTL, WDT_RESET_SIG_LENGTH_3_2us);
rwdt_ll_feed(&RTCCNTL);
rwdt_ll_enable(&RTCCNTL);
rwdt_ll_write_protect_enable(&RTCCNTL);
for(;;);
}
Who is online
Users browsing this forum: Baidu [Spider] and 129 guests