8000 call umm_init just before starting SDK by mhightower83 · Pull Request #8207 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

call umm_init just before starting SDK #8207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 19, 2021
Prev Previous commit
Next Next commit
Improved example HwdtStackDump to use StackThunk
  • Loading branch information
mhightower83 committed Jul 9, 2021
commit 8c1216b2cd0b0ee90cf643935ccb4caad8b70fae
30 changes: 29 additions & 1 deletion libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
speed defaults to 115200 bps. The HWDT stack dump will always print on port
'Serial'.

To demonstrates this tool, this Sketch offers a few options for crashing the
To demonstrate this tool, this Sketch offers a few options for crashing the
ESP8266 with and without a HWDT reset.

*/
Expand All @@ -20,6 +20,7 @@
#include <Esp.h>
#include <user_interface.h>
#include <coredecls.h> // g_pcont - only needed for this debug demo
#include <StackThunk.h>

#ifndef STASSID
#define STASSID "your-ssid"
Expand All @@ -29,6 +30,29 @@
const char* ssid = STASSID;
const char* password = STAPSK;

////////////////////////////////////////////////////////////////////
// This block is just for putting something on the BearSSL stack
// to show that it has not been zeroed out before HWDT stack dump
// gets to runs.
extern "C" {
#if CORE_MOCK
int thunk_thk_printf1(const void *fmt) {
return ets_uart_printf(fmt);
}

#else
int thunk_thk_printf1(const char *fmt);
// Second stack thunked helper - this macro creates the global function thunk_thk_printf1
make_stack_thunk(thk_printf1);

// This function is called via thunk_thk_printf1 and will run with the BearSSL stack.
int thk_printf1(const char *fmt) {
return ets_uart_printf(fmt);
}
#endif
};
////////////////////////////////////////////////////////////////////

void setup(void) {
WiFi.persistent(false); // w/o this a flash write occurs at every boot
WiFi.mode(WIFI_OFF);
Expand All @@ -39,6 +63,10 @@ void setup(void) {
Serial.println(F("The Hardware Watchdog Timer Demo is starting ..."));
Serial.println();

// This allows us to test dumping a BearSSL stack after HWDT.
stack_thunk_add_ref();
thunk_thk_printf1("Using Thunk Stack to print this line.\n\n");

// We don't need this for this example; however, starting WiFi uses a little
// more of the SYS stack.
WiFi.mode(WIFI_STA);
Expand Down
0