Flash Encryption; Introduction - Espressif ESP32-S2 Programming Manual

Table of Contents

Advertisement

Chapter 4. API Guides
UBSAN output
When UBSAN detects an error, a message and the backtrace are printed, for example:
Undefined behavior of
Backtrace:0x4008b383:0x3ffcd8b0 0x4008c791:0x3ffcd8d0
0x4008c6be:0x3ffcd950 0x400db74f:0x3ffcd970 0x400db99c:0x3ffcd9a0
When using
IDF
Monitor, the backtrace will be decoded to function names and source code locations, pointing to the
location where the issue has happened (here it is main.c:128):
0x4008b383: panic_abort at
0x4008c791: esp_system_abort at
c:106
0x4008c587: __ubsan_default_handler at
ubsan.c:152
0x4008c6be: __ubsan_handle_out_of_bounds at
ubsan.c:223
0x400db74f: test_ub at
0x400db99c: app_main at
The types of errors reported by UBSAN can be as follows:
Name
type_mismatch,
type_mismatch_v1
add_overflow,
sub_overflow,
mul_overflow, negate_overflow
divrem_overflow
shift_out_of_bounds
out_of_bounds
unreachable
missing_return
vla_bound_not_positive
load_invalid_value
nonnull_arg
nonnull_return
builtin_unreachable
pointer_overflow

4.13 Flash Encryption

This is a quick start guide to ESP32-S2' s flash encryption feature. Using an application code example, it demonstrates
how to test and verify flash encryption operations during development and production.

4.13.1 Introduction

Flash encryption is intended for encrypting the contents of the ESP32-S2' s off-chip flash memory. Once this feature
is enabled, firmware is flashed as plaintext, and then the data is encrypted in place on the first boot. As a result, physical
Espressif Systems
type
out_of_bounds
/path/to/esp-idf/components/esp_system/panic.c:367
/path/to/esp-idf/components/esp_system/system_api.
/path/to/esp-idf/components/esp_system/
main.c:128
main.c:56
(discriminator 1)
Meaning
Incorrect pointer value: null, unaligned, not compatible with the
given type.
Integer overflow during addition, subtraction, multiplication, nega-
tion.
Integer division by 0 or INT_MIN.
Overflow in left or right shift operators.
Access outside of bounds of an array.
Unreachable code executed.
Non-void function has reached its end without returning a value
(C++ only).
Size of variable length array is not positive.
Value of bool or enum (C++ only) variable is invalid (out of
bounds).
Null argument passed to a function which is declared with a non-
null attribute.
Null value returned from a function which is declared with re-
turns_nonnull attribute.
__builtin_unreachable function called.
Overflow in pointer arithmetic.
1342
Submit Document Feedback
0x4008c587:0x3ffcd8f0␣
/path/to/esp-idf/components/esp_system/
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF