On the ESP8266 we were able to redirect console output using os_install_putc1() and we could dump any byte that normally went over the uart into a buffer, which in turn could be polled over the network. That worked and helped perfectly for years!
On the ESP32 we have esp_log_set_vprintf(), but that stops working just before the interesting stuff happens, i.e. crash reports simply do not get there.
What other choices do I have? I cannot use a serial connection and I cannot create a (crash dump) partition. Let's say, there is no hardware access, the devices are in the field.
I've seen the function ets_install_putc1() in the code, but a quick test showed no effect. That is a pity, since it could be used to dump everything into an rtc memory buffer...
Not able to redirect crash report using esp_log_set_vprintf
Not able to redirect crash report using esp_log_set_vprintf
ESP32 / ESP-IDF 5.1.4
Re: Not able to redirect crash report using esp_log_set_vprintf
Is there a way to get ets_install_putc1() operational in the ESP32 IDF?
ESP32 / ESP-IDF 5.1.4
-
- Posts: 9619
- Joined: Thu Nov 26, 2015 4:08 am
Re: Not able to redirect crash report using esp_log_set_vprintf
The issue is not that ets_install_putc1 doesn't work, the issue is that the panic handler has its own routines for outputting data, and unfortunately those can't be customized. (See esp-idf/components/esp_system/panic.c for those.) I can see there's an use for being able to hook your own output things there; I'll see if we can make those functions weak so you'd be able to override them with your own. No guarantee on when someone implements that and when it hits the master branch, though.
Re: Not able to redirect crash report using esp_log_set_vprintf
Thank you for pointing me to the right file. That was indeed very helpful and solved the problem by introducing my own panic_print_char() function.
ESP32 / ESP-IDF 5.1.4
Who is online
Users browsing this forum: No registered users and 69 guests