Skip to content

Commit 481cee6

Browse files
committed
Disable WDT in eboot while copying new sketch (#517)
1 parent 973ae39 commit 481cee6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

bootloaders/eboot/eboot.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#define SWRST do { (*((volatile uint32_t*) 0x60000700)) |= 0x80000000; } while(0);
1616

17+
extern void ets_wdt_enable(void);
18+
extern void ets_wdt_disable(void);
1719

1820
int load_app_from_flash_raw(const uint32_t flash_addr)
1921
{
@@ -87,7 +89,9 @@ int copy_raw(const uint32_t src_addr,
8789
uint32_t left = ((size+buffer_size-1) & ~(buffer_size-1));
8890
uint32_t saddr = src_addr;
8991
uint32_t daddr = dst_addr;
90-
92+
93+
ets_wdt_disable();
94+
9195
while (left) {
9296
if (SPIEraseSector(daddr/buffer_size)) {
9397
return 2;
@@ -103,6 +107,8 @@ int copy_raw(const uint32_t src_addr,
103107
left -= buffer_size;
104108
}
105109

110+
ets_wdt_enable();
111+
106112
return 0;
107113
}
108114

bootloaders/eboot/eboot.elf

43 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)