bootloader: Enable clock glitch detection

Reset the device when clock glitch detected. Clock glitch detection is
only active in bootloader
This commit is contained in:
Sachin Parekh
2021-08-27 09:37:52 +05:30
parent 87b958c814
commit bf1dde7233
17 changed files with 250 additions and 20 deletions

View File

@@ -76,6 +76,7 @@
#include "bootloader_utility.h"
#include "bootloader_sha.h"
#include "bootloader_console.h"
#include "bootloader_soc.h"
#include "esp_efuse.h"
static const char *TAG = "boot";
@@ -636,6 +637,12 @@ static void load_image(const esp_image_metadata_t *image_data)
ESP_LOGI(TAG, "Disabling RNG early entropy source...");
bootloader_random_disable();
/* Disable glitch reset after all the security checks are completed.
* Glitch detection can be falsely triggered by EMI interference (high RF TX power, etc)
* and to avoid such false alarms, disable it.
*/
bootloader_ana_clock_glitch_reset_config(false);
// copy loaded segments to RAM, set up caches for mapped segments, and start application
unpack_load_app(image_data);
}