diff --git a/cores/esp8266/StackThunk.cpp b/cores/esp8266/StackThunk.cpp index 68e80278d..9d7cc24f5 100644 --- a/cores/esp8266/StackThunk.cpp +++ b/cores/esp8266/StackThunk.cpp @@ -36,7 +36,8 @@ uint32_t *stack_thunk_top = NULL; uint32_t *stack_thunk_save = NULL; /* Saved A1 while in BearSSL */ uint32_t stack_thunk_refcnt = 0; -#define _stackSize (5748/4) +/* Largest stack usage seen in the wild at scripts.google.com at 5828 */ +#define _stackSize (5900/4) #define _stackPaint 0xdeadbeef /* Add a reference, and allocate the stack if necessary */ diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino index a01ffcb5d..f64c7347d 100644 --- a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino +++ b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino @@ -6,6 +6,7 @@ #include #include +#include #include #ifndef STASSID @@ -81,7 +82,8 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_ } client->stop(); uint32_t freeStackEnd = ESP.getFreeContStack(); - Serial.printf("\nCONT stack used: %d\n-------\n\n", freeStackStart - freeStackEnd); + Serial.printf("\nCONT stack used: %d\n", freeStackStart - freeStackEnd); + Serial.printf("BSSL stack used: %d\n-------\n\n", stack_thunk_get_max_usage()); } void fetchNoConfig() {