mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-04 00:51:42 +01:00 
			
		
		
		
	Merge branch 'master' into feature/esp32s2beta_update
This commit is contained in:
		@@ -11,8 +11,7 @@
 | 
			
		||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
// See the License for the specific language governing permissions and
 | 
			
		||||
// limitations under the License.
 | 
			
		||||
#ifndef __ESP32_FLASH_ENCRYPT_H
 | 
			
		||||
#define __ESP32_FLASH_ENCRYPT_H
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <stdbool.h>
 | 
			
		||||
#include "esp_attr.h"
 | 
			
		||||
@@ -23,6 +22,18 @@
 | 
			
		||||
#include "soc/efuse_periph.h"
 | 
			
		||||
#include "sdkconfig.h"
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* @brief Flash encryption mode based on efuse values
 | 
			
		||||
*/
 | 
			
		||||
typedef enum {
 | 
			
		||||
    ESP_FLASH_ENC_MODE_DISABLED,          // flash encryption is not enabled (flash crypt cnt=0)
 | 
			
		||||
    ESP_FLASH_ENC_MODE_DEVELOPMENT,       // flash encryption is enabled but for Development (reflash over UART allowed)
 | 
			
		||||
    ESP_FLASH_ENC_MODE_RELEASE            // flash encryption is enabled for Release (reflash over UART disabled)
 | 
			
		||||
} esp_flash_enc_mode_t;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file esp_partition.h
 | 
			
		||||
 * @brief Support functions for flash encryption features
 | 
			
		||||
@@ -117,8 +128,18 @@ esp_err_t esp_flash_encrypt_region(uint32_t src_addr, size_t data_length);
 | 
			
		||||
 * is enabled but secure boot is not used. This should protect against
 | 
			
		||||
 * serial re-flashing of an unauthorised code in absence of secure boot.
 | 
			
		||||
 *
 | 
			
		||||
 * @return
 | 
			
		||||
 */
 | 
			
		||||
void esp_flash_write_protect_crypt_cnt();
 | 
			
		||||
 | 
			
		||||
/** @brief Return the flash encryption mode
 | 
			
		||||
 *
 | 
			
		||||
 * The API is called during boot process but can also be called by
 | 
			
		||||
 * application to check the current flash encryption mode of ESP32
 | 
			
		||||
 *
 | 
			
		||||
 * @return
 | 
			
		||||
 */
 | 
			
		||||
esp_flash_enc_mode_t esp_get_flash_encryption_mode();
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user