Closed geeksville closed 3 years ago
I've tried turning off the timer until after the certs are generated but where ever it's crashing, it's deep in the esp32 sdk.
All I've been able to track down so far is the key generation routine in the sdk doesn't call yield() so if it generates a 2048 bit key, sometimes takes a while and doesn't give resources back to the chip.
It never crashes when generating a 1024bit key and more frequently crashes when generating a 4096bit key. I would have preferred to use a 1024bit key but browsers are starting to consider 1024bit self signed certs as invalid.
My current path is to find the actual root cause in the sdk and bring in the fix if it has been already addressed up stream.
Ah ha!
Fixed it!
I was trying to use a combination of: disableCore0WDT() disableCore1WDT() vTaskDelay() yield()
but none of those worked. The problem (problem is not the right word, but whatever) is that we're using system tasks which I'm just now getting familiar with. Within a task the proper function to call when you're taking too long is:
esp_task_wdt_reset()
Not urgent, because it did the right thing on the second attempt. But I think we need to bump up our minimum task watchdog timeout. Or start the task watchdog only after HTTPS certs were generated.
log: