17
17
18
18
#define SWRST do { (*((volatile uint32_t*) 0x60000700)) |= 0x80000000; } while(0);
19
19
20
- extern void ets_wdt_enable (void );
20
+ /*
21
+ After Power Enable Pin, EXT_RST, or HWDT event, at "main()" in eboot, WDT is
22
+ disabled. Key WDT hardware registers are zero.
23
+
24
+ After "ESP.restart()" and other soft restarts, at "main()" in eboot, WDT is enabled.
25
+ */
26
+ extern void ets_wdt_enable (uint32_t mode , uint32_t arg1 , uint32_t arg2 );
21
27
extern void ets_wdt_disable (void );
22
28
23
29
int print_version (const uint32_t flash_addr )
@@ -241,12 +247,12 @@ int main()
241
247
242
248
ets_wdt_disable ();
243
249
res = copy_raw (cmd .args [0 ], cmd .args [1 ], cmd .args [2 ], false);
244
- ets_wdt_enable ();
250
+ ets_wdt_enable (4 , 12 , 12 ); // WDT about 13 secs.
245
251
246
252
ets_printf ("%d\n" , res );
247
253
#if 0
248
- //devyte: this verify step below (cmp:) only works when the end of copy operation above does not overwrite the
249
- //beginning of the image in the empty area, see #7458. Disabling for now.
254
+ //devyte: this verify step below (cmp:) only works when the end of copy operation above does not overwrite the
255
+ //beginning of the image in the empty area, see #7458. Disabling for now.
250
256
//TODO: replace the below verify with hash type, crc, or similar.
251
257
// Verify the copy
252
258
ets_printf ("cmp:" );
@@ -257,7 +263,7 @@ int main()
257
263
}
258
264
259
265
ets_printf ("%d\n" , res );
260
- #endif
266
+ #endif
261
267
if (res == 0 ) {
262
268
cmd .action = ACTION_LOAD_APP ;
263
269
cmd .args [0 ] = cmd .args [1 ];
0 commit comments