Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
8d843e5b
Commit
8d843e5b
authored
Apr 02, 2018
by
devsaurus
Browse files
fix task wdt to handle PANIC situations and spiffs formatting
parent
cc34ac08
Changes
3
Hide whitespace changes
Inline
Side-by-side
components/platform/flash_api.c
View file @
8d843e5b
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include "esp_image_format.h"
#include "esp_image_format.h"
#include "esp_flash_data_types.h"
#include "esp_flash_data_types.h"
#include "esp_task_wdt.h"
#define FLASH_HDR_ADDR 0x1000
#define FLASH_HDR_ADDR 0x1000
...
@@ -171,3 +172,17 @@ uint32_t flash_rom_get_speed(void)
...
@@ -171,3 +172,17 @@ uint32_t flash_rom_get_speed(void)
}
}
return
0
;
return
0
;
}
}
esp_err_t
flash_erase
(
size_t
sector
)
{
#ifdef CONFIG_TASK_WDT
// re-init the task WDT, simulates feeding for the IDLE task
# ifdef CONFIG_TASK_WDT_PANIC
esp_task_wdt_init
(
CONFIG_TASK_WDT_TIMEOUT_S
,
true
);
# else
esp_task_wdt_init
(
CONFIG_TASK_WDT_TIMEOUT_S
,
false
);
# endif
#endif
return
spi_flash_erase_sector
(
sector
);
}
components/platform/include/flash_api.h
View file @
8d843e5b
...
@@ -19,7 +19,7 @@ uint32_t flash_rom_get_speed(void);
...
@@ -19,7 +19,7 @@ uint32_t flash_rom_get_speed(void);
#define FLASH_SIZE_16MBYTE (16 * 1024 * 1024)
#define FLASH_SIZE_16MBYTE (16 * 1024 * 1024)
#define flash_write spi_flash_write
#define flash_write spi_flash_write
#define
flash_erase
spi_flash_erase_
sector
esp_err_t
flash_erase
(
size_t
sector
);
#define flash_read spi_flash_read
#define flash_read spi_flash_read
#endif // __FLASH_API_H__
#endif // __FLASH_API_H__
sdkconfig.defaults
View file @
8d843e5b
...
@@ -18,3 +18,6 @@ CONFIG_TCP_MSL=5000
...
@@ -18,3 +18,6 @@ CONFIG_TCP_MSL=5000
# No filesystem partition found, attempting to create it...
# No filesystem partition found, attempting to create it...
# abort() was called at PC 0x400ecddd on core 0
# abort() was called at PC 0x400ecddd on core 0
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED=y
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED=y
# Enable panic handler for task wdt to reset the firmware upon wdt timeout
CONFIG_TASK_WDT_PANIC=y
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment