Merge branch 'bugfix/esp32s2_embedded_flash' into 'master'

esp32s2: Fix embedded flash feature flag for ESP32-S2FH16, ESP32-S2FH32

Closes IDFGH-3872

See merge request espressif/esp-idf!11237
This commit is contained in:
Angus Gratton 2020-11-18 06:27:14 +08:00
commit bed20c84d7

View File

@ -17,6 +17,7 @@
#include "esp_system.h"
#include "esp_private/system_internal.h"
#include "esp_attr.h"
#include "esp_efuse.h"
#include "esp_log.h"
#include "esp32s2/rom/cache.h"
#include "esp_rom_uart.h"
@ -112,9 +113,23 @@ void IRAM_ATTR esp_restart_noos(void)
void esp_chip_info(esp_chip_info_t *out_info)
{
uint32_t pkg_ver = esp_efuse_get_pkg_ver();
memset(out_info, 0, sizeof(*out_info));
out_info->model = CHIP_ESP32S2;
out_info->cores = 1;
out_info->features = CHIP_FEATURE_WIFI_BGN;
switch (pkg_ver) {
case 0: // ESP32-S2
break;
case 1: // ESP32-S2FH16
// fallthrough
case 2: // ESP32-S2FH32
out_info->features |= CHIP_FEATURE_EMB_FLASH;
break;
default: // New package, features unknown
break;
}
}