esp_restart() from esp_timer callback doesn't work in 3.1.3
esp_restart() from esp_timer callback doesn't work in 3.1.3
esp_restart() is not working for me all of a sudden. The call doesn't seem to have any effect.
It seems the only relevant thing I changed recently was upgrade from ESP-IDF 3.1.1 to 3.1.3.
Anyone else experience this? How should I begin to troubleshoot?
It seems the only relevant thing I changed recently was upgrade from ESP-IDF 3.1.1 to 3.1.3.
Anyone else experience this? How should I begin to troubleshoot?
Re: esp_restart() broken in 3.1.3
What is the return type of that call esp_return()?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: esp_restart() broken in 3.1.3
Code: Select all
/**
* @brief Restart PRO and APP CPUs.
*
* This function can be called both from PRO and APP CPUs.
* After successful restart, CPU reset reason will be SW_CPU_RESET.
* Peripherals (except for WiFi, BT, UART0, SPI1, and legacy timers) are not reset.
* This function does not return.
*/
void esp_restart(void) __attribute__ ((noreturn));
Re: esp_restart() broken in 3.1.3
Ok. So, That IDF version is stable or development master branch?phatpaul wrote: ↑Tue Mar 05, 2019 4:43 pmThere is no return from that function!Code: Select all
/** * @brief Restart PRO and APP CPUs. * * This function can be called both from PRO and APP CPUs. * After successful restart, CPU reset reason will be SW_CPU_RESET. * Peripherals (except for WiFi, BT, UART0, SPI1, and legacy timers) are not reset. * This function does not return. */ void esp_restart(void) __attribute__ ((noreturn));
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: esp_restart() broken in 3.1.3
FYI some maybe relavent info.
I added a printf after the esp_restart() call, and it does NOT execute. (I do not see "Should not get here!...\n" on the console.)
But other parts of my application are still running - BLE, WiFi, and probalby other tasks are still running...
Here's the reset code:
And that resetBtnTimerCb is called by a esp_timer:
I added a printf after the esp_restart() call, and it does NOT execute. (I do not see "Should not get here!...\n" on the console.)
But other parts of my application are still running - BLE, WiFi, and probalby other tasks are still running...
Here's the reset code:
Code: Select all
static void resetBtnTimerCb(void *arg) {
...
printf("Restarting system...\n");
esp_restart();
printf("Should not get here!...\n");
Code: Select all
/* Create a periodic timer which will run every 0.1s */
const esp_timer_create_args_t periodic_timer_args = {
.callback = &resetBtnTimerCb,
/* name is optional, but may help identify the timer when debugging */
.name = "periodic"
};
esp_timer_handle_t periodic_timer;
ESP_ERROR_CHECK(esp_timer_create(&periodic_timer_args, &periodic_timer));
/* The timer has been created but is not running yet */
/* Start the timers */
ESP_ERROR_CHECK(esp_timer_start_periodic(periodic_timer, RST_BTN_SAMPLE_MS*1000));
ESP_LOGI(TAG, "Started resetBtn timer, time since boot: %lld us", esp_timer_get_time());
Re: esp_restart() broken in 3.1.3
I'm on release/v3.1 branch.
Most recent commit that I pulled was 57118e2f10a79af0627ed56d42d24584cd4033d8
(It is several commits after the 3.1.3 tag.)
Most recent commit that I pulled was 57118e2f10a79af0627ed56d42d24584cd4033d8
(It is several commits after the 3.1.3 tag.)
Re: esp_restart() broken in 3.1.3
Which ESP32 Hardware you are using? Did you try with other ESP32 board as well if possible?phatpaul wrote: ↑Tue Mar 05, 2019 4:50 pmFYI some maybe relavent info.
I added a printf after the esp_restart() call, and it does NOT execute. (I do not see "Should not get here!...\n" on the console.)
But other parts of my application are still running - BLE, WiFi, and probalby other tasks are still running...
Here's the reset code:And that resetBtnTimerCb is called by a esp_timer:Code: Select all
static void resetBtnTimerCb(void *arg) { ... printf("Restarting system...\n"); esp_restart(); printf("Should not get here!...\n");
Code: Select all
/* Create a periodic timer which will run every 0.1s */ const esp_timer_create_args_t periodic_timer_args = { .callback = &resetBtnTimerCb, /* name is optional, but may help identify the timer when debugging */ .name = "periodic" }; esp_timer_handle_t periodic_timer; ESP_ERROR_CHECK(esp_timer_create(&periodic_timer_args, &periodic_timer)); /* The timer has been created but is not running yet */ /* Start the timers */ ESP_ERROR_CHECK(esp_timer_start_periodic(periodic_timer, RST_BTN_SAMPLE_MS*1000)); ESP_LOGI(TAG, "Started resetBtn timer, time since boot: %lld us", esp_timer_get_time());
Also did you try with older release like 3.2 stable?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: esp_restart() broken in 3.1.3
Did you check same issue into master development branch?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: esp_restart() broken in 3.1.3
Ritesh, I don't think 3.2 is stable, based on the first sticky post on this forum - says 3.1.3 is latest stable of ESP-IDF.
OK I checked it on:
- tag 3.1.3 - not working
- tag 3.1.2 - not working
- tag 3.1.1 - working!
My hardware is ESP32-WROVER (16M FLASH + 4M RAM) on a custom board.
Looks like I should open a bug on github?
OK I checked it on:
- tag 3.1.3 - not working
- tag 3.1.2 - not working
- tag 3.1.1 - working!
My hardware is ESP32-WROVER (16M FLASH + 4M RAM) on a custom board.
Looks like I should open a bug on github?
Re: esp_restart() broken in 3.1.3
I upgraded to release/3.2 branch
(It wouldn't compile -- I had to upgrade my entire msys2 from https://dl.espressif.com/dl/esp32_win32 ... 181001.zip )
The esp_restart() is still not working for me in 3.2.
(It works in 3.1.1)
Any other ideas?
(It wouldn't compile -- I had to upgrade my entire msys2 from https://dl.espressif.com/dl/esp32_win32 ... 181001.zip )
The esp_restart() is still not working for me in 3.2.
(It works in 3.1.1)
Any other ideas?
Who is online
Users browsing this forum: Baidu [Spider], Google [Bot] and 116 guests