forked from espressif/esp-idf
Compare commits
461 Commits
fix_esp_se
...
v5.3-rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44f58ecb51 | ||
|
|
42cf452da3 | ||
|
|
33c3d327c5 | ||
|
|
083db8a169 | ||
|
|
ffe0de9607 | ||
|
|
32334c7a25 | ||
|
|
a56a4b8980 | ||
|
|
9417e857a8 | ||
|
|
6b1a173030 | ||
|
|
350d4c03da | ||
|
|
2543313f80 | ||
|
|
d617f8d5b0 | ||
|
|
91aab8e6fd | ||
|
|
8cabe4380b | ||
|
|
4cfea9e864 | ||
|
|
e7b6fb75d4 | ||
|
|
d83e4bcfbe | ||
|
|
92c239d9b0 | ||
|
|
e722672fcc | ||
|
|
2d397782d8 | ||
|
|
397b1e51a5 | ||
|
|
6c7c212f98 | ||
|
|
c56b21bbd5 | ||
|
|
8f9467dc2b | ||
|
|
3105644642 | ||
|
|
872319ac5e | ||
|
|
34e5669b7b | ||
|
|
11d946582c | ||
|
|
0a1dc07248 | ||
|
|
1ae89b72cb | ||
|
|
18470061ab | ||
|
|
31439dfd77 | ||
|
|
561146f52b | ||
|
|
32c12e57da | ||
|
|
d6eedc04bf | ||
|
|
69ab9d7a17 | ||
|
|
33e6eaaabf | ||
|
|
04429c9042 | ||
|
|
6eae7bc996 | ||
|
|
dd5a5f1cf2 | ||
|
|
79c48b4707 | ||
|
|
ce7393f67b | ||
|
|
fd6720c2e4 | ||
|
|
8562e3be12 | ||
|
|
f7baa7feb2 | ||
|
|
a21f65cb5b | ||
|
|
430d65225e | ||
|
|
064fa71277 | ||
|
|
9fbec0a819 | ||
|
|
cabf41c1c6 | ||
|
|
357e0f9bf1 | ||
|
|
1b8bae3e15 | ||
|
|
5d480b9e89 | ||
|
|
9e95b9b29c | ||
|
|
14d93dea75 | ||
|
|
7e5ab45fbb | ||
|
|
1056a02ba9 | ||
|
|
8bcedab874 | ||
|
|
dbe5a59412 | ||
|
|
8a668d6c03 | ||
|
|
81b43829a2 | ||
|
|
ceb6ec92b3 | ||
|
|
8887599119 | ||
|
|
32c6ee8532 | ||
|
|
2ac0fc1f6a | ||
|
|
79b7e2cd97 | ||
|
|
7d47aecaa8 | ||
|
|
e2c042da21 | ||
|
|
ce145a2c92 | ||
|
|
a3a9624ca2 | ||
|
|
e6230e49cb | ||
|
|
9ddf01407f | ||
|
|
edc2bd8aab | ||
|
|
a70355be55 | ||
|
|
02b60f59db | ||
|
|
aaf371027d | ||
|
|
171e0a21a1 | ||
|
|
f6348050e4 | ||
|
|
2ab144dc3a | ||
|
|
1854036f92 | ||
|
|
26cb10acbf | ||
|
|
a27aa02fa3 | ||
|
|
a641428941 | ||
|
|
d917f0fa1b | ||
|
|
8093516420 | ||
|
|
3785506ec1 | ||
|
|
ea142bb6d1 | ||
|
|
e282468502 | ||
|
|
3db95e4f0e | ||
|
|
ca36dff148 | ||
|
|
fea0f0cf26 | ||
|
|
c8264eb519 | ||
|
|
7ac551b870 | ||
|
|
c48f84e0ac | ||
|
|
4641392375 | ||
|
|
7f0248f39a | ||
|
|
3ccffd46f1 | ||
|
|
c4bda59c31 | ||
|
|
c3a47bf365 | ||
|
|
687a40df4e | ||
|
|
3b0e048f0e | ||
|
|
bbf0d76ac3 | ||
|
|
cb8670e2bc | ||
|
|
d83e7ea505 | ||
|
|
f750f4c6f7 | ||
|
|
10f8cc42fb | ||
|
|
321f51d416 | ||
|
|
e819b8c0b9 | ||
|
|
679df9ec6f | ||
|
|
a326f15120 | ||
|
|
cfc5da167d | ||
|
|
e63d6582cc | ||
|
|
3f5037866b | ||
|
|
cf123b3626 | ||
|
|
7f0673f634 | ||
|
|
54f30cc94b | ||
|
|
fd7c809282 | ||
|
|
ddbf9936d6 | ||
|
|
bbc44b486e | ||
|
|
b4dc51b873 | ||
|
|
46677555ed | ||
|
|
6e2950dde2 | ||
|
|
c349247236 | ||
|
|
367b0c16f1 | ||
|
|
de0990e58c | ||
|
|
f1df3eb99b | ||
|
|
7c62ad5434 | ||
|
|
8ae12473b5 | ||
|
|
f215c2fd41 | ||
|
|
07d53ad11a | ||
|
|
8377fe746a | ||
|
|
e38e1a0389 | ||
|
|
0ef2599e3c | ||
|
|
98e99e712f | ||
|
|
943dd72da0 | ||
|
|
39d0f4b650 | ||
|
|
5c618745fe | ||
|
|
dbf8726b47 | ||
|
|
32a2ddceaa | ||
|
|
8445486303 | ||
|
|
e207b08e28 | ||
|
|
4f11dd7e21 | ||
|
|
1c6a8b4521 | ||
|
|
ffbb1aba5e | ||
|
|
3ffea37812 | ||
|
|
0868604664 | ||
|
|
0b8952dc2e | ||
|
|
1de232fb98 | ||
|
|
15512f4170 | ||
|
|
fd0ea43496 | ||
|
|
5887426bad | ||
|
|
3860cc8dac | ||
|
|
3efe49f26a | ||
|
|
01e02aec6c | ||
|
|
d6a3ed0637 | ||
|
|
784abd1ae0 | ||
|
|
b8122ec6b3 | ||
|
|
b6bc597903 | ||
|
|
33ac88cd31 | ||
|
|
dafc3b3cd5 | ||
|
|
bee6044a24 | ||
|
|
84660a822a | ||
|
|
bde502ed27 | ||
|
|
5634a3260e | ||
|
|
cd4c71e20f | ||
|
|
ab81888705 | ||
|
|
67f0bfa8bc | ||
|
|
421c94ded5 | ||
|
|
a31806d076 | ||
|
|
da43ec0425 | ||
|
|
832337bdee | ||
|
|
9230a25140 | ||
|
|
f20f0ae8d1 | ||
|
|
726ed08ee2 | ||
|
|
5feffad9a1 | ||
|
|
eac00e82d1 | ||
|
|
dbccfbb2e7 | ||
|
|
be9c4ebf44 | ||
|
|
de1d006ba3 | ||
|
|
f58b63d31e | ||
|
|
9713bd63a4 | ||
|
|
05f44bddf0 | ||
|
|
65d9300b5c | ||
|
|
0a3d59a4fa | ||
|
|
45c7eb4d4b | ||
|
|
a71f265d25 | ||
|
|
b2dcc24335 | ||
|
|
88c0ea49e3 | ||
|
|
cc869c6ab5 | ||
|
|
87fd8b41d8 | ||
|
|
fccc309499 | ||
|
|
9aea2d3395 | ||
|
|
6192507987 | ||
|
|
7f61f74aa0 | ||
|
|
7474a450c2 | ||
|
|
41515a9086 | ||
|
|
4787e928a2 | ||
|
|
c9f8fc0405 | ||
|
|
12d480423b | ||
|
|
e148263565 | ||
|
|
5d844e57ed | ||
|
|
b2ff20d94c | ||
|
|
e8852d5c38 | ||
|
|
2f0c9b3584 | ||
|
|
09cbbaaf7c | ||
|
|
dab7fdd6f0 | ||
|
|
d6b3b8feeb | ||
|
|
f6420436eb | ||
|
|
23cfe0826b | ||
|
|
30ea848335 | ||
|
|
6a86351373 | ||
|
|
e5429b256a | ||
|
|
4daaa9c587 | ||
|
|
091da3d631 | ||
|
|
c8474d48f8 | ||
|
|
6e7a9de65e | ||
|
|
6cd960928a | ||
|
|
b07a1470c5 | ||
|
|
737b5edd5b | ||
|
|
d9f9f79270 | ||
|
|
a6c2c4149d | ||
|
|
fe32b34b20 | ||
|
|
ae876915ec | ||
|
|
1542b768fd | ||
|
|
e10c977834 | ||
|
|
9ab7f325cc | ||
|
|
bbe96641b1 | ||
|
|
e22c101034 | ||
|
|
63f019565b | ||
|
|
3a5ba85419 | ||
|
|
a168f4cc9b | ||
|
|
df4195062d | ||
|
|
8800e9d0e5 | ||
|
|
2f1b81cd14 | ||
|
|
87d4172ee5 | ||
|
|
7f9b5deae1 | ||
|
|
3d959421b1 | ||
|
|
52a922f953 | ||
|
|
baf6028974 | ||
|
|
60c2068fef | ||
|
|
10f89fe52e | ||
|
|
b1b182f258 | ||
|
|
1129f0834e | ||
|
|
58ebdb7ae3 | ||
|
|
48e06fafea | ||
|
|
6bb35c551c | ||
|
|
0be44b6ccc | ||
|
|
bf604e91a6 | ||
|
|
dcc7cf9379 | ||
|
|
5a7a9c0638 | ||
|
|
91cedfe89d | ||
|
|
0d94b1cd89 | ||
|
|
1b1005a1d8 | ||
|
|
cc48efc6ec | ||
|
|
88b300d064 | ||
|
|
f9b58b0c73 | ||
|
|
3a7aafe7d6 | ||
|
|
e23d24a65d | ||
|
|
687064b2f8 | ||
|
|
168ff6e268 | ||
|
|
8e66d38959 | ||
|
|
5890c7450d | ||
|
|
2c96e097c9 | ||
|
|
f3b7e0502a | ||
|
|
2f10ca582b | ||
|
|
0928ff027b | ||
|
|
6eba7a536a | ||
|
|
75faae29a8 | ||
|
|
0c3a0d6c9a | ||
|
|
9f04d1ac36 | ||
|
|
b8d9da5c03 | ||
|
|
52b9c5d666 | ||
|
|
3f632df143 | ||
|
|
5ec2be4ba3 | ||
|
|
1d3d63c438 | ||
|
|
e7ba614a04 | ||
|
|
dbf757118a | ||
|
|
0c2c962b19 | ||
|
|
1f0d27a2c6 | ||
|
|
1aaae85ad2 | ||
|
|
85048f35e3 | ||
|
|
1a7c782905 | ||
|
|
cf4cf23741 | ||
|
|
236556d1ea | ||
|
|
07669b8012 | ||
|
|
e13bb3d734 | ||
|
|
bb4ba96545 | ||
|
|
1bf9c822f9 | ||
|
|
bb466097e5 | ||
|
|
8b369072f9 | ||
|
|
d91dfe3510 | ||
|
|
2396dc5ff7 | ||
|
|
ce7ceb8d9d | ||
|
|
5ec85c0bfd | ||
|
|
7c49b1da55 | ||
|
|
8805685f72 | ||
|
|
a3d77114b6 | ||
|
|
021dc8747c | ||
|
|
c7f146b671 | ||
|
|
86a49de1eb | ||
|
|
89218b35e4 | ||
|
|
51b6d16b43 | ||
|
|
9e74564ba5 | ||
|
|
9ebc8f02a9 | ||
|
|
7b10c2421f | ||
|
|
0c5bce6918 | ||
|
|
bef1fba3bc | ||
|
|
64c062047f | ||
|
|
157c5b52e3 | ||
|
|
c97ab134ef | ||
|
|
5899701b68 | ||
|
|
4ec0065d74 | ||
|
|
fe92d9ee60 | ||
|
|
4c6cf06838 | ||
|
|
464f4c9cc6 | ||
|
|
eb8dad2fa6 | ||
|
|
856a299ba8 | ||
|
|
be9c7145f9 | ||
|
|
d638267741 | ||
|
|
f3a73cbce3 | ||
|
|
41ff5a2f43 | ||
|
|
95cfd3987b | ||
|
|
520beb865c | ||
|
|
e53ca8e018 | ||
|
|
68be49d2cf | ||
|
|
686878497e | ||
|
|
c046d87561 | ||
|
|
fdb4197d02 | ||
|
|
e11f030427 | ||
|
|
beebbada64 | ||
|
|
6da7a46bfa | ||
|
|
d2551d6e4b | ||
|
|
4cf29dfcef | ||
|
|
3dbba47d8c | ||
|
|
02c2356cb1 | ||
|
|
8639f69ed7 | ||
|
|
19ab395364 | ||
|
|
a7266400be | ||
|
|
1847e53909 | ||
|
|
285ba1fcf2 | ||
|
|
5c9392d177 | ||
|
|
6a92c1485a | ||
|
|
c91bdda9f3 | ||
|
|
f63e544dc3 | ||
|
|
0680af1269 | ||
|
|
2decfbc007 | ||
|
|
3640c1ecba | ||
|
|
cbb43bb4c4 | ||
|
|
0dc29caf4a | ||
|
|
5f07f64802 | ||
|
|
e4f1c01197 | ||
|
|
2ed780b686 | ||
|
|
a9383cb433 | ||
|
|
5e817df25f | ||
|
|
bd8d7ea76a | ||
|
|
352ee6fc26 | ||
|
|
7403b8d68d | ||
|
|
f27e117b5b | ||
|
|
a621402e1f | ||
|
|
a08558a853 | ||
|
|
2cad39aee5 | ||
|
|
173bb82f45 | ||
|
|
8472467721 | ||
|
|
2f6fb59b6b | ||
|
|
f324e75c64 | ||
|
|
1a1a708699 | ||
|
|
24e5e3aef1 | ||
|
|
d8bc05c5d0 | ||
|
|
bfa95cdd75 | ||
|
|
199dc389cc | ||
|
|
b400a8cd72 | ||
|
|
4dc565b7d0 | ||
|
|
cbcd346171 | ||
|
|
f1d1dfd1ef | ||
|
|
dd20d1f2b5 | ||
|
|
4e850f158e | ||
|
|
ea010f84ef | ||
|
|
68a9c09c49 | ||
|
|
53c4c08283 | ||
|
|
89a612aea0 | ||
|
|
a9dcc3964d | ||
|
|
8503709d85 | ||
|
|
4eacfd6ee1 | ||
|
|
9eb61ef5a7 | ||
|
|
7165a3bdbb | ||
|
|
1b331d24b3 | ||
|
|
fe4b401ab2 | ||
|
|
ebc9d02146 | ||
|
|
ec50cd7d7e | ||
|
|
0cf4889f22 | ||
|
|
b9f15ba3ab | ||
|
|
d22f9a97aa | ||
|
|
90188040fb | ||
|
|
ea1a10da17 | ||
|
|
7c54373146 | ||
|
|
209fbfc18b | ||
|
|
8545eeb4ef | ||
|
|
a22d0df155 | ||
|
|
c706096f45 | ||
|
|
b8ed93eec0 | ||
|
|
840ec6579f | ||
|
|
7aed3eb3bc | ||
|
|
fe628d5951 | ||
|
|
855d1eb170 | ||
|
|
8ed42582fe | ||
|
|
5428555092 | ||
|
|
8f091de9c2 | ||
|
|
ae0eabec53 | ||
|
|
6b0a815b78 | ||
|
|
a04f786380 | ||
|
|
a6d8251366 | ||
|
|
9fd92e8bf4 | ||
|
|
d42e894a74 | ||
|
|
bf415f580f | ||
|
|
55a8a18fb7 | ||
|
|
a61a367bc4 | ||
|
|
c19e762c89 | ||
|
|
6fea6aae8c | ||
|
|
027193ca07 | ||
|
|
8bd2287233 | ||
|
|
aa1c3af4c4 | ||
|
|
577a50b02a | ||
|
|
b11014a7c6 | ||
|
|
901f937698 | ||
|
|
39771b6c81 | ||
|
|
b026a7c915 | ||
|
|
f82fea4c1b | ||
|
|
60ab9631d7 | ||
|
|
91c4a94f61 | ||
|
|
df211933ff | ||
|
|
e486f3b944 | ||
|
|
ccca8b74eb | ||
|
|
7d7d9d7090 | ||
|
|
0ee7d4d17a | ||
|
|
a246aa2973 | ||
|
|
2508d3f23b | ||
|
|
b494330381 | ||
|
|
ddc357fcca | ||
|
|
6a5ab20489 | ||
|
|
30fce03e35 | ||
|
|
212f316f24 | ||
|
|
0fcc940bc1 | ||
|
|
b43fc4d63a | ||
|
|
7fb317655d | ||
|
|
49aaac0013 | ||
|
|
d910ca7fa8 | ||
|
|
935da554c9 | ||
|
|
5b3996885c | ||
|
|
7c57624b66 | ||
|
|
e56f92aab4 | ||
|
|
3386c594b4 | ||
|
|
0440d582dc | ||
|
|
4fb58d56b4 | ||
|
|
665883229e | ||
|
|
a85d1e1eca | ||
|
|
14315bb751 | ||
|
|
fa866b49ca | ||
|
|
ebe1141b25 | ||
|
|
cb5bc35f2e | ||
|
|
55658d4c36 | ||
|
|
f1b9b357e4 |
@@ -1,4 +1,4 @@
|
||||
[codespell]
|
||||
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb,components/wpa_supplicant/*,components/esp_wifi/*,*.pem
|
||||
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci,unstall,unstalling,hart,wheight,wel,ot,fane,assertIn
|
||||
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb,components/wpa_supplicant/*,components/esp_wifi/*
|
||||
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci,unstall,unstalling,hart,wheight,ot
|
||||
write-changes = true
|
||||
|
||||
2
.github/workflows/pre_commit_check.yml
vendored
2
.github/workflows/pre_commit_check.yml
vendored
@@ -40,5 +40,3 @@ jobs:
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
# Run pre-commit for PowerShell scripts check
|
||||
pre-commit run --hook-stage manual check-powershell-scripts --from-ref base_ref --to-ref pr_ref --show-diff-on-failure
|
||||
|
||||
@@ -30,6 +30,4 @@ include:
|
||||
- '.gitlab/ci/integration_test.yml'
|
||||
- '.gitlab/ci/host-test.yml'
|
||||
- '.gitlab/ci/deploy.yml'
|
||||
- '.gitlab/ci/post_deploy.yml'
|
||||
- '.gitlab/ci/retry_failed_jobs.yml'
|
||||
- '.gitlab/ci/test-win.yml'
|
||||
|
||||
@@ -2,243 +2,5 @@
|
||||
#
|
||||
# https://docs.gitlab.com/ee/user/project/code_owners.html#the-syntax-of-code-owners-files
|
||||
#
|
||||
# If more than one rule matches a given file, the latest rule is used.
|
||||
# The file should be generally kept sorted, except when it is necessary
|
||||
# to use a different order due to the fact above. In that case, use
|
||||
# '# sort-order-reset' comment line to reset the sort order.
|
||||
#
|
||||
# Recipes for a few common cases:
|
||||
#
|
||||
# 1. Specific directory with all its contents:
|
||||
#
|
||||
# /components/app_trace/
|
||||
#
|
||||
# Note the trailing slash!
|
||||
#
|
||||
# 2. File with certain extension in any subdirectory of a certain directory:
|
||||
#
|
||||
# /examples/**/*.py
|
||||
#
|
||||
# This includes an *.py files in /examples/ directory as well.
|
||||
#
|
||||
# 3. Contents of a directory with a certain name, anywhere in the tree:
|
||||
#
|
||||
# test_*_host/
|
||||
#
|
||||
# Will match everything under components/efuse/test_efuse_host/,
|
||||
# components/heap/test_multi_heap_host/, components/lwip/test_afl_host/, etc.
|
||||
#
|
||||
# 4. Same as above, except limited to a specific place in the tree:
|
||||
#
|
||||
# /components/esp32*/
|
||||
#
|
||||
# Matches everything under /components/esp32, /components/esp32s2, etc.
|
||||
# Doesn't match /tools/some-test/components/esp32s5.
|
||||
#
|
||||
# 5. Specific file:
|
||||
#
|
||||
# /tools/tools.json
|
||||
#
|
||||
# 6. File with a certain name anywhere in the tree
|
||||
#
|
||||
# .gitignore
|
||||
#
|
||||
|
||||
* @esp-idf-codeowners/other
|
||||
|
||||
/.* @esp-idf-codeowners/tools
|
||||
/.codespellrc @esp-idf-codeowners/ci
|
||||
/.github/workflows/ @esp-idf-codeowners/ci
|
||||
/.gitlab-ci.yml @esp-idf-codeowners/ci
|
||||
/.gitlab/ci/ @esp-idf-codeowners/ci
|
||||
/.pre-commit-config.yaml @esp-idf-codeowners/ci
|
||||
/.readthedocs.yml @esp-idf-codeowners/docs
|
||||
/.vale.ini @esp-idf-codeowners/docs
|
||||
/CMakeLists.txt @esp-idf-codeowners/build-config
|
||||
/COMPATIBILITY*.md @esp-idf-codeowners/peripherals
|
||||
/CONTRIBUTING.md @esp-idf-codeowners/docs
|
||||
/Kconfig @esp-idf-codeowners/build-config
|
||||
/README*.md @esp-idf-codeowners/docs
|
||||
/SUPPORT_POLICY*.md @esp-idf-codeowners/docs
|
||||
/add_path.sh @esp-idf-codeowners/tools
|
||||
/conftest.py @esp-idf-codeowners/ci
|
||||
/export.* @esp-idf-codeowners/tools
|
||||
/install.* @esp-idf-codeowners/tools
|
||||
/pytest.ini @esp-idf-codeowners/ci
|
||||
/sdkconfig.rename @esp-idf-codeowners/build-config
|
||||
/sonar-project.properties @esp-idf-codeowners/ci
|
||||
|
||||
# sort-order-reset
|
||||
|
||||
/components/app_trace/ @esp-idf-codeowners/debugging
|
||||
/components/app_update/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/bootloader*/ @esp-idf-codeowners/system @esp-idf-codeowners/security
|
||||
/components/bootloader_support/bootloader_flash/ @esp-idf-codeowners/peripherals
|
||||
/components/bt/ @esp-idf-codeowners/bluetooth
|
||||
/components/cmock/ @esp-idf-codeowners/system
|
||||
/components/console/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities/console
|
||||
/components/cxx/ @esp-idf-codeowners/system
|
||||
/components/driver/ @esp-idf-codeowners/peripherals
|
||||
/components/efuse/ @esp-idf-codeowners/system
|
||||
/components/esp_adc/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_app_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/esp_bootloader_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
|
||||
/components/esp_coex/ @esp-idf-codeowners/wifi @esp-idf-codeowners/bluetooth @esp-idf-codeowners/ieee802154
|
||||
/components/esp_common/ @esp-idf-codeowners/system
|
||||
/components/esp_driver_*/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_driver_sdmmc/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/storage
|
||||
/components/esp_eth/ @esp-idf-codeowners/network
|
||||
/components/esp_event/ @esp-idf-codeowners/system
|
||||
/components/esp_gdbstub/ @esp-idf-codeowners/debugging
|
||||
/components/esp_hid/ @esp-idf-codeowners/bluetooth
|
||||
/components/esp_http_client/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_http_server/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_https_ota/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_https_server/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_hw_support/ @esp-idf-codeowners/system @esp-idf-codeowners/peripherals
|
||||
/components/esp_hw_support/lowpower/ @esp-idf-codeowners/power-management
|
||||
/components/esp_lcd/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_local_ctrl/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_mm/ @esp-idf-codeowners/peripherals
|
||||
/components/esp_netif/ @esp-idf-codeowners/network
|
||||
/components/esp_netif_stack/ @esp-idf-codeowners/network
|
||||
/components/esp_partition/ @esp-idf-codeowners/storage
|
||||
/components/esp_phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
|
||||
/components/esp_pm/ @esp-idf-codeowners/power-management @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/system
|
||||
/components/esp_psram/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/esp_ringbuf/ @esp-idf-codeowners/system
|
||||
/components/esp_rom/ @esp-idf-codeowners/system @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi
|
||||
/components/esp_system/ @esp-idf-codeowners/system
|
||||
/components/esp_timer/ @esp-idf-codeowners/system
|
||||
/components/esp-tls/ @esp-idf-codeowners/app-utilities
|
||||
/components/esp_vfs_*/ @esp-idf-codeowners/storage
|
||||
/components/esp_vfs_console/ @esp-idf-codeowners/storage @esp-idf-codeowners/system
|
||||
/components/esp_wifi/ @esp-idf-codeowners/wifi
|
||||
/components/espcoredump/ @esp-idf-codeowners/debugging
|
||||
/components/esptool_py/ @esp-idf-codeowners/tools
|
||||
/components/fatfs/ @esp-idf-codeowners/storage
|
||||
/components/freertos/ @esp-idf-codeowners/system
|
||||
/components/hal/ @esp-idf-codeowners/peripherals
|
||||
/components/hal/test_apps/crypto/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/security
|
||||
/components/heap/ @esp-idf-codeowners/system
|
||||
/components/http_parser/ @esp-idf-codeowners/app-utilities
|
||||
/components/idf_test/ @esp-idf-codeowners/ci
|
||||
/components/ieee802154/ @esp-idf-codeowners/ieee802154
|
||||
/components/json/ @esp-idf-codeowners/app-utilities
|
||||
/components/linux/ @esp-idf-codeowners/system
|
||||
/components/log/ @esp-idf-codeowners/system
|
||||
/components/lwip/ @esp-idf-codeowners/lwip
|
||||
/components/mbedtls/ @esp-idf-codeowners/app-utilities/mbedtls @esp-idf-codeowners/security
|
||||
/components/mqtt/ @esp-idf-codeowners/network
|
||||
/components/newlib/ @esp-idf-codeowners/system @esp-idf-codeowners/toolchain
|
||||
/components/nvs_flash/ @esp-idf-codeowners/storage
|
||||
/components/nvs_sec_provider/ @esp-idf-codeowners/storage @esp-idf-codeowners/security
|
||||
/components/openthread/ @esp-idf-codeowners/ieee802154
|
||||
/components/partition_table/ @esp-idf-codeowners/system
|
||||
/components/perfmon/ @esp-idf-codeowners/debugging
|
||||
/components/protobuf-c/ @esp-idf-codeowners/app-utilities
|
||||
/components/protocomm/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/components/pthread/ @esp-idf-codeowners/system
|
||||
/components/riscv/ @esp-idf-codeowners/system
|
||||
/components/rt/ @esp-idf-codeowners/system
|
||||
/components/sdmmc/ @esp-idf-codeowners/storage
|
||||
/components/soc/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
|
||||
/components/spi_flash/ @esp-idf-codeowners/peripherals
|
||||
/components/spiffs/ @esp-idf-codeowners/storage
|
||||
/components/tcp_transport/ @esp-idf-codeowners/network
|
||||
/components/touch_element/ @esp-idf-codeowners/peripherals
|
||||
/components/ulp/ @esp-idf-codeowners/system
|
||||
/components/unity/ @esp-idf-codeowners/ci
|
||||
/components/usb/ @esp-idf-codeowners/peripherals/usb
|
||||
/components/vfs/ @esp-idf-codeowners/storage
|
||||
/components/wear_levelling/ @esp-idf-codeowners/storage
|
||||
/components/wifi_provisioning/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/components/wpa_supplicant/ @esp-idf-codeowners/wifi @esp-idf-codeowners/app-utilities/mbedtls
|
||||
/components/xtensa/ @esp-idf-codeowners/system
|
||||
|
||||
/docs/ @esp-idf-codeowners/docs
|
||||
/docs/**/api-guides/tools/ @esp-idf-codeowners/tools
|
||||
/docs/en/api-guides/core_dump.rst @esp-idf-codeowners/debugging
|
||||
/docs/en/api-guides/jtag-debugging/ @esp-idf-codeowners/debugging
|
||||
/docs/**/api-reference/bluetooth/ @esp-idf-codeowners/bluetooth
|
||||
/docs/**/api-reference/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
|
||||
/docs/**/api-reference/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/docs/**/api-reference/peripherals/usb* @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
|
||||
/docs/**/api-reference/peripherals/usb*/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
|
||||
/docs/**/api-reference/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/docs/**/api-reference/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/docs/**/api-reference/storage/ @esp-idf-codeowners/storage
|
||||
/docs/**/api-reference/system/ @esp-idf-codeowners/system
|
||||
/docs/**/security/ @esp-idf-codeowners/security
|
||||
/docs/**/migration-guides/ @esp-idf-codeowners/docs @esp-idf-codeowners/all-maintainers
|
||||
/docs/**/contribute/install-pre-commit-hook.rst @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
|
||||
/examples/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
|
||||
/examples/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
/examples/bluetooth/ @esp-idf-codeowners/bluetooth
|
||||
/examples/build_system/ @esp-idf-codeowners/build-config
|
||||
/examples/common_components/ @esp-idf-codeowners/system @esp-idf-codeowners/wifi @esp-idf-codeowners/lwip @esp-idf-codeowners/network
|
||||
/examples/custom_bootloader/ @esp-idf-codeowners/system
|
||||
/examples/cxx/ @esp-idf-codeowners/system
|
||||
/examples/ethernet/ @esp-idf-codeowners/network
|
||||
/examples/get-started/ @esp-idf-codeowners/system
|
||||
/examples/ieee802154/ @esp-idf-codeowners/ieee802154
|
||||
/examples/mesh/ @esp-idf-codeowners/wifi
|
||||
/examples/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
|
||||
/examples/openthread/ @esp-idf-codeowners/ieee802154
|
||||
/examples/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/examples/peripherals/usb/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
|
||||
/examples/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
|
||||
/examples/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/examples/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
|
||||
/examples/security/ @esp-idf-codeowners/security
|
||||
/examples/storage/ @esp-idf-codeowners/storage
|
||||
/examples/system/ @esp-idf-codeowners/system
|
||||
/examples/system/ota/ @esp-idf-codeowners/app-utilities
|
||||
/examples/wifi/ @esp-idf-codeowners/wifi
|
||||
/examples/zigbee/ @esp-idf-codeowners/ieee802154
|
||||
|
||||
/tools/ @esp-idf-codeowners/tools
|
||||
/tools/ble/ @esp-idf-codeowners/app-utilities
|
||||
/tools/catch/ @esp-idf-codeowners/ci
|
||||
/tools/ci/ @esp-idf-codeowners/ci
|
||||
/tools/cmake/ @esp-idf-codeowners/build-config
|
||||
/tools/cmake/toolchain-*.cmake @esp-idf-codeowners/toolchain
|
||||
/tools/esp_app_trace/ @esp-idf-codeowners/debugging
|
||||
/tools/esp_prov/ @esp-idf-codeowners/app-utilities
|
||||
/tools/gdb_panic_server.py @esp-idf-codeowners/debugging
|
||||
/tools/kconfig*/ @esp-idf-codeowners/build-config
|
||||
/tools/ldgen/ @esp-idf-codeowners/build-config
|
||||
/tools/mass_mfg/ @esp-idf-codeowners/app-utilities
|
||||
/tools/mocks/ @esp-idf-codeowners/system
|
||||
|
||||
/tools/test_apps/ @esp-idf-codeowners/ci
|
||||
/tools/test_apps/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
|
||||
|
||||
## Note: owners here should be the same as the owners for the same example subdir, above
|
||||
/tools/test_apps/build_system/ @esp-idf-codeowners/build-config
|
||||
/tools/test_apps/configs/ @esp-idf-codeowners/system
|
||||
/tools/test_apps/linux_compatible/ @esp-idf-codeowners/system
|
||||
/tools/test_apps/peripherals/ @esp-idf-codeowners/peripherals
|
||||
/tools/test_apps/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
|
||||
/tools/test_apps/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
|
||||
/tools/test_apps/security/ @esp-idf-codeowners/security
|
||||
/tools/test_apps/storage/ @esp-idf-codeowners/storage
|
||||
/tools/test_apps/system/ @esp-idf-codeowners/system
|
||||
|
||||
/tools/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
|
||||
/tools/test_build_system/ @esp-idf-codeowners/tools @esp-idf-codeowners/build-config
|
||||
|
||||
/tools/tools.json @esp-idf-codeowners/tools @esp-idf-codeowners/toolchain @esp-idf-codeowners/debugging
|
||||
|
||||
/tools/unit-test-app/ @esp-idf-codeowners/system @esp-idf-codeowners/tools
|
||||
|
||||
# sort-order-reset
|
||||
|
||||
/components/**/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
|
||||
|
||||
# ignore lists
|
||||
/tools/ci/check_copyright_config.yaml @esp-idf-codeowners/all-maintainers
|
||||
/tools/ci/check_copyright_ignore.txt @esp-idf-codeowners/all-maintainers
|
||||
/tools/ci/mypy_ignore_list.txt @esp-idf-codeowners/tools
|
||||
* @esp-idf-codeowners/all-maintainers
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
variables:
|
||||
IDF_TOOLCHAIN: clang
|
||||
TEST_BUILD_OPTS_EXTRA: ""
|
||||
TEST_DIR: tools/test_apps/system/clang_build_test
|
||||
TEST_DIR: tools/test_apps/system/cxx_pthread_bluetooth
|
||||
script:
|
||||
# CI specific options start from "--parallel-count xxx". could ignore when running locally
|
||||
- run_cmd python tools/ci/ci_build_apps.py $TEST_DIR -v
|
||||
@@ -112,22 +112,6 @@ fast_template_app:
|
||||
BUILD_COMMAND_ARGS: "-p"
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#######################
|
||||
# gnu_static_analyzer #
|
||||
#######################
|
||||
gcc_static_analyzer:
|
||||
extends:
|
||||
- .build_template_app_template
|
||||
- .rules:build:target_test
|
||||
stage: pre_check
|
||||
tags: [build, shiny]
|
||||
variables:
|
||||
CI_CCACHE_DISABLE: 1
|
||||
ANALYZING_APP: "examples/get-started/hello_world"
|
||||
script:
|
||||
- echo "CONFIG_COMPILER_STATIC_ANALYZER=y" >> ${ANALYZING_APP}/sdkconfig.defaults
|
||||
- python -m idf_build_apps build -vv -p ${ANALYZING_APP} -t all
|
||||
|
||||
########################################
|
||||
# Clang Build Apps Without Tests Cases #
|
||||
########################################
|
||||
@@ -159,7 +143,7 @@ build_clang_test_apps_esp32s3:
|
||||
# For RISCV clang generates '.linker-options' sections of type 'llvm_linker_options' in asm files.
|
||||
# See (https://llvm.org/docs/Extensions.html#linker-options-section-linker-options).
|
||||
# Binutils gas ignores them with warning.
|
||||
# TODO: LLVM-333, Use integrated assembler.
|
||||
# TODO: LLVM-112, Use integrated assembler.
|
||||
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'Warning: unrecognized section type'"
|
||||
|
||||
build_clang_test_apps_esp32c3:
|
||||
@@ -180,30 +164,11 @@ build_clang_test_apps_esp32c6:
|
||||
extends:
|
||||
- .build_clang_test_apps_riscv
|
||||
- .rules:build
|
||||
# TODO: c6 builds fail in master due to missing headers
|
||||
allow_failure: true
|
||||
variables:
|
||||
IDF_TARGET: esp32c6
|
||||
|
||||
build_clang_test_apps_esp32c5:
|
||||
extends:
|
||||
- .build_clang_test_apps_riscv
|
||||
- .rules:build
|
||||
variables:
|
||||
IDF_TARGET: esp32c5
|
||||
|
||||
build_clang_test_apps_esp32h2:
|
||||
extends:
|
||||
- .build_clang_test_apps_riscv
|
||||
- .rules:build
|
||||
variables:
|
||||
IDF_TARGET: esp32h2
|
||||
|
||||
build_clang_test_apps_esp32p4:
|
||||
extends:
|
||||
- .build_clang_test_apps_riscv
|
||||
- .rules:build
|
||||
variables:
|
||||
IDF_TARGET: esp32p4
|
||||
|
||||
######################
|
||||
# Build System Tests #
|
||||
######################
|
||||
@@ -323,7 +288,6 @@ build_child_pipeline:
|
||||
MR_MODIFIED_FILES: $MR_MODIFIED_FILES
|
||||
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
|
||||
BUILD_AND_TEST_ALL_APPS: $BUILD_AND_TEST_ALL_APPS
|
||||
REPORT_EXIT_CODE: $REPORT_EXIT_CODE
|
||||
# https://gitlab.com/gitlab-org/gitlab/-/issues/214340
|
||||
inherit:
|
||||
variables: false
|
||||
|
||||
@@ -12,7 +12,6 @@ stages:
|
||||
- test_deploy
|
||||
- deploy
|
||||
- post_deploy
|
||||
- retry_failed_jobs
|
||||
|
||||
variables:
|
||||
# System environment
|
||||
@@ -40,7 +39,7 @@ variables:
|
||||
GIT_FETCH_EXTRA_FLAGS: "--no-recurse-submodules --prune --prune-tags"
|
||||
# we're using .cache folder for caches
|
||||
GIT_CLEAN_FLAGS: -ffdx -e .cache/
|
||||
LATEST_GIT_TAG: v5.4-dev
|
||||
LATEST_GIT_TAG: v5.3-dev
|
||||
|
||||
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
|
||||
# by default we will fetch all submodules
|
||||
@@ -55,9 +54,9 @@ variables:
|
||||
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
|
||||
|
||||
# Docker images
|
||||
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v5.4:1"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v5.4:1-1"
|
||||
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v5.4:1"
|
||||
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v5.3:1"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v5.3:1-1"
|
||||
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v5.3:1"
|
||||
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:5"
|
||||
PRE_COMMIT_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-pre-commit:1"
|
||||
|
||||
@@ -73,7 +72,7 @@ variables:
|
||||
CI_PYTHON_CONSTRAINT_BRANCH: ""
|
||||
|
||||
# Update the filename for a specific ESP-IDF release. It is used only with CI_PYTHON_CONSTRAINT_BRANCH.
|
||||
CI_PYTHON_CONSTRAINT_FILE: "espidf.constraints.v5.4.txt"
|
||||
CI_PYTHON_CONSTRAINT_FILE: "espidf.constraints.v5.3.txt"
|
||||
|
||||
# Set this variable to repository name of a Python tool you wish to install and test in the context of ESP-IDF CI.
|
||||
# Keep the variable empty when not used.
|
||||
@@ -84,14 +83,8 @@ variables:
|
||||
# This is used only if CI_PYTHON_TOOL_REPO is not empty.
|
||||
CI_PYTHON_TOOL_BRANCH: ""
|
||||
|
||||
# Set this variable to Clang toolchain distro URL to be used.
|
||||
# NOTE: We have separate toolchains for Xtensa and RISCV, therefore jobs for one arch will fail.
|
||||
# This is OK as far as we use CI_CLANG_DISTRO_URL for pre-release tests purposes only.
|
||||
# Keep the variable empty when not used.
|
||||
CI_CLANG_DISTRO_URL: ""
|
||||
|
||||
# Set this variable to specify the file name for the known failure cases.
|
||||
KNOWN_FAILURE_CASES_FILE_NAME: "master.txt"
|
||||
KNOWN_FAILURE_CASES_FILE_NAME: "5.3.txt"
|
||||
|
||||
IDF_CI_BUILD: 1
|
||||
|
||||
@@ -103,8 +96,6 @@ variables:
|
||||
CCACHE_DIR: "/cache/idf_ccache"
|
||||
CCACHE_MAXSIZE: "50G"
|
||||
|
||||
FF_USE_NEW_BASH_EVAL_STRATEGY: "true"
|
||||
|
||||
################################################
|
||||
# `before_script` and `after_script` Templates #
|
||||
################################################
|
||||
@@ -161,7 +152,7 @@ variables:
|
||||
fi
|
||||
|
||||
# Install esp-clang if necessary
|
||||
if [[ "$IDF_TOOLCHAIN" == "clang" && -z "$CI_CLANG_DISTRO_URL" ]]; then
|
||||
if [[ "$IDF_TOOLCHAIN" == "clang" ]]; then
|
||||
$IDF_PATH/tools/idf_tools.py --non-interactive install esp-clang
|
||||
fi
|
||||
|
||||
@@ -176,7 +167,7 @@ variables:
|
||||
|
||||
source ./export.sh
|
||||
|
||||
# Custom clang toolchain
|
||||
# Custom clang
|
||||
if [[ ! -z "$CI_CLANG_DISTRO_URL" ]]; then
|
||||
echo "Using custom clang from ${CI_CLANG_DISTRO_URL}"
|
||||
wget $CI_CLANG_DISTRO_URL
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# External DangerJS
|
||||
# Extenal DangerJS
|
||||
include:
|
||||
- project: espressif/shared-ci-dangerjs
|
||||
ref: master
|
||||
@@ -10,6 +10,7 @@ run-danger-mr-linter:
|
||||
GIT_STRATEGY: none # no repo checkout
|
||||
ENABLE_CHECK_AREA_LABELS: 'true'
|
||||
ENABLE_CHECK_DOCS_TRANSLATION: 'true'
|
||||
ENABLE_CHECK_RELEASE_NOTES_DESCRIPTION: 'true'
|
||||
ENABLE_CHECK_UPDATED_CHANGELOG: 'false'
|
||||
before_script: []
|
||||
cache: []
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
#
|
||||
# This file should ONLY be used during bringup. Should be reset to empty after the bringup process
|
||||
extra_default_build_targets:
|
||||
- esp32p4
|
||||
- esp32c5
|
||||
- esp32c61
|
||||
|
||||
bypass_check_test_targets:
|
||||
- esp32c5
|
||||
- esp32c61
|
||||
#
|
||||
# These lines would
|
||||
|
||||
@@ -102,7 +102,7 @@ check_docs_lang_sync:
|
||||
parallel:
|
||||
matrix:
|
||||
- DOCLANG: ["en", "zh_CN"]
|
||||
DOCTGT: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c2", "esp32c6", "esp32c61", "esp32c5","esp32h2", "esp32p4"]
|
||||
DOCTGT: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c2", "esp32c6", "esp32c5","esp32h2", "esp32p4"]
|
||||
|
||||
check_docs_gh_links:
|
||||
image: $ESP_IDF_DOC_ENV_IMAGE
|
||||
@@ -171,7 +171,6 @@ build_docs_pdf:
|
||||
- job: fast_template_app
|
||||
artifacts: false
|
||||
optional: true
|
||||
allow_failure: true # TODO IDFCI-2216
|
||||
artifacts:
|
||||
paths:
|
||||
- docs/_build/*/*/latex/*
|
||||
@@ -183,7 +182,6 @@ build_docs_pdf_prod:
|
||||
- .build_docs_template
|
||||
- .doc-rules:build:docs-full-prod
|
||||
dependencies: [] # Stop build_docs jobs from downloading all previous job's artifacts
|
||||
allow_failure: true # TODO IDFCI-2216
|
||||
artifacts:
|
||||
paths:
|
||||
- docs/_build/*/*/latex/*
|
||||
|
||||
@@ -299,16 +299,16 @@ test_pytest_qemu:
|
||||
paths:
|
||||
- XUNIT_RESULT.xml
|
||||
- pytest-embedded/
|
||||
- "**/build*/*.bin"
|
||||
reports:
|
||||
junit: XUNIT_RESULT.xml
|
||||
allow_failure: true # IDFCI-1752
|
||||
parallel:
|
||||
matrix:
|
||||
- IDF_TARGET: [esp32, esp32c3]
|
||||
variables:
|
||||
INSTALL_QEMU: 1
|
||||
script:
|
||||
- run_cmd python tools/ci/ci_build_apps.py . -v
|
||||
- run_cmd python tools/ci/ci_build_apps.py . -vv
|
||||
--target $IDF_TARGET
|
||||
--pytest-apps
|
||||
-m qemu
|
||||
@@ -318,7 +318,6 @@ test_pytest_qemu:
|
||||
- python tools/ci/get_known_failure_cases_file.py
|
||||
- run_cmd pytest
|
||||
--target $IDF_TARGET
|
||||
--log-cli-level DEBUG
|
||||
-m qemu
|
||||
--embedded-services idf,qemu
|
||||
--junitxml=XUNIT_RESULT.xml
|
||||
@@ -337,50 +336,18 @@ test_pytest_linux:
|
||||
- "**/build*/build_log.txt"
|
||||
reports:
|
||||
junit: XUNIT_RESULT.xml
|
||||
script:
|
||||
- run_cmd python tools/ci/ci_build_apps.py components examples tools/test_apps -v
|
||||
--target linux
|
||||
--pytest-apps
|
||||
-m host_test
|
||||
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
- python tools/ci/get_known_failure_cases_file.py
|
||||
- run_cmd pytest
|
||||
--target linux
|
||||
-m host_test
|
||||
--embedded-services idf
|
||||
--junitxml=XUNIT_RESULT.xml
|
||||
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
|
||||
--app-info-filepattern \"list_job_*.txt\"
|
||||
|
||||
test_pytest_macos:
|
||||
extends:
|
||||
- .host_test_template
|
||||
- .before_script:build:macos
|
||||
tags:
|
||||
- macos_shell
|
||||
artifacts:
|
||||
paths:
|
||||
- XUNIT_RESULT.xml
|
||||
- pytest-embedded/
|
||||
- "**/build*/build_log.txt"
|
||||
reports:
|
||||
junit: XUNIT_RESULT.xml
|
||||
variables:
|
||||
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
|
||||
script:
|
||||
- run_cmd python tools/ci/ci_build_apps.py components examples tools/test_apps -vv
|
||||
--target linux
|
||||
--pytest-apps
|
||||
-m \"host_test and macos_shell\"
|
||||
-m host_test
|
||||
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
|
||||
--modified-components ${MR_MODIFIED_COMPONENTS}
|
||||
--modified-files ${MR_MODIFIED_FILES}
|
||||
- python tools/ci/get_known_failure_cases_file.py
|
||||
- run_cmd pytest
|
||||
--target linux
|
||||
-m \"host_test and macos_shell\"
|
||||
-m host_test
|
||||
--junitxml=XUNIT_RESULT.xml
|
||||
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
|
||||
--app-info-filepattern \"list_job_*.txt\"
|
||||
@@ -395,12 +362,5 @@ test_idf_pytest_plugin:
|
||||
reports:
|
||||
junit: XUNIT_RESULT.xml
|
||||
script:
|
||||
- cd ${IDF_PATH}/tools/ci/dynamic_pipelines/tests/test_report_generator
|
||||
- python -m unittest test_report_generator.py
|
||||
- cd ${IDF_PATH}/tools/ci/idf_pytest
|
||||
- cd tools/ci/idf_pytest
|
||||
- pytest --junitxml=${CI_PROJECT_DIR}/XUNIT_RESULT.xml
|
||||
|
||||
test_idf_build_apps_load_soc_caps:
|
||||
extends: .host_test_template
|
||||
script:
|
||||
- python tools/ci/check_soc_headers_load_in_idf_build_apps.py
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
generate_failed_jobs_report:
|
||||
stage: post_deploy
|
||||
tags: [build, shiny]
|
||||
image: $ESP_ENV_IMAGE
|
||||
when: always
|
||||
dependencies: [] # Do not download artifacts from the previous stages
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
when: always
|
||||
paths:
|
||||
- job_report.html
|
||||
script:
|
||||
- python tools/ci/dynamic_pipelines/scripts/generate_report.py --report-type job
|
||||
@@ -135,7 +135,6 @@ pipeline_variables:
|
||||
# MODIFIED_FILES is a list of files that changed, could be used everywhere
|
||||
- MODIFIED_FILES=$(echo "$GIT_DIFF_OUTPUT" | xargs)
|
||||
- echo "MODIFIED_FILES=$MODIFIED_FILES" >> pipeline.env
|
||||
- echo "REPORT_EXIT_CODE=0" >> pipeline.env
|
||||
# MR_MODIFIED_FILES and MR_MODIFIED_COMPONENTS are semicolon separated lists that is used in MR only
|
||||
# for non MR pipeline, these are empty lists
|
||||
- |
|
||||
@@ -158,7 +157,6 @@ pipeline_variables:
|
||||
if [ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]; then
|
||||
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
|
||||
fi
|
||||
- python tools/ci/ci_process_description.py
|
||||
- cat pipeline.env
|
||||
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report
|
||||
artifacts:
|
||||
|
||||
@@ -45,36 +45,3 @@ check_pre_commit:
|
||||
paths:
|
||||
- .cache/submodule_archives
|
||||
policy: pull
|
||||
|
||||
check_powershell:
|
||||
extends:
|
||||
- .before_script:minimal
|
||||
stage: pre_check
|
||||
image: docker:latest
|
||||
services:
|
||||
- docker:dind
|
||||
tags:
|
||||
- dind
|
||||
- amd64
|
||||
needs:
|
||||
- pipeline_variables
|
||||
variables:
|
||||
# cache pre_commit
|
||||
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
|
||||
rules:
|
||||
- changes:
|
||||
- "*.ps1"
|
||||
script:
|
||||
- apk add python3
|
||||
- apk add py3-pip
|
||||
- pip install pre-commit --break-system-packages
|
||||
- pre-commit run --hook-stage manual check-powershell-scripts --files $MODIFIED_FILES
|
||||
cache:
|
||||
- key: pre_commit-cache-${LATEST_GIT_TAG}
|
||||
paths:
|
||||
- .cache/pre-commit
|
||||
policy: pull
|
||||
- key: submodule-cache-${LATEST_GIT_TAG}
|
||||
paths:
|
||||
- .cache/submodule_archives
|
||||
policy: pull
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
retry_failed_jobs:
|
||||
stage: retry_failed_jobs
|
||||
tags: [shiny, fast_run]
|
||||
image: $ESP_ENV_IMAGE
|
||||
dependencies: null
|
||||
before_script: []
|
||||
cache: []
|
||||
extends: []
|
||||
script:
|
||||
- echo "Retrieving and retrying all failed jobs for the pipeline..."
|
||||
- python tools/ci/python_packages/gitlab_api.py retry_failed_jobs $CI_MERGE_REQUEST_PROJECT_ID --pipeline_id $CI_PIPELINE_ID
|
||||
when: manual
|
||||
needs:
|
||||
- generate_failed_jobs_report
|
||||
@@ -66,8 +66,6 @@
|
||||
- "tools/ci/check_esp_memory_utils_headers.sh"
|
||||
- "tools/ci/check_blobs.sh"
|
||||
- "tools/ci/check_public_headers.py"
|
||||
- "tools/ci/check_register_rw_half_word.cmake"
|
||||
- "tools/ci/check_register_rw_half_word.py"
|
||||
|
||||
.patterns-host_test: &patterns-host_test
|
||||
- ".gitlab/ci/host-test.yml"
|
||||
@@ -150,7 +148,6 @@
|
||||
|
||||
.patterns-idf-pytest-plugin: &patterns-idf-pytest-plugin
|
||||
- "tools/ci/idf_pytest/**/*"
|
||||
- "tools/ci/dynamic_pipelines/tests/**/*"
|
||||
|
||||
##############
|
||||
# if anchors #
|
||||
|
||||
@@ -13,17 +13,3 @@
|
||||
<!-- Either state release notes or write "No release notes" -->
|
||||
|
||||
<!-- ## Breaking change notes --><!-- Optional -->
|
||||
|
||||
<!-- ## Dynamic Pipeline Configuration
|
||||
```yaml
|
||||
Test Case Filters:
|
||||
# Only run tests that match the given substring expression (modified files/components will be ignored):
|
||||
# Please use a list of strings.
|
||||
# This will run the test cases filtered like `pytest -k "(<list_item_1>) or (<list_item_2>) or ...`
|
||||
# The fast pipeline will fail at the final stage.
|
||||
# For example:
|
||||
- test_sdm and not sdmmc
|
||||
- test_hello_world
|
||||
# This example will include all tests containing 'test_hello_world' in the name,
|
||||
# and include all tests containing 'test_sdm' but not 'sdmmc' in the name.
|
||||
``` --><!-- Optional -->
|
||||
|
||||
1
.gitmodules
vendored
1
.gitmodules
vendored
@@ -55,7 +55,6 @@
|
||||
sbom-url = https://github.com/DaveGamble/cJSON
|
||||
sbom-description = Ultralightweight JSON parser in ANSI C
|
||||
sbom-hash = acc76239bee01d8e9c858ae2cab296704e52d916
|
||||
sbom-cve-exclude-list = CVE-2024-31755 Resolved in v1.7.18
|
||||
|
||||
[submodule "components/mbedtls/mbedtls"]
|
||||
path = components/mbedtls/mbedtls
|
||||
|
||||
@@ -53,7 +53,7 @@ repos:
|
||||
.*_pb2.py
|
||||
)$
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.3.0
|
||||
rev: v2.2.6
|
||||
hooks:
|
||||
- id: codespell
|
||||
- repo: local
|
||||
@@ -224,11 +224,6 @@ repos:
|
||||
name: shellcheck dash (export.sh)
|
||||
args: ['--shell', 'dash', '-x']
|
||||
files: 'export.sh'
|
||||
- repo: https://github.com/espressif/esp-pwsh-check
|
||||
rev: v1.0.1
|
||||
hooks:
|
||||
- id: check-powershell-scripts
|
||||
stages: [manual]
|
||||
- repo: https://github.com/espressif/esp-idf-sbom.git
|
||||
rev: v0.13.0
|
||||
hooks:
|
||||
@@ -241,6 +236,6 @@ repos:
|
||||
name: Lint rST files in docs folder using Sphinx Lint
|
||||
files: ^(docs/en|docs/zh_CN)/.*\.(rst|inc)$
|
||||
- repo: https://github.com/espressif/esp-idf-kconfig.git
|
||||
rev: v2.3.0
|
||||
rev: v2.1.0
|
||||
hooks:
|
||||
- id: check-kconfig-files
|
||||
|
||||
@@ -96,7 +96,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
list(APPEND compile_options "-Wno-pointer-bool-conversion")
|
||||
# mbedTLS md5.c triggers this warning in md5_test_buf (false positive)
|
||||
list(APPEND compile_options "-Wno-string-concatenation")
|
||||
# multiple cases of implicit conversions between unrelated enum types
|
||||
# multiple cases of implict convertions between unrelated enum types
|
||||
list(APPEND compile_options "-Wno-enum-conversion")
|
||||
# When IRAM_ATTR is specified both in function declaration and definition,
|
||||
# it produces different section names, since section names include __COUNTER__.
|
||||
@@ -136,10 +136,6 @@ if(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE)
|
||||
list(APPEND compile_definitions "-DNDEBUG")
|
||||
endif()
|
||||
|
||||
if(CONFIG_COMPILER_NO_MERGE_CONSTANTS)
|
||||
list(APPEND compile_options "-fno-merge-constants")
|
||||
endif()
|
||||
|
||||
if(CONFIG_COMPILER_STACK_CHECK_MODE_NORM)
|
||||
list(APPEND compile_options "-fstack-protector")
|
||||
elseif(CONFIG_COMPILER_STACK_CHECK_MODE_STRONG)
|
||||
@@ -205,18 +201,10 @@ if(CONFIG_COMPILER_DISABLE_GCC13_WARNINGS)
|
||||
"-Wno-dangling-reference")
|
||||
endif()
|
||||
|
||||
if(CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS)
|
||||
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
idf_build_replace_option_from_property(COMPILE_OPTIONS "-Werror" "-Werror=all")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# GCC-specific options
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
list(APPEND compile_options "-fstrict-volatile-bitfields")
|
||||
if(CONFIG_COMPILER_STATIC_ANALYZER)
|
||||
list(APPEND compile_options "-fanalyzer")
|
||||
endif()
|
||||
list(APPEND compile_options "-fstrict-volatile-bitfields"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ESP_SYSTEM_USE_EH_FRAME)
|
||||
|
||||
@@ -84,18 +84,17 @@ Supported since ESP-IDF v4.4.
|
||||
|
||||
### ESP32-C2 & ESP8684
|
||||
|
||||
#### v1.0, v1.1
|
||||
#### v1.0
|
||||
|
||||
Supported since ESP-IDF v5.0.
|
||||
|
||||
#### v1.1
|
||||
|
||||
To be added.
|
||||
|
||||
#### v1.2
|
||||
|
||||
| Release branch | Recommended | Required |
|
||||
|------------------------|-------------|----------|
|
||||
| release/v5.0 | v5.0.7+ | v5.0 |
|
||||
| release/v5.1 | v5.1.4+ | v5.1 |
|
||||
| release/v5.2 | v5.2.2+ | v5.2 |
|
||||
| release/v5.3 and above | v5.3+ | v5.3 |
|
||||
To be added.
|
||||
|
||||
### ESP32-C6
|
||||
|
||||
|
||||
@@ -84,18 +84,17 @@
|
||||
|
||||
### ESP32-C2 & ESP8684
|
||||
|
||||
#### v1.0, v1.1
|
||||
#### v1.0
|
||||
|
||||
从 ESP-IDF v5.0 开始支持。
|
||||
|
||||
#### v1.1
|
||||
|
||||
待更新。
|
||||
|
||||
#### v1.2
|
||||
|
||||
| 发布分支 | 推荐版本 | 需求版本 |
|
||||
|------------------------|-------------|----------|
|
||||
| release/v5.0 | v5.0.7+ | v5.0 |
|
||||
| release/v5.1 | v5.1.4+ | v5.1 |
|
||||
| release/v5.2 | v5.2.2+ | v5.1 |
|
||||
| release/v5.3 及以上 | v5.3+ | v5.3 |
|
||||
待更新。
|
||||
|
||||
### ESP32-C6
|
||||
|
||||
|
||||
66
Kconfig
66
Kconfig
@@ -48,10 +48,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
bool
|
||||
default "y" if IDF_TOOLCHAIN="clang"
|
||||
|
||||
config IDF_TOOLCHAIN_GCC
|
||||
bool
|
||||
default "y" if IDF_TOOLCHAIN="gcc"
|
||||
|
||||
config IDF_TARGET_ARCH_RISCV
|
||||
bool
|
||||
default "n"
|
||||
@@ -79,6 +75,10 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
string
|
||||
default "$IDF_INIT_VERSION"
|
||||
|
||||
config IDF_TARGET_LINUX
|
||||
bool
|
||||
default "y" if IDF_TARGET="linux"
|
||||
|
||||
config IDF_TARGET_ESP32
|
||||
bool
|
||||
default "y" if IDF_TARGET="esp32"
|
||||
@@ -119,6 +119,28 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
select FREERTOS_UNICORE
|
||||
select IDF_TARGET_ARCH_RISCV
|
||||
|
||||
# TODO: IDF-9197
|
||||
choice IDF_TARGET_ESP32C5_VERSION
|
||||
prompt "ESP32-C5 version"
|
||||
depends on IDF_TARGET_ESP32C5
|
||||
default IDF_TARGET_ESP32C5_MP_VERSION
|
||||
help
|
||||
ESP32-C5 will support two versions for a period.
|
||||
This option is for internal use only.
|
||||
Select the one that matches your chip model.
|
||||
|
||||
config IDF_TARGET_ESP32C5_BETA3_VERSION
|
||||
bool
|
||||
prompt "ESP32-C5 beta3"
|
||||
select ESPTOOLPY_NO_STUB
|
||||
|
||||
config IDF_TARGET_ESP32C5_MP_VERSION
|
||||
bool
|
||||
prompt "ESP32-C5 MP"
|
||||
select ESPTOOLPY_NO_STUB
|
||||
select IDF_ENV_FPGA
|
||||
endchoice
|
||||
|
||||
config IDF_TARGET_ESP32P4
|
||||
bool
|
||||
default "y" if IDF_TARGET="esp32p4"
|
||||
@@ -135,6 +157,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
default "y" if IDF_TARGET="esp32c61"
|
||||
select FREERTOS_UNICORE
|
||||
select IDF_TARGET_ARCH_RISCV
|
||||
select IDF_ENV_FPGA
|
||||
|
||||
config IDF_TARGET_LINUX
|
||||
bool
|
||||
@@ -150,7 +173,8 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
default 0x000D if IDF_TARGET_ESP32C6
|
||||
default 0x0010 if IDF_TARGET_ESP32H2
|
||||
default 0x0012 if IDF_TARGET_ESP32P4
|
||||
default 0x0017 if IDF_TARGET_ESP32C5
|
||||
default 0x0011 if IDF_TARGET_ESP32C5 && IDF_TARGET_ESP32C5_BETA3_VERSION # TODO: IDF-9197
|
||||
default 0x0017 if IDF_TARGET_ESP32C5 && IDF_TARGET_ESP32C5_MP_VERSION # TODO: IDF-9197
|
||||
default 0x0014 if IDF_TARGET_ESP32C61
|
||||
default 0xFFFF
|
||||
|
||||
@@ -509,15 +533,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
help
|
||||
Stack smashing protection.
|
||||
|
||||
config COMPILER_NO_MERGE_CONSTANTS
|
||||
bool "Disable merging const sections"
|
||||
depends on IDF_TOOLCHAIN_GCC
|
||||
help
|
||||
Disable merging identical constants (string/floating-point) across compilation units.
|
||||
This helps in better size analysis of the application binary as the rodata section
|
||||
distribution is more uniform across libraries. On downside, it may increase
|
||||
the binary size and hence should be used during development phase only.
|
||||
|
||||
config COMPILER_WARN_WRITE_STRINGS
|
||||
bool "Enable -Wwrite-strings warning flag"
|
||||
default "n"
|
||||
@@ -544,20 +559,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
|
||||
This option can be enabled for RISC-V targets only.
|
||||
|
||||
config COMPILER_DISABLE_DEFAULT_ERRORS
|
||||
bool "Disable errors for default warnings"
|
||||
default "y"
|
||||
help
|
||||
Enable this option if you do not want default warnings to be considered as errors,
|
||||
especially when updating IDF.
|
||||
|
||||
This is a temporary flag that could help to allow upgrade while having
|
||||
some time to address the warnings raised by those default warnings.
|
||||
Alternatives are:
|
||||
1) fix code (preferred),
|
||||
2) remove specific warnings,
|
||||
3) do not consider specific warnings as error.
|
||||
|
||||
config COMPILER_DISABLE_GCC12_WARNINGS
|
||||
bool "Disable new warnings introduced in GCC 12"
|
||||
default "n"
|
||||
@@ -608,7 +609,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
|
||||
choice COMPILER_ORPHAN_SECTIONS
|
||||
prompt "Orphan sections handling"
|
||||
default COMPILER_ORPHAN_SECTIONS_WARNING
|
||||
default COMPILER_ORPHAN_SECTIONS_PLACE
|
||||
depends on !IDF_TARGET_LINUX
|
||||
help
|
||||
If the linker finds orphan sections, it attempts to place orphan sections after sections of the same
|
||||
@@ -627,13 +628,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
Places orphan sections without a warning/error message.
|
||||
endchoice
|
||||
|
||||
config COMPILER_STATIC_ANALYZER
|
||||
bool "Enable compiler static analyzer"
|
||||
default "n"
|
||||
depends on IDF_TOOLCHAIN_GCC
|
||||
help
|
||||
Enable compiler static analyzer. This may produce false-positive results and increases compile time.
|
||||
|
||||
endmenu # Compiler Options
|
||||
|
||||
menu "Component config"
|
||||
|
||||
22
README.md
22
README.md
@@ -15,17 +15,17 @@ ESP-IDF is the development framework for Espressif SoCs supported on Windows, Li
|
||||
|
||||
The following table shows ESP-IDF support of Espressif SoCs where ![alt text][preview] and ![alt text][supported] denote preview status and support, respectively. The preview support is usually limited in time and intended for beta versions of chips. Please use an ESP-IDF release where the desired SoC is already supported.
|
||||
|
||||
|Chip | v5.0 | v5.1 | v5.2 | v5.3 | |
|
||||
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------------------------------------------- |
|
||||
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32_S3) |
|
||||
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32-C2) |
|
||||
|ESP32-C6 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32_C6) |
|
||||
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|
||||
|ESP32-P4 | | | | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32-P4) |
|
||||
|ESP32-C5 | | | | ![alt text][preview] | [Announcement](https://www.espressif.com/en/news/ESP32-C5) |
|
||||
|Chip | v4.4 | v5.0 | v5.1 | v5.2 | v5.3 | |
|
||||
|:----------- | :---------------------:| :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------------------------------------------- |
|
||||
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32_S3) |
|
||||
|ESP32-C2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32-C2) |
|
||||
|ESP32-C6 | | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32_C6) |
|
||||
|ESP32-H2 | | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|
||||
|ESP32-P4 | | | | | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32-P4) |
|
||||
|ESP32-C5 | | | | | ![alt text][preview] | [Announcement](https://www.espressif.com/en/news/ESP32-C5) |
|
||||
|
||||
[supported]: https://img.shields.io/badge/-supported-green "supported"
|
||||
[preview]: https://img.shields.io/badge/-preview-orange "preview"
|
||||
|
||||
24
README_CN.md
24
README_CN.md
@@ -15,17 +15,17 @@ ESP-IDF 是乐鑫官方推出的物联网开发框架,支持 Windows、Linux
|
||||
|
||||
下表总结了乐鑫芯片在 ESP-IDF 各版本中的支持状态,其中 ![alt text][supported] 代表已支持,![alt text][preview] 代表目前处于预览支持状态。预览支持状态通常有时间限制,而且仅适用于测试版芯片。请确保使用与芯片相匹配的 ESP-IDF 版本。
|
||||
|
||||
|芯片 | v5.0 | v5.1 | v5.2 | v5.3 | |
|
||||
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :-------------------------------------------------------------- |
|
||||
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_S3) |
|
||||
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C2) |
|
||||
|ESP32-C6 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_C6) |
|
||||
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|
||||
|ESP32-P4 | | | | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-P4) |
|
||||
|ESP32-C5 | | | | ![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C5) |
|
||||
|芯片 | v4.4 | v5.0 | v5.1 | v5.2 | v5.3 | |
|
||||
|:----------- | :---------------------:| :---------------------:| :--------------------: | :--------------------: | :--------------------: | :-------------------------------------------------------------- |
|
||||
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|
||||
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_S3) |
|
||||
|ESP32-C2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C2) |
|
||||
|ESP32-C6 | | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_C6) |
|
||||
|ESP32-H2 | | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|
||||
|ESP32-P4 | | | | | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/en/news/ESP32-P4) |
|
||||
|ESP32-C5 | | | | | ![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C5) |
|
||||
|
||||
[supported]: https://img.shields.io/badge/-%E6%94%AF%E6%8C%81-green "supported"
|
||||
[preview]: https://img.shields.io/badge/-%E9%A2%84%E8%A7%88-orange "preview"
|
||||
@@ -122,7 +122,7 @@ ESP-IDF 中的子模块采用相对路径([详见 .gitmodules 文件](.gitmodu
|
||||
|
||||
* 最新版的文档:https://docs.espressif.com/projects/esp-idf/ ,该文档是由本仓库 [docs 目录](docs) 构建得到。
|
||||
|
||||
* [初学者指南:主要概念和资源](https://www.bilibili.com/video/BV1114y1r7du/)
|
||||
* [初学者指南:主要概念和资源](https://www.bilibili.com/video/BV1114y1r7du/)
|
||||
|
||||
* 可以前往 [esp32.com 论坛](https://esp32.com/) 提问,挖掘社区资源。
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ menu "Application Level Tracing"
|
||||
|
||||
config APPTRACE_DEST_NONE
|
||||
bool "None"
|
||||
|
||||
endchoice
|
||||
|
||||
config APPTRACE_DEST_UART
|
||||
@@ -61,7 +60,7 @@ menu "Application Level Tracing"
|
||||
endchoice
|
||||
|
||||
config APPTRACE_UART_TX_GPIO
|
||||
int "UART TX on GPIO<num>"
|
||||
int "UART TX on GPIO#"
|
||||
depends on APPTRACE_DEST_UART_NOUSB
|
||||
range 0 46
|
||||
default 12 if IDF_TARGET_ESP32
|
||||
@@ -71,7 +70,7 @@ menu "Application Level Tracing"
|
||||
This GPIO is used for UART TX pin.
|
||||
|
||||
config APPTRACE_UART_RX_GPIO
|
||||
int "UART RX on GPIO<num>"
|
||||
int "UART RX on GPIO#"
|
||||
depends on APPTRACE_DEST_UART_NOUSB
|
||||
range 0 46
|
||||
default 13 if IDF_TARGET_ESP32
|
||||
@@ -214,7 +213,7 @@ menu "Application Level Tracing"
|
||||
depends on APPTRACE_SV_ENABLE
|
||||
default APPTRACE_SV_DEST_JTAG
|
||||
help
|
||||
SystemView will transfer data through the defined interface.
|
||||
SystemView witt transfer data trough defined interface.
|
||||
|
||||
config APPTRACE_SV_DEST_JTAG
|
||||
bool "Data destination JTAG"
|
||||
|
||||
@@ -8,6 +8,6 @@ components/app_trace/test_apps:
|
||||
- driver
|
||||
- esp_hw_support
|
||||
disable:
|
||||
- if: IDF_TARGET in ["esp32c5", "esp32c61"]
|
||||
- if: IDF_TARGET == "esp32c5"
|
||||
temporary: true
|
||||
reason: not support yet # TODO: [ESP32C5] IDF-8705, [ESP32C61] IDF-9306
|
||||
reason: not support yet # TODO: [ESP32C5] IDF-8705
|
||||
|
||||
@@ -116,8 +116,6 @@ esp_err_t esp_ota_begin(const esp_partition_t* partition, size_t image_size, esp
|
||||
* - ESP_ERR_OTA_VALIDATE_FAILED: First byte of image contains invalid app image magic byte.
|
||||
* - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed.
|
||||
* - ESP_ERR_OTA_SELECT_INFO_INVALID: OTA data partition has invalid contents
|
||||
* - ESP_ERR_INVALID_SIZE: if write would go out of bounds of the partition
|
||||
* - or one of error codes from lower-level flash driver.
|
||||
*/
|
||||
esp_err_t esp_ota_write(esp_ota_handle_t handle, const void* data, size_t size);
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
components/app_update/test_apps:
|
||||
disable:
|
||||
- if: IDF_TARGET in ["esp32c5", "esp32c61"]
|
||||
- if: IDF_TARGET in ["esp32c6", "esp32h2", "esp32c5"]
|
||||
temporary: true
|
||||
reason: target esp32c5 is not supported yet # TODO: [ESP32C5] IDF-8640, IDF-10317, [ESP32C61] IDF-9245
|
||||
reason: target esp32c6, esp32h2 esp32c5 is not supported yet # TODO: [ESP32C5] IDF-8638
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
||||
@@ -841,7 +841,8 @@ static void test_flow6(void)
|
||||
// 3 Stage: run OTA0 -> check it -> erase OTA_DATA for next tests -> PASS
|
||||
TEST_CASE_MULTIPLE_STAGES("Switching between factory, OTA0 using esp_ota_write_with_offset", "[app_update][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET]", start_test, test_flow6, test_flow6);
|
||||
|
||||
TEST_CASE("Test bootloader_common_get_sha256_of_partition returns ESP_ERR_IMAGE_INVALID when image is invalid", "[partitions]")
|
||||
//IDF-5145
|
||||
TEST_CASE("Test bootloader_common_get_sha256_of_partition returns ESP_ERR_IMAGE_INVALID when image is ivalid", "[partitions]")
|
||||
{
|
||||
const esp_partition_t *cur_app = esp_ota_get_running_partition();
|
||||
ESP_LOGI(TAG, "copy current app to next part");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
import re
|
||||
|
||||
@@ -19,7 +19,14 @@ def run_multiple_stages(dut: Dut, test_case_num: int, stages: int) -> None:
|
||||
|
||||
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32c5'], reason='C5 has not supported deep sleep') # TODO: [ESP32C5] IDF-8640, IDF-10317
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32c6', 'esp32h2'], reason='c6/h2 support TBD')
|
||||
@pytest.mark.generic
|
||||
def test_app_update(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=90)
|
||||
extra_data = dut.parse_test_menu()
|
||||
for test_case in extra_data:
|
||||
if test_case.type != 'multi_stage':
|
||||
dut.write(str(test_case.index))
|
||||
else:
|
||||
run_multiple_stages(dut, test_case.index, len(test_case.subcases))
|
||||
dut.expect_unity_test_output(timeout=90)
|
||||
dut.expect_exact("Enter next test, or 'enter' to see menu")
|
||||
|
||||
@@ -14,9 +14,5 @@ CONFIG_PARTITION_TABLE_FILENAME="partition_table_unit_test_two_ota.csv"
|
||||
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
CONFIG_PARTITION_TABLE_OFFSET=0x18000
|
||||
|
||||
CONFIG_BOOTLOADER_FACTORY_RESET=y
|
||||
CONFIG_BOOTLOADER_APP_TEST=y
|
||||
CONFIG_BOOTLOADER_DATA_FACTORY_RESET=""
|
||||
CONFIG_BOOTLOADER_HOLD_TIME_GPIO=2
|
||||
CONFIG_BOOTLOADER_OTA_DATA_ERASE=y
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
CONFIG_IDF_TARGET="esp32"
|
||||
CONFIG_BOOTLOADER_FACTORY_RESET=y
|
||||
CONFIG_BOOTLOADER_APP_TEST=y
|
||||
CONFIG_BOOTLOADER_DATA_FACTORY_RESET=""
|
||||
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=32
|
||||
CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=4
|
||||
CONFIG_BOOTLOADER_HOLD_TIME_GPIO=2
|
||||
|
||||
@@ -3,4 +3,3 @@ CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partition_table_unit_test_two_ota_2m.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partition_table_unit_test_two_ota_2m.csv"
|
||||
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=18
|
||||
CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=4
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
CONFIG_IDF_TARGET="esp32c3"
|
||||
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=18
|
||||
CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=4
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_IDF_TARGET="esp32c6"
|
||||
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=18
|
||||
CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=4
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_IDF_TARGET="esp32h2"
|
||||
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=22
|
||||
CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=4
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_IDF_TARGET="esp32p4"
|
||||
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=18
|
||||
CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=19
|
||||
@@ -1,3 +1,2 @@
|
||||
CONFIG_IDF_TARGET="esp32s2"
|
||||
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=18
|
||||
CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=4
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=18
|
||||
CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=4
|
||||
@@ -1,34 +0,0 @@
|
||||
menu "Log"
|
||||
|
||||
choice BOOTLOADER_LOG_LEVEL
|
||||
bool "Bootloader log verbosity"
|
||||
default BOOTLOADER_LOG_LEVEL_INFO
|
||||
help
|
||||
Specify how much output to see in bootloader logs.
|
||||
|
||||
config BOOTLOADER_LOG_LEVEL_NONE
|
||||
bool "No output"
|
||||
config BOOTLOADER_LOG_LEVEL_ERROR
|
||||
bool "Error"
|
||||
config BOOTLOADER_LOG_LEVEL_WARN
|
||||
bool "Warning"
|
||||
config BOOTLOADER_LOG_LEVEL_INFO
|
||||
bool "Info"
|
||||
config BOOTLOADER_LOG_LEVEL_DEBUG
|
||||
bool "Debug"
|
||||
config BOOTLOADER_LOG_LEVEL_VERBOSE
|
||||
bool "Verbose"
|
||||
endchoice
|
||||
|
||||
config BOOTLOADER_LOG_LEVEL
|
||||
int
|
||||
default 0 if BOOTLOADER_LOG_LEVEL_NONE
|
||||
default 1 if BOOTLOADER_LOG_LEVEL_ERROR
|
||||
default 2 if BOOTLOADER_LOG_LEVEL_WARN
|
||||
default 3 if BOOTLOADER_LOG_LEVEL_INFO
|
||||
default 4 if BOOTLOADER_LOG_LEVEL_DEBUG
|
||||
default 5 if BOOTLOADER_LOG_LEVEL_VERBOSE
|
||||
|
||||
orsource "Kconfig.log.format"
|
||||
|
||||
endmenu
|
||||
@@ -1,38 +0,0 @@
|
||||
menu "Format"
|
||||
|
||||
config BOOTLOADER_LOG_COLORS
|
||||
bool "Color"
|
||||
default y
|
||||
help
|
||||
Use ANSI terminal colors in log output
|
||||
Enable ANSI terminal color codes.
|
||||
In order to view these, your terminal program must support ANSI color codes.
|
||||
|
||||
choice BOOTLOADER_LOG_TIMESTAMP_SOURCE
|
||||
prompt "Timestamp"
|
||||
default BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS
|
||||
help
|
||||
Choose what sort of timestamp is displayed in the log output:
|
||||
|
||||
- "None" - The log will only contain the actual log messages themselves
|
||||
without any time-related information. Avoiding timestamps can help conserve
|
||||
processing power and memory. It might useful when you
|
||||
perform log analysis or debugging, sometimes it's more straightforward
|
||||
to work with logs that lack timestamps, especially if the time of occurrence
|
||||
is not critical for understanding the issues.
|
||||
"I log_test: info message"
|
||||
|
||||
- "Milliseconds since boot" is calculated from the RTOS tick count multiplied
|
||||
by the tick period. This time will reset after a software reboot.
|
||||
"I (112500) log_test: info message"
|
||||
|
||||
config BOOTLOADER_LOG_TIMESTAMP_SOURCE_NONE
|
||||
bool "None"
|
||||
depends on NO_SYMBOL # hide it now, turn it on final MR
|
||||
|
||||
config BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS
|
||||
bool "Milliseconds Since Boot"
|
||||
|
||||
endchoice # BOOTLOADER_LOG_TIMESTAMP_SOURCE
|
||||
|
||||
endmenu
|
||||
@@ -38,7 +38,34 @@ menu "Bootloader config"
|
||||
|
||||
endchoice
|
||||
|
||||
orsource "Kconfig.log"
|
||||
choice BOOTLOADER_LOG_LEVEL
|
||||
bool "Bootloader log verbosity"
|
||||
default BOOTLOADER_LOG_LEVEL_INFO
|
||||
help
|
||||
Specify how much output to see in bootloader logs.
|
||||
|
||||
config BOOTLOADER_LOG_LEVEL_NONE
|
||||
bool "No output"
|
||||
config BOOTLOADER_LOG_LEVEL_ERROR
|
||||
bool "Error"
|
||||
config BOOTLOADER_LOG_LEVEL_WARN
|
||||
bool "Warning"
|
||||
config BOOTLOADER_LOG_LEVEL_INFO
|
||||
bool "Info"
|
||||
config BOOTLOADER_LOG_LEVEL_DEBUG
|
||||
bool "Debug"
|
||||
config BOOTLOADER_LOG_LEVEL_VERBOSE
|
||||
bool "Verbose"
|
||||
endchoice
|
||||
|
||||
config BOOTLOADER_LOG_LEVEL
|
||||
int
|
||||
default 0 if BOOTLOADER_LOG_LEVEL_NONE
|
||||
default 1 if BOOTLOADER_LOG_LEVEL_ERROR
|
||||
default 2 if BOOTLOADER_LOG_LEVEL_WARN
|
||||
default 3 if BOOTLOADER_LOG_LEVEL_INFO
|
||||
default 4 if BOOTLOADER_LOG_LEVEL_DEBUG
|
||||
default 5 if BOOTLOADER_LOG_LEVEL_VERBOSE
|
||||
|
||||
menu "Serial Flash Configurations"
|
||||
config BOOTLOADER_SPI_CUSTOM_WP_PIN
|
||||
@@ -100,15 +127,9 @@ menu "Bootloader config"
|
||||
help
|
||||
This is a helper config for 32bits address flash. Invisible for users.
|
||||
|
||||
config BOOTLOADER_FLASH_NEEDS_32BIT_ADDR_QUAD_FLASH
|
||||
bool
|
||||
default y if BOOTLOADER_FLASH_NEEDS_32BIT_FEAT && SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP
|
||||
help
|
||||
This is a helper config for 32bits address quad flash. Invisible for users.
|
||||
|
||||
config BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
|
||||
bool "Enable cache access to 32-bit-address (over 16MB) range of SPI Flash (READ DOCS FIRST)"
|
||||
depends on BOOTLOADER_FLASH_NEEDS_32BIT_ADDR_QUAD_FLASH && IDF_EXPERIMENTAL_FEATURES
|
||||
depends on BOOTLOADER_FLASH_NEEDS_32BIT_FEAT && IDF_TARGET_ESP32S3 && IDF_EXPERIMENTAL_FEATURES
|
||||
default n
|
||||
help
|
||||
Enabling this option allows the CPU to access 32-bit-address flash beyond 16M range.
|
||||
@@ -145,7 +166,7 @@ menu "Bootloader config"
|
||||
|
||||
config BOOTLOADER_FACTORY_RESET
|
||||
bool "GPIO triggers factory reset"
|
||||
default n
|
||||
default N
|
||||
select BOOTLOADER_RESERVE_RTC_MEM if SOC_RTC_FAST_MEM_SUPPORTED
|
||||
help
|
||||
Allows to reset the device to factory settings:
|
||||
@@ -200,7 +221,7 @@ menu "Bootloader config"
|
||||
|
||||
config BOOTLOADER_APP_TEST
|
||||
bool "GPIO triggers boot from test app partition"
|
||||
default n
|
||||
default N
|
||||
depends on !BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
help
|
||||
Allows to run the test app from "TEST" partition.
|
||||
@@ -248,8 +269,6 @@ menu "Bootloader config"
|
||||
Protects the unmapped memory regions of the entire address space from unintended accesses.
|
||||
This will ensure that an exception will be triggered whenever the CPU performs a memory
|
||||
operation on unmapped regions of the address space.
|
||||
NOTE: Disabling this config on some targets (ESP32-C6, ESP32-H2, ESP32-C5) would not generate
|
||||
an exception when reading from or writing to 0x0.
|
||||
|
||||
config BOOTLOADER_WDT_ENABLE
|
||||
bool "Use RTC watchdog in start code"
|
||||
@@ -362,9 +381,9 @@ menu "Bootloader config"
|
||||
# options, allowing to turn on "allow insecure options" and have secure boot with
|
||||
# "skip validation when existing deep sleep". Keeping this to avoid a breaking change,
|
||||
# but - as noted in help - it invalidates the integrity of Secure Boot checks
|
||||
depends on ((SECURE_BOOT && SECURE_BOOT_INSECURE) || !SECURE_BOOT)
|
||||
depends on SOC_RTC_FAST_MEM_SUPPORTED && ((SECURE_BOOT && SECURE_BOOT_INSECURE) || !SECURE_BOOT)
|
||||
default n
|
||||
select BOOTLOADER_RESERVE_RTC_MEM if SOC_RTC_FAST_MEM_SUPPORTED
|
||||
select BOOTLOADER_RESERVE_RTC_MEM
|
||||
help
|
||||
This option disables the normal validation of an image coming out of
|
||||
deep sleep (checksums, SHA256, and signature). This is a trade-off
|
||||
@@ -763,7 +782,7 @@ menu "Security features"
|
||||
config SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
|
||||
bool "Enable Aggressive key revoke strategy"
|
||||
depends on SECURE_BOOT && SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY
|
||||
default n
|
||||
default N
|
||||
help
|
||||
If this option is set, ROM bootloader will revoke the public key digest burned in efuse block
|
||||
if it fails to verify the signature of software bootloader with it.
|
||||
@@ -779,7 +798,7 @@ menu "Security features"
|
||||
config SECURE_BOOT_FLASH_BOOTLOADER_DEFAULT
|
||||
bool "Flash bootloader along with other artifacts when using the default flash command"
|
||||
depends on SECURE_BOOT_V2_ENABLED && SECURE_BOOT_BUILD_SIGNED_BINARIES
|
||||
default n
|
||||
default N
|
||||
help
|
||||
When Secure Boot V2 is enabled, by default the bootloader is not flashed along with other artifacts
|
||||
like the application and the partition table images, i.e. bootloader has to be separately flashed
|
||||
@@ -819,7 +838,7 @@ menu "Security features"
|
||||
config SECURE_BOOT_INSECURE
|
||||
bool "Allow potentially insecure options"
|
||||
depends on SECURE_BOOT
|
||||
default n
|
||||
default N
|
||||
help
|
||||
You can disable some of the default protections offered by secure boot, in order to enable testing or a
|
||||
custom combination of security features.
|
||||
@@ -830,7 +849,7 @@ menu "Security features"
|
||||
|
||||
config SECURE_FLASH_ENC_ENABLED
|
||||
bool "Enable flash encryption on boot (READ DOCS FIRST)"
|
||||
default n
|
||||
default N
|
||||
select SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE
|
||||
help
|
||||
If this option is set, flash contents will be encrypted by the bootloader on first boot.
|
||||
@@ -917,7 +936,7 @@ menu "Security features"
|
||||
config SECURE_BOOT_ALLOW_ROM_BASIC
|
||||
bool "Leave ROM BASIC Interpreter available on reset"
|
||||
depends on (SECURE_BOOT_INSECURE || SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT) && IDF_TARGET_ESP32
|
||||
default n
|
||||
default N
|
||||
help
|
||||
By default, the BASIC ROM Console starts on reset if no valid bootloader is
|
||||
read from the flash.
|
||||
@@ -932,7 +951,7 @@ menu "Security features"
|
||||
bool "Allow JTAG Debugging"
|
||||
depends on SECURE_BOOT_INSECURE || SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
|
||||
select SECURE_FLASH_SKIP_WRITE_PROTECTION_CACHE if SECURE_FLASH_HAS_WRITE_PROTECTION_CACHE
|
||||
default n
|
||||
default N
|
||||
help
|
||||
If not set (default), the bootloader will permanently disable JTAG (across entire chip) on first boot
|
||||
when either secure boot or flash encryption is enabled.
|
||||
@@ -979,7 +998,7 @@ menu "Security features"
|
||||
config SECURE_BOOT_ALLOW_UNUSED_DIGEST_SLOTS
|
||||
bool "Leave unused digest slots available (not revoke)"
|
||||
depends on SECURE_BOOT_INSECURE && SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS
|
||||
default n
|
||||
default N
|
||||
help
|
||||
If not set (default), during startup in the app all unused digest slots will be revoked.
|
||||
To revoke unused slot will be called esp_efuse_set_digest_revoke(num_digest) for each digest.
|
||||
@@ -998,7 +1017,7 @@ menu "Security features"
|
||||
bool "Leave UART bootloader encryption enabled"
|
||||
depends on SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
|
||||
select SECURE_FLASH_SKIP_WRITE_PROTECTION_CACHE if SECURE_FLASH_HAS_WRITE_PROTECTION_CACHE
|
||||
default n
|
||||
default N
|
||||
help
|
||||
If not set (default), the bootloader will permanently disable UART bootloader encryption access on
|
||||
first boot. If set, the UART bootloader will still be able to access hardware encryption.
|
||||
@@ -1008,7 +1027,7 @@ menu "Security features"
|
||||
config SECURE_FLASH_UART_BOOTLOADER_ALLOW_DEC
|
||||
bool "Leave UART bootloader decryption enabled"
|
||||
depends on SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT && IDF_TARGET_ESP32
|
||||
default n
|
||||
default N
|
||||
help
|
||||
If not set (default), the bootloader will permanently disable UART bootloader decryption access on
|
||||
first boot. If set, the UART bootloader will still be able to access hardware decryption.
|
||||
@@ -1020,7 +1039,7 @@ menu "Security features"
|
||||
bool "Leave UART bootloader flash cache enabled"
|
||||
depends on SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT && \
|
||||
(IDF_TARGET_ESP32 || SOC_EFUSE_DIS_DOWNLOAD_ICACHE || SOC_EFUSE_DIS_DOWNLOAD_DCACHE) # NOERROR
|
||||
default n
|
||||
default N
|
||||
select SECURE_FLASH_SKIP_WRITE_PROTECTION_CACHE if SECURE_FLASH_HAS_WRITE_PROTECTION_CACHE
|
||||
help
|
||||
If not set (default), the bootloader will permanently disable UART bootloader flash cache access on
|
||||
@@ -1031,7 +1050,7 @@ menu "Security features"
|
||||
config SECURE_FLASH_REQUIRE_ALREADY_ENABLED
|
||||
bool "Require flash encryption to be already enabled"
|
||||
depends on SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
|
||||
default n
|
||||
default N
|
||||
help
|
||||
If not set (default), and flash encryption is not yet enabled in eFuses, the 2nd stage bootloader
|
||||
will enable flash encryption: generate the flash encryption key and program eFuses.
|
||||
|
||||
@@ -30,6 +30,12 @@ idf_build_get_property(project_dir PROJECT_DIR)
|
||||
if(CONFIG_SECURE_SIGNED_APPS)
|
||||
add_custom_target(gen_secure_boot_keys)
|
||||
|
||||
if(CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME)
|
||||
set(secure_apps_signing_version "1")
|
||||
elseif(CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME OR CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME)
|
||||
set(secure_apps_signing_version "2")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SECURE_BOOT_V1_ENABLED)
|
||||
# Check that the configuration is sane
|
||||
if((CONFIG_SECURE_BOOTLOADER_REFLASHABLE AND CONFIG_SECURE_BOOTLOADER_ONE_TIME_FLASH) OR
|
||||
@@ -59,10 +65,11 @@ if(CONFIG_SECURE_SIGNED_APPS)
|
||||
# If the signing key is not found, create a phony gen_secure_boot_signing_key target that
|
||||
# fails the build. fail_at_build_time causes a cmake run next time
|
||||
# (to pick up a new signing key if one exists, etc.)
|
||||
if(CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME OR CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME)
|
||||
if(CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME)
|
||||
fail_at_build_time(gen_secure_boot_signing_key
|
||||
"Secure Boot Signing Key ${CONFIG_SECURE_BOOT_SIGNING_KEY} does not exist. Generate using:"
|
||||
"\tidf.py secure-generate-signing-key ${CONFIG_SECURE_BOOT_SIGNING_KEY}")
|
||||
"\tespsecure.py generate_signing_key --version ${secure_apps_signing_version} \
|
||||
${CONFIG_SECURE_BOOT_SIGNING_KEY}")
|
||||
else()
|
||||
if(CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_192_BITS)
|
||||
set(scheme "ecdsa192")
|
||||
@@ -71,7 +78,8 @@ if(CONFIG_SECURE_SIGNED_APPS)
|
||||
endif()
|
||||
fail_at_build_time(gen_secure_boot_signing_key
|
||||
"Secure Boot Signing Key ${CONFIG_SECURE_BOOT_SIGNING_KEY} does not exist. Generate using:"
|
||||
"\tidf.py secure-generate-signing-key --scheme ${scheme} ${CONFIG_SECURE_BOOT_SIGNING_KEY}")
|
||||
"\tespsecure.py generate_signing_key --version ${secure_apps_signing_version} \
|
||||
--scheme ${scheme} ${CONFIG_SECURE_BOOT_SIGNING_KEY}")
|
||||
endif()
|
||||
else()
|
||||
add_custom_target(gen_secure_boot_signing_key)
|
||||
@@ -116,7 +124,7 @@ idf_build_get_property(sdkconfig SDKCONFIG)
|
||||
idf_build_get_property(python PYTHON)
|
||||
idf_build_get_property(extra_cmake_args EXTRA_CMAKE_ARGS)
|
||||
|
||||
# We cannot pass lists are a parameter to the external project without modifying the ';' separator
|
||||
# We cannot pass lists are a parameter to the external project without modifying the ';' spearator
|
||||
string(REPLACE ";" "|" BOOTLOADER_IGNORE_EXTRA_COMPONENT "${BOOTLOADER_IGNORE_EXTRA_COMPONENT}")
|
||||
|
||||
externalproject_add(bootloader
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
idf_component_register(SRCS "bootloader_start.c"
|
||||
REQUIRES bootloader bootloader_support)
|
||||
|
||||
set(target_folder "${target}")
|
||||
if(CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION)
|
||||
set(target_folder "esp32c5/beta3")
|
||||
elseif(CONFIG_IDF_TARGET_ESP32C5_MP_VERSION)
|
||||
set(target_folder "esp32c5/mp")
|
||||
else()
|
||||
set(target_folder "${target}")
|
||||
endif()
|
||||
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
set(scripts "ld/${target_folder}/bootloader.ld")
|
||||
|
||||
@@ -0,0 +1,310 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/** Simplified memory map for the bootloader.
|
||||
* Make sure the bootloader can load into main memory without overwriting itself.
|
||||
*
|
||||
* TODO: [ESP32C5] IDF-9358 Check this file whether need update for MP ROM
|
||||
* ESP32-C5 ROM static data usage is as follows:
|
||||
* - 0x4086b2b8 - 0x4087cbc0: Shared buffers, used in UART/USB/SPI download mode only
|
||||
* - 0x4087cbc0 - 0x4087ebc0: PRO CPU stack, can be reclaimed as heap after RTOS startup
|
||||
* - 0x4087ebc0 - 0x40880000: ROM .bss and .data (not easily reclaimable)
|
||||
*
|
||||
* The 2nd stage bootloader can take space up to the end of ROM shared
|
||||
* buffers area (0x4087cbc0).
|
||||
*/
|
||||
|
||||
/* We consider 0x4087cbc0 to be the last usable address for 2nd stage bootloader stack overhead, dram_seg,
|
||||
* and work out iram_seg and iram_loader_seg addresses from there, backwards.
|
||||
*/
|
||||
|
||||
/* These lengths can be adjusted, if necessary: */
|
||||
bootloader_usable_dram_end = 0x4087cbc0;
|
||||
bootloader_stack_overhead = 0x2000; /* For safety margin between bootloader data section and startup stacks */
|
||||
bootloader_dram_seg_len = 0x5000;
|
||||
bootloader_iram_loader_seg_len = 0x7000;
|
||||
bootloader_iram_seg_len = 0x2200;
|
||||
|
||||
/* Start of the lower region is determined by region size and the end of the higher region */
|
||||
bootloader_dram_seg_end = bootloader_usable_dram_end - bootloader_stack_overhead;
|
||||
bootloader_dram_seg_start = bootloader_dram_seg_end - bootloader_dram_seg_len;
|
||||
bootloader_iram_loader_seg_start = bootloader_dram_seg_start - bootloader_iram_loader_seg_len;
|
||||
bootloader_iram_seg_start = bootloader_iram_loader_seg_start - bootloader_iram_seg_len;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
iram_seg (RWX) : org = bootloader_iram_seg_start, len = bootloader_iram_seg_len
|
||||
iram_loader_seg (RWX) : org = bootloader_iram_loader_seg_start, len = bootloader_iram_loader_seg_len
|
||||
dram_seg (RW) : org = bootloader_dram_seg_start, len = bootloader_dram_seg_len
|
||||
}
|
||||
|
||||
/* The app may use RAM for static allocations up to the start of iram_loader_seg.
|
||||
* If you have changed something above and this assert fails:
|
||||
* 1. Check what the new value of bootloader_iram_loader_seg start is.
|
||||
* 2. Update the value in this assert.
|
||||
* 3. Update SRAM_DRAM_END in components/esp_system/ld/esp32c5/memory.ld.in to the same value.
|
||||
*/
|
||||
ASSERT(bootloader_iram_loader_seg_start == 0x4086EBC0, "bootloader_iram_loader_seg_start inconsistent with SRAM_DRAM_END");
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(call_start_cpu0);
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
.iram_loader.text :
|
||||
{
|
||||
. = ALIGN (16);
|
||||
_loader_text_start = ABSOLUTE(.);
|
||||
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||
*(.iram1 .iram1.*) /* catch stray IRAM_ATTR */
|
||||
*liblog.a:(.literal .text .literal.* .text.*)
|
||||
/* we use either libgcc or compiler-rt, so put similar entries for them here */
|
||||
*libgcc.a:(.literal .text .literal.* .text.*)
|
||||
*libclang_rt.builtins.a:(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_clock_loader.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_common_loader.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_flash.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
|
||||
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_enable .text.bootloader_random_enable)
|
||||
*libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_panic.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:bootloader_soc.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:esp_image_format.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:flash_encrypt.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:flash_partitions.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:secure_boot.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:secure_boot_secure_features.*(.literal .text .literal.* .text.*)
|
||||
*libbootloader_support.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
|
||||
*libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libspi_flash.a:*.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:mmu_hal.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:cache_hal.*(.literal .text .literal.* .text.*)
|
||||
*libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
|
||||
*libesp_hw_support.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
|
||||
*libefuse.a:*.*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
_loader_text_end = ABSOLUTE(.);
|
||||
} > iram_loader_seg
|
||||
|
||||
.iram.text :
|
||||
{
|
||||
. = ALIGN (16);
|
||||
*(.entry.text)
|
||||
*(.init.literal)
|
||||
*(.init)
|
||||
} > iram_seg
|
||||
|
||||
|
||||
/* Shared RAM */
|
||||
.dram0.bss (NOLOAD) :
|
||||
{
|
||||
. = ALIGN (8);
|
||||
_dram_start = ABSOLUTE(.);
|
||||
_bss_start = ABSOLUTE(.);
|
||||
*(.dynsbss)
|
||||
*(.sbss)
|
||||
*(.sbss.*)
|
||||
*(.gnu.linkonce.sb.*)
|
||||
*(.scommon)
|
||||
*(.sbss2)
|
||||
*(.sbss2.*)
|
||||
*(.gnu.linkonce.sb2.*)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
. = ALIGN (8);
|
||||
_bss_end = ABSOLUTE(.);
|
||||
} > dram_seg
|
||||
|
||||
.dram0.bootdesc : ALIGN(0x10)
|
||||
{
|
||||
_data_start = ABSOLUTE(.);
|
||||
*(.data_bootloader_desc .data_bootloader_desc.*) /* Should be the first. Bootloader version info. DO NOT PUT ANYTHING BEFORE IT! */
|
||||
} > dram_seg
|
||||
|
||||
.dram0.data :
|
||||
{
|
||||
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
*(.gnu.linkonce.s2.*)
|
||||
*(.jcr)
|
||||
_data_end = ABSOLUTE(.);
|
||||
} > dram_seg
|
||||
|
||||
.dram0.rodata :
|
||||
{
|
||||
_rodata_start = ABSOLUTE(.);
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
*(.gnu.linkonce.r.*)
|
||||
*(.rodata1)
|
||||
*(.sdata2 .sdata2.* .srodata .srodata.*)
|
||||
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
|
||||
*(.xt_except_table)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.e.*)
|
||||
*(.gnu.version_r)
|
||||
*(.eh_frame_hdr)
|
||||
*(.eh_frame)
|
||||
. = (. + 3) & ~ 3;
|
||||
/* C++ constructor and destructor tables, properly ordered: */
|
||||
__init_array_start = ABSOLUTE(.);
|
||||
KEEP (*crtbegin.*(.ctors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.*) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
__init_array_end = ABSOLUTE(.);
|
||||
KEEP (*crtbegin.*(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.*) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
/* C++ exception handlers table: */
|
||||
__XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
|
||||
*(.xt_except_desc)
|
||||
*(.gnu.linkonce.h.*)
|
||||
__XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
|
||||
*(.xt_except_desc_end)
|
||||
*(.dynamic)
|
||||
*(.gnu.version_d)
|
||||
_rodata_end = ABSOLUTE(.);
|
||||
/* Literals are also RO data. */
|
||||
_lit4_start = ABSOLUTE(.);
|
||||
*(*.lit4)
|
||||
*(.lit4.*)
|
||||
*(.gnu.linkonce.lit4.*)
|
||||
_lit4_end = ABSOLUTE(.);
|
||||
. = ALIGN(4);
|
||||
_dram_end = ABSOLUTE(.);
|
||||
} > dram_seg
|
||||
|
||||
.iram.text :
|
||||
{
|
||||
_stext = .;
|
||||
_text_start = ABSOLUTE(.);
|
||||
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||
*(.iram .iram.*) /* catch stray IRAM_ATTR */
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
|
||||
/** CPU will try to prefetch up to 16 bytes of
|
||||
* of instructions. This means that any configuration (e.g. MMU, PMS) must allow
|
||||
* safe access to up to 16 bytes after the last real instruction, add
|
||||
* dummy bytes to ensure this
|
||||
*/
|
||||
. += 16;
|
||||
|
||||
_text_end = ABSOLUTE(.);
|
||||
_etext = .;
|
||||
} > iram_seg
|
||||
|
||||
.riscv.attributes 0: { *(.riscv.attributes) }
|
||||
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
.debug_pubtypes 0 : { *(.debug_pubtypes) }
|
||||
/* DWARF 3 */
|
||||
.debug_ranges 0 : { *(.debug_ranges) }
|
||||
/* SGI/MIPS DWARF 2 extensions */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
/* GNU DWARF 2 extensions */
|
||||
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
|
||||
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
|
||||
/* DWARF 4 */
|
||||
.debug_types 0 : { *(.debug_types) }
|
||||
/* DWARF 5 */
|
||||
.debug_addr 0 : { *(.debug_addr) }
|
||||
.debug_line_str 0 : { *(.debug_line_str) }
|
||||
.debug_loclists 0 : { *(.debug_loclists) }
|
||||
.debug_macro 0 : { *(.debug_macro) }
|
||||
.debug_names 0 : { *(.debug_names) }
|
||||
.debug_rnglists 0 : { *(.debug_rnglists) }
|
||||
.debug_str_offsets 0 : { *(.debug_str_offsets) }
|
||||
|
||||
.comment 0 : { *(.comment) }
|
||||
.note.GNU-stack 0: { *(.note.GNU-stack) }
|
||||
|
||||
/**
|
||||
* Discarding .rela.* sections results in the following mapping:
|
||||
* .rela.text.* -> .text.*
|
||||
* .rela.data.* -> .data.*
|
||||
* And so forth...
|
||||
*/
|
||||
/DISCARD/ : { *(.rela.*) }
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Appendix: Memory Usage of ROM bootloader
|
||||
*
|
||||
* 0x4086b2b8 ------------------> _dram0_0_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
|
||||
* | |
|
||||
* | |
|
||||
* 0x4087cbc0 ------------------> __stack_sentry
|
||||
* | |
|
||||
* | | 2. Startup pro cpu stack (freed when IDF app is running)
|
||||
* | |
|
||||
* 0x4087ebc0 ------------------> __stack (pro cpu)
|
||||
* | |
|
||||
* | |
|
||||
* | | 3. Shared memory only used in startup code or nonos/early boot*
|
||||
* | | (can be freed when IDF runs)
|
||||
* | |
|
||||
* | |
|
||||
* 0x4087fb14 ------------------> _dram0_rtos_reserved_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 4. Shared memory used in startup code and when IDF runs
|
||||
* | |
|
||||
* | |
|
||||
* 0x4087fefc ------------------> _dram0_rtos_reserved_end
|
||||
* | |
|
||||
* 0x4087ffb8 ------------------> _data_start_interface
|
||||
* | |
|
||||
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
|
||||
* | |
|
||||
* 0x40880000 ------------------> _data_end_interface
|
||||
*/
|
||||
@@ -3,5 +3,4 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
/* No definition for ESP32-C5 target */
|
||||
@@ -7,20 +7,20 @@
|
||||
* Make sure the bootloader can load into main memory without overwriting itself.
|
||||
*
|
||||
* ESP32-C61 ROM static data usage is as follows:
|
||||
* - 0x4083ea70 - 0x4084ca70: Shared buffers, used in UART/USB/SPI download mode only
|
||||
* - 0x4084ca70 - 0x4084ea70: PRO CPU stack, can be reclaimed as heap after RTOS startup
|
||||
* - 0x4084ea70 - 0x40850000: ROM .bss and .data (not easily reclaimable)
|
||||
* - 0x4086ad08 - 0x4087c610: Shared buffers, used in UART/USB/SPI download mode only
|
||||
* - 0x4087c610 - 0x4087e610: PRO CPU stack, can be reclaimed as heap after RTOS startup
|
||||
* - 0x4087e610 - 0x40880000: ROM .bss and .data (not easily reclaimable)
|
||||
*
|
||||
* The 2nd stage bootloader can take space up to the end of ROM shared
|
||||
* buffers area (0x4084ca70).
|
||||
* buffers area (0x4087c610).
|
||||
*/
|
||||
|
||||
/* We consider 0x4084ca70 to be the last usable address for 2nd stage bootloader stack overhead, dram_seg,
|
||||
/* We consider 0x4087c610 to be the last usable address for 2nd stage bootloader stack overhead, dram_seg,
|
||||
* and work out iram_seg and iram_loader_seg addresses from there, backwards.
|
||||
*/
|
||||
|
||||
/* These lengths can be adjusted, if necessary: */
|
||||
bootloader_usable_dram_end = 0x4084ca70;
|
||||
bootloader_usable_dram_end = 0x4084c9f0;
|
||||
bootloader_stack_overhead = 0x2000; /* For safety margin between bootloader data section and startup stacks */
|
||||
bootloader_dram_seg_len = 0x5000;
|
||||
bootloader_iram_loader_seg_len = 0x7000;
|
||||
@@ -45,7 +45,7 @@ MEMORY
|
||||
* 2. Update the value in this assert.
|
||||
* 3. Update SRAM_DRAM_END in components/esp_system/ld/esp32c61/memory.ld.in to the same value.
|
||||
*/
|
||||
ASSERT(bootloader_iram_loader_seg_start == 0x4083ea70, "bootloader_iram_loader_seg_start inconsistent with SRAM_DRAM_END");
|
||||
ASSERT(bootloader_iram_loader_seg_start == 0x4083E9F0, "bootloader_iram_loader_seg_start inconsistent with SRAM_DRAM_END");
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(call_start_cpu0);
|
||||
@@ -273,37 +273,37 @@ SECTIONS
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/** TODO: [ESP32C61] IDF-9405, update after rom freeze
|
||||
* Appendix: Memory Usage of ROM bootloader
|
||||
*
|
||||
* 0x4083ea70 ------------------> _dram0_0_start
|
||||
* 0x4086ad08 ------------------> _dram0_0_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
|
||||
* | |
|
||||
* | |
|
||||
* 0x4084ca70 ------------------> __stack_sentry
|
||||
* 0x4087c610 ------------------> __stack_sentry
|
||||
* | |
|
||||
* | | 2. Startup pro cpu stack (freed when IDF app is running)
|
||||
* | |
|
||||
* 0x4084ea70 ------------------> __stack (pro cpu)
|
||||
* 0x4087e610 ------------------> __stack (pro cpu)
|
||||
* | |
|
||||
* | |
|
||||
* | | 3. Shared memory only used in startup code or nonos/early boot*
|
||||
* | | (can be freed when IDF runs)
|
||||
* | |
|
||||
* | |
|
||||
* 0x4084f5d0 ------------------> _dram0_rtos_reserved_start
|
||||
* 0x4087f564 ------------------> _dram0_rtos_reserved_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 4. Shared memory used in startup code and when IDF runs
|
||||
* | |
|
||||
* | |
|
||||
* 0x4084fc58 ------------------> _dram0_rtos_reserved_end
|
||||
* 0x4087fab0 ------------------> _dram0_rtos_reserved_end
|
||||
* | |
|
||||
* 0x4084fc6c ------------------> _data_start_interface
|
||||
* 0x4087fce8 ------------------> _data_start_interface
|
||||
* | |
|
||||
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
|
||||
* | |
|
||||
* 0x40850000 ------------------> _data_end_interface
|
||||
* 0x40880000 ------------------> _data_end_interface
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ set(srcs
|
||||
"src/secure_boot.c"
|
||||
)
|
||||
|
||||
if(NOT CONFIG_ESP_BRINGUP_BYPASS_RANDOM_SETTING)
|
||||
if(NOT CONFIG_IDF_ENV_FPGA)
|
||||
# For FPGA ENV, bootloader_random implementation is implemented in `bootloader_random.c`
|
||||
list(APPEND srcs "src/bootloader_random_${IDF_TARGET}.c")
|
||||
endif()
|
||||
|
||||
@@ -136,8 +136,6 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
#include "esp32s3/rom/opi_flash.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#include "esp32p4/rom/opi_flash.h"
|
||||
#endif
|
||||
static const char *TAG = "bootloader_flash";
|
||||
|
||||
|
||||
@@ -14,8 +14,11 @@
|
||||
#include "esp32c5/rom/efuse.h"
|
||||
#include "soc/gpio_periph.h"
|
||||
#include "soc/io_mux_reg.h"
|
||||
// TODO: IDF-9197
|
||||
#if CONFIG_IDF_TARGET_ESP32C5_MP_VERSION
|
||||
#include "esp_rom_efuse.h"
|
||||
#include "soc/efuse_reg.h"
|
||||
#endif
|
||||
#include "soc/spi_reg.h"
|
||||
#include "soc/spi_mem_reg.h"
|
||||
#include "soc/soc_caps.h"
|
||||
@@ -28,7 +31,7 @@
|
||||
#include "hal/mmu_ll.h"
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/cache_ll.h"
|
||||
#include "hal/mspi_timing_tuning_ll.h"
|
||||
#include "hal/clk_tree_ll.h"
|
||||
|
||||
void bootloader_flash_update_id()
|
||||
{
|
||||
@@ -204,11 +207,19 @@ static void bootloader_spi_flash_resume(void)
|
||||
|
||||
esp_err_t bootloader_init_spi_flash(void)
|
||||
{
|
||||
// Set source mspi pll clock as 80M in bootloader stage.
|
||||
// SPLL clock on C5 is 480MHz , and mspi_pll needs 80MHz
|
||||
// in this stage, set divider as 6
|
||||
mspi_ll_clock_src_sel(MSPI_CLK_SRC_SPLL);
|
||||
mspi_ll_fast_set_hs_divider(6);
|
||||
// TODO: IDF-9197
|
||||
#if CONFIG_IDF_TARGET_ESP32C5_MP_VERSION
|
||||
// On ESP32C5, MSPI source clock's default HS divider leads to 120MHz, which is unusable before calibration
|
||||
// Therefore, before switching SOC_ROOT_CLK to HS, we need to set MSPI source clock HS divider to make it run at
|
||||
// 80MHz after the switch. PLL = 480MHz, so divider is 6.
|
||||
clk_ll_mspi_fast_set_hs_divider(6);
|
||||
#elif CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION
|
||||
/* TODO: [ESP32C5] IDF-8649 temporary use xtal clock source,
|
||||
need to change back SPLL(480M) and set divider to 6 to use the 80M MSPI,
|
||||
and we need to check flash freq before restart as well */
|
||||
clk_ll_mspi_fast_set_divider(1);
|
||||
clk_ll_mspi_fast_set_src(MSPI_CLK_SRC_XTAL);
|
||||
#endif
|
||||
|
||||
bootloader_init_flash_configure();
|
||||
bootloader_spi_flash_resume();
|
||||
|
||||
@@ -99,15 +99,6 @@ static void update_flash_config(const esp_image_header_t *bootloader_hdr)
|
||||
case ESP_IMAGE_FLASH_SIZE_16MB:
|
||||
size = 16;
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_32MB:
|
||||
size = 32;
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_64MB:
|
||||
size = 64;
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_128MB:
|
||||
size = 128;
|
||||
break;
|
||||
default:
|
||||
size = 2;
|
||||
}
|
||||
@@ -184,15 +175,6 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr)
|
||||
case ESP_IMAGE_FLASH_SIZE_16MB:
|
||||
str = "16MB";
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_32MB:
|
||||
str = "32MB";
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_64MB:
|
||||
str = "64MB";
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_128MB:
|
||||
str = "128MB";
|
||||
break;
|
||||
default:
|
||||
str = "2MB";
|
||||
break;
|
||||
@@ -221,9 +203,6 @@ esp_err_t bootloader_init_spi_flash(void)
|
||||
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
|
||||
bootloader_enable_qio_mode();
|
||||
#endif
|
||||
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
|
||||
bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
|
||||
#endif
|
||||
|
||||
print_flash_info(&bootloader_image_hdr);
|
||||
|
||||
@@ -292,10 +271,6 @@ void bootloader_flash_hardware_init(void)
|
||||
bootloader_spi_flash_resume();
|
||||
bootloader_flash_unlock();
|
||||
|
||||
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
|
||||
bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
|
||||
#endif
|
||||
|
||||
cache_hal_disable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
update_flash_config(&hdr);
|
||||
cache_hal_enable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
#include <inttypes.h>
|
||||
#include "esp_assert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
// TODO: IDF-9197
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/**
|
||||
* @brief ESP chip ID
|
||||
@@ -25,7 +24,11 @@ typedef enum {
|
||||
ESP_CHIP_ID_ESP32C6 = 0x000D, /*!< chip ID: ESP32-C6 */
|
||||
ESP_CHIP_ID_ESP32H2 = 0x0010, /*!< chip ID: ESP32-H2 */
|
||||
ESP_CHIP_ID_ESP32P4 = 0x0012, /*!< chip ID: ESP32-P4 */
|
||||
ESP_CHIP_ID_ESP32C5 = 0x0017, /*!< chip ID: ESP32-C5 */
|
||||
#if CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION // TODO: IDF-9197
|
||||
ESP_CHIP_ID_ESP32C5 = 0x0011, /*!< chip ID: ESP32-C5 beta3 (MPW)*/
|
||||
#elif CONFIG_IDF_TARGET_ESP32C5_MP_VERSION
|
||||
ESP_CHIP_ID_ESP32C5 = 0x0017, /*!< chip ID: ESP32-C5 MP */
|
||||
#endif
|
||||
ESP_CHIP_ID_INVALID = 0xFFFF /*!< Invalid chip ID (we defined it to make sure the esp_chip_id_t is 2 bytes size) */
|
||||
} __attribute__((packed)) esp_chip_id_t;
|
||||
|
||||
@@ -117,7 +120,3 @@ typedef struct {
|
||||
} esp_image_segment_header_t;
|
||||
|
||||
#define ESP_IMAGE_MAX_SEGMENTS 16 /*!< Max count of segments in the image. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -31,10 +31,6 @@
|
||||
#include "esp32h2/rom/secure_boot.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#include "esp32p4/rom/secure_boot.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C5
|
||||
#include "esp32c5/rom/secure_boot.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C61
|
||||
#include "esp32c61/rom/secure_boot.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SECURE_BOOT_V1_ENABLED
|
||||
@@ -65,42 +61,6 @@ extern "C" {
|
||||
#include "esp_efuse_table.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Secure Boot Signature Block Version field
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_SECURE_BOOT_V1_ECDSA = 0, /*!< Secure Boot v1 */
|
||||
ESP_SECURE_BOOT_V2_RSA = 2, /*!< Secure Boot v2 with RSA key */
|
||||
ESP_SECURE_BOOT_V2_ECDSA = 3, /*!< Secure Boot v2 with ECDSA key */
|
||||
} esp_secure_boot_sig_scheme_t;
|
||||
|
||||
#if CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
|
||||
#define ESP_SECURE_BOOT_SCHEME ESP_SECURE_BOOT_V1_ECDSA
|
||||
#elif CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME
|
||||
#define ESP_SECURE_BOOT_SCHEME ESP_SECURE_BOOT_V2_RSA
|
||||
#elif CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
|
||||
#define ESP_SECURE_BOOT_SCHEME ESP_SECURE_BOOT_V2_ECDSA
|
||||
#endif
|
||||
|
||||
#if CONFIG_SECURE_BOOT || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
|
||||
/** @brief Get the selected secure boot scheme key type
|
||||
*
|
||||
* @return key type for the selected secure boot scheme
|
||||
*/
|
||||
static inline const char* esp_secure_boot_get_scheme_name(esp_secure_boot_sig_scheme_t scheme)
|
||||
{
|
||||
switch (scheme) {
|
||||
case ESP_SECURE_BOOT_V2_RSA:
|
||||
return "RSA";
|
||||
case ESP_SECURE_BOOT_V1_ECDSA:
|
||||
case ESP_SECURE_BOOT_V2_ECDSA:
|
||||
return "ECDSA";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @brief Is secure boot currently enabled in hardware?
|
||||
*
|
||||
* This means that the ROM bootloader code will only boot
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Initialize console output (UART or USB)
|
||||
*/
|
||||
@@ -25,7 +21,3 @@ void bootloader_console_deinit(void);
|
||||
* Only defined if USB CDC is used for console output.
|
||||
*/
|
||||
void bootloader_console_write_char_usb(char c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -8,10 +8,6 @@
|
||||
#include "esp_err.h"
|
||||
#include "esp_image_format.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**@{*/
|
||||
/**
|
||||
* @brief labels from bootloader linker script: bootloader.ld
|
||||
@@ -53,7 +49,3 @@ void bootloader_print_banner(void);
|
||||
* ESP_FAIL - If the setting is not successful.
|
||||
*/
|
||||
esp_err_t bootloader_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -16,10 +16,6 @@
|
||||
#include <stdlib.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *bootloader_sha256_handle_t;
|
||||
|
||||
bootloader_sha256_handle_t bootloader_sha256_start(void);
|
||||
@@ -27,7 +23,3 @@ bootloader_sha256_handle_t bootloader_sha256_start(void);
|
||||
void bootloader_sha256_data(bootloader_sha256_handle_t handle, const void *data, size_t data_len);
|
||||
|
||||
void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -25,14 +25,6 @@
|
||||
#include "esp32h2/rom/secure_boot.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#include "esp32p4/rom/secure_boot.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C5
|
||||
#include "esp32c5/rom/secure_boot.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C61
|
||||
#include "esp32c61/rom/secure_boot.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !CONFIG_IDF_TARGET_ESP32 || CONFIG_ESP32_REV_MIN_FULL >= 300
|
||||
@@ -53,7 +45,3 @@ esp_err_t esp_secure_boot_verify_rsa_signature_block(const ets_secure_boot_signa
|
||||
#endif /* CONFIG_SECURE_BOOT_V2_ENABLED || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT */
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Configure analog super WDT reset
|
||||
*
|
||||
@@ -17,13 +12,16 @@ extern "C"
|
||||
*/
|
||||
void bootloader_ana_super_wdt_reset_config(bool enable);
|
||||
|
||||
/**
|
||||
* @brief Configure analog brownout reset
|
||||
*
|
||||
* @param enable Boolean to enable or disable brownout reset
|
||||
*/
|
||||
void bootloader_ana_bod_reset_config(bool enable);
|
||||
|
||||
/**
|
||||
* @brief Configure analog clock glitch reset
|
||||
*
|
||||
* @param enable Boolean to enable or disable clock glitch reset
|
||||
*/
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -9,11 +9,6 @@
|
||||
#include "esp_image_format.h"
|
||||
#include "bootloader_config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Load partition table.
|
||||
*
|
||||
@@ -21,7 +16,7 @@ extern "C"
|
||||
* OTA data partition, factory app partition, and test app partition.
|
||||
*
|
||||
* @param[out] bs Bootloader state structure used to save read data.
|
||||
* @return Return true if the partition table was successfully loaded and MD5 checksum is valid.
|
||||
* @return Return true if the partition table was succesfully loaded and MD5 checksum is valid.
|
||||
*/
|
||||
bool bootloader_utility_load_partition_table(bootloader_state_t* bs);
|
||||
|
||||
@@ -56,14 +51,9 @@ __attribute__((__noreturn__)) void bootloader_utility_load_boot_image(const boot
|
||||
/**
|
||||
* @brief Load that application which was worked before we go to the deep sleep.
|
||||
*
|
||||
* If chip supports the RTC memory:
|
||||
* Checks the reboot reason if it is the deep sleep and has a valid partition in the RTC memory
|
||||
* then try to load the application which was worked before we go to the deep sleep.
|
||||
*
|
||||
* If chip does not support the RTC memory:
|
||||
* Checks the reboot reason if it is the deep sleep then the partition table is read
|
||||
* to select and load an application which was worked before we go to the deep sleep.
|
||||
*
|
||||
*/
|
||||
void bootloader_utility_load_boot_image_from_deep_sleep(void);
|
||||
#endif
|
||||
@@ -130,7 +120,3 @@ void bootloader_debug_buffer(const void *buffer, size_t length, const char *labe
|
||||
* @return ESP_OK if secure boot digest is generated successfully.
|
||||
*/
|
||||
esp_err_t bootloader_sha256_flash_contents(uint32_t flash_offset, uint32_t len, uint8_t *digest);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -53,29 +53,32 @@ __attribute__((weak)) void bootloader_clock_configure(void)
|
||||
|
||||
clk_cfg.cpu_freq_mhz = cpu_freq_mhz;
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C5
|
||||
// TODO: [ESP32C5] IDF-9009 Check whether SOC_RTC_SLOW_CLK_SRC_RC_SLOW can be used on C5 MP
|
||||
// RC150K can't do calibrate on ESP32C5MPW so not use it
|
||||
clk_cfg.slow_clk_src = SOC_RTC_SLOW_CLK_SRC_RC32K;
|
||||
#else
|
||||
// Use RTC_SLOW clock source sel register field's default value, RC_SLOW, for 2nd stage bootloader
|
||||
// RTC_SLOW clock source will be switched according to Kconfig selection at application startup
|
||||
clk_cfg.slow_clk_src = rtc_clk_slow_src_get();
|
||||
if (clk_cfg.slow_clk_src == SOC_RTC_SLOW_CLK_SRC_INVALID) {
|
||||
clk_cfg.slow_clk_src = SOC_RTC_SLOW_CLK_SRC_RC_SLOW;
|
||||
}
|
||||
#endif
|
||||
|
||||
//TODO: [ESP32C61] IDF-9274, basic rtc support
|
||||
#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C61
|
||||
// TODO: IDF-5781 Some of esp32c6 SOC_RTC_FAST_CLK_SRC_XTAL_D2 rtc_fast clock has timing issue
|
||||
// Force to use SOC_RTC_FAST_CLK_SRC_RC_FAST since 2nd stage bootloader
|
||||
clk_cfg.fast_clk_src = SOC_RTC_FAST_CLK_SRC_RC_FAST;
|
||||
#else
|
||||
// Use RTC_FAST clock source sel register field's default value, XTAL_DIV, for 2nd stage bootloader
|
||||
// RTC_FAST clock source will be switched to RC_FAST at application startup
|
||||
clk_cfg.fast_clk_src = rtc_clk_fast_src_get();
|
||||
if (clk_cfg.fast_clk_src == SOC_RTC_FAST_CLK_SRC_INVALID) {
|
||||
clk_cfg.fast_clk_src = SOC_RTC_FAST_CLK_SRC_XTAL_DIV;
|
||||
}
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
if (efuse_hal_chip_revision() == 0) {
|
||||
// Some of ESP32C6-ECO0 chip's SOC_RTC_FAST_CLK_SRC_XTAL_D2 rtc_fast clock has timing issue,
|
||||
// which will cause the chip to be unable to capture the reset reason when it is reset.
|
||||
// Force to use SOC_RTC_FAST_CLK_SRC_RC_FAST since 2nd stage bootloader
|
||||
clk_cfg.fast_clk_src = SOC_RTC_FAST_CLK_SRC_RC_FAST;
|
||||
}
|
||||
#endif
|
||||
|
||||
rtc_clk_init(clk_cfg);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#include "esp_rom_uart.h"
|
||||
#include "esp_rom_sys.h"
|
||||
#include "esp_rom_caps.h"
|
||||
#if CONFIG_IDF_TARGET_ESP32C5
|
||||
#include "soc/pcr_reg.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_CONSOLE_NONE
|
||||
void bootloader_console_init(void)
|
||||
@@ -85,6 +88,13 @@ void bootloader_console_init(void)
|
||||
#if ESP_ROM_UART_CLK_IS_XTAL
|
||||
clock_hz = (uint32_t)rtc_clk_xtal_freq_get() * MHZ; // From esp32-s3 on, UART clk source is selected to XTAL in ROM
|
||||
#endif
|
||||
#if CONFIG_IDF_TARGET_ESP32C5_MP_VERSION
|
||||
#if CONFIG_IDF_ENV_FPGA
|
||||
clock_hz = CONFIG_XTAL_FREQ * MHZ;
|
||||
#else
|
||||
clock_hz = REG_GET_FIELD(PCR_SYSCLK_CONF_REG, PCR_CLK_XTAL_FREQ) * MHZ;
|
||||
#endif // CONFIG_IDF_ENV_FPGA
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C5_MP_VERSION
|
||||
esp_rom_uart_set_clock_baudrate(uart_num, clock_hz, CONFIG_ESP_CONSOLE_UART_BAUDRATE);
|
||||
}
|
||||
#endif // CONFIG_ESP_CONSOLE_UART
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
#include "hal/apm_hal.h"
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-9230 Remove the workaround when APM supported on C61!
|
||||
#if CONFIG_IDF_TARGET_ESP32C5 // TODO: IDF-8615 Remove the workaround when APM supported on C5!
|
||||
#include "soc/hp_apm_reg.h"
|
||||
#include "soc/lp_apm_reg.h"
|
||||
#include "soc/lp_apm0_reg.h"
|
||||
#endif
|
||||
|
||||
|
||||
void bootloader_init_mem(void)
|
||||
{
|
||||
|
||||
@@ -33,20 +33,18 @@ void bootloader_init_mem(void)
|
||||
* So, at boot disabling these filters. They will enable as per the
|
||||
* use case by TEE initialization code.
|
||||
*/
|
||||
#ifdef SOC_APM_CTRL_FILTER_SUPPORTED
|
||||
apm_hal_apm_ctrl_filter_enable_all(false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-9230 Remove the workaround when APM supported on C61!
|
||||
#if CONFIG_IDF_TARGET_ESP32C5 // TODO: IDF-8615 Remove the workaround when APM supported on C5!
|
||||
// disable apm filter
|
||||
REG_WRITE(LP_APM_FUNC_CTRL_REG, 0);
|
||||
REG_WRITE(LP_APM0_FUNC_CTRL_REG, 0);
|
||||
REG_WRITE(HP_APM_FUNC_CTRL_REG, 0);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
|
||||
// protect memory region
|
||||
esp_cpu_configure_region_protection();
|
||||
esp_cpu_configure_region_protection(); // TODO: [ESP32C5] IDF-8833 PSRAM support write
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -83,10 +83,10 @@
|
||||
}
|
||||
#endif // BOOTLOADER_BUILD
|
||||
|
||||
#if CONFIG_ESP_BRINGUP_BYPASS_RANDOM_SETTING
|
||||
#if CONFIG_IDF_ENV_FPGA
|
||||
static void s_non_functional(const char *func)
|
||||
{
|
||||
ESP_EARLY_LOGW("rand", "%s non-functional as RNG has not been supported yet", func);
|
||||
ESP_EARLY_LOGW("rand", "%s non-functional for FPGA builds", func);
|
||||
}
|
||||
|
||||
void bootloader_random_enable()
|
||||
@@ -98,4 +98,4 @@ void bootloader_random_disable()
|
||||
{
|
||||
s_non_functional(__func__);
|
||||
}
|
||||
#endif // CONFIG_ESP_BRINGUP_BYPASS_RANDOM_SETTING
|
||||
#endif // CONFIG_IDF_ENV_FPGA
|
||||
|
||||
@@ -4,99 +4,20 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#include "bootloader_random.h"
|
||||
#include "soc/soc.h"
|
||||
#include "soc/pcr_reg.h"
|
||||
#include "soc/apb_saradc_reg.h"
|
||||
#include "soc/pmu_reg.h"
|
||||
#include "hal/regi2c_ctrl.h"
|
||||
#include "soc/lpperi_reg.h"
|
||||
#include "soc/regi2c_saradc.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
static const uint32_t SAR2_CHANNEL = 9;
|
||||
static const uint32_t SAR1_CHANNEL = 7;
|
||||
static const uint32_t PATTERN_BIT_WIDTH = 6;
|
||||
static const uint32_t SAR1_ATTEN = 3;
|
||||
static const uint32_t SAR2_ATTEN = 3;
|
||||
|
||||
void bootloader_random_enable(void)
|
||||
{
|
||||
// pull SAR ADC out of reset
|
||||
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
|
||||
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
|
||||
|
||||
// enable SAR ADC APB clock
|
||||
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_CLK_EN);
|
||||
|
||||
// pull APB register out of reset
|
||||
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_RST_EN);
|
||||
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_RST_EN);
|
||||
|
||||
// enable ADC_CTRL_CLK (SAR ADC function clock)
|
||||
REG_SET_BIT(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_EN);
|
||||
|
||||
// select XTAL clock (40 MHz) source for ADC_CTRL_CLK
|
||||
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_SEL, 0); // 0: XTAL; 1: 80M(from bbpll); 2. FOSC
|
||||
|
||||
// set the clock divider for ADC_CTRL_CLK to default value (in case it has been changed)
|
||||
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_DIV_NUM, 0);
|
||||
|
||||
// some magic register poke from the digital team
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
|
||||
// Config ADC circuit (Analog part) with I2C (HOST ID 0X69) and choose internal voltage as sampling source
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_PERIF_ADDR, 1);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_EN_TOUT_ADDR, 1);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_EN_TOUT_ADDR, 1);
|
||||
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x08);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x66);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_SAR1_INIT_CODE_MSB, 0x08);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_SAR1_INIT_CODE_LSB, 0x66);
|
||||
|
||||
// create patterns and set them in pattern table
|
||||
uint32_t pattern_one = (SAR2_CHANNEL << 2) | SAR2_ATTEN; // we want channel 9 with max attenuation
|
||||
uint32_t pattern_two = (SAR1_CHANNEL << 2) | SAR1_ATTEN; // we want channel 7 with max attenuation
|
||||
uint32_t pattern_table = 0 | (pattern_two << 3 * PATTERN_BIT_WIDTH) | pattern_one << 2 * PATTERN_BIT_WIDTH;
|
||||
REG_WRITE(APB_SARADC_SAR_PATT_TAB1_REG, pattern_table);
|
||||
|
||||
// set pattern length (APB_SARADC_SARADC_SAR_PATT_LEN counts from 0)
|
||||
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SARADC_SAR_PATT_LEN, 1);
|
||||
|
||||
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SARADC_SAR_CLK_DIV, 15);
|
||||
|
||||
// set timer expiry (timer is ADC_CTRL_CLK)
|
||||
REG_SET_FIELD(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_TARGET, 200);
|
||||
|
||||
// enable timer
|
||||
REG_SET_BIT(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_EN);
|
||||
CLEAR_PERI_REG_MASK(LPPERI_RNG_CFG_REG, LPPERI_RNG_TIMER_EN);
|
||||
// TODO: [ESP32C5] IDF-8626, IDF-9197
|
||||
ESP_EARLY_LOGW("bootloader_random", "bootloader_random_enable() has not been implemented on C5 yet");
|
||||
}
|
||||
|
||||
void bootloader_random_disable(void)
|
||||
{
|
||||
// disable timer
|
||||
REG_CLR_BIT(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_EN);
|
||||
|
||||
// Write reset value of this register
|
||||
REG_WRITE(APB_SARADC_SAR_PATT_TAB1_REG, 0xFFFFFF);
|
||||
|
||||
// Revert ADC I2C configuration and initial voltage source setting
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x60);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_SAR1_INIT_CODE_MSB, 0x60);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_SAR1_INIT_CODE_LSB, 0x0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_PERIF_ADDR, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_EN_TOUT_ADDR, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_EN_TOUT_ADDR, 0);
|
||||
|
||||
// disable ADC_CTRL_CLK (SAR ADC function clock)
|
||||
REG_WRITE(PCR_SARADC_CLKM_CONF_REG, 0x00404000);
|
||||
|
||||
// Set PCR_SARADC_CONF_REG to initial state
|
||||
REG_WRITE(PCR_SARADC_CONF_REG, 0x5);
|
||||
// TODO: [ESP32C5] IDF-8626, IDF-9197
|
||||
ESP_EARLY_LOGW("bootloader_random", "bootloader_random_disable() has not been implemented on C5 yet");
|
||||
}
|
||||
|
||||
@@ -88,6 +88,9 @@ void bootloader_random_disable(void)
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_ENCAL_REF_ADDR, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_ENCAL_REF_ADDR, 0);
|
||||
|
||||
// Revert PMU_RF_PWC_REG to it's initial value
|
||||
CLEAR_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
|
||||
// disable ADC_CTRL_CLK (SAR ADC function clock)
|
||||
REG_WRITE(PCR_SARADC_CLKM_CONF_REG, 0x00404000);
|
||||
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#include "bootloader_random.h"
|
||||
#include "soc/soc.h"
|
||||
#include "soc/pcr_reg.h"
|
||||
#include "soc/apb_saradc_reg.h"
|
||||
#include "soc/pmu_reg.h"
|
||||
#include "hal/regi2c_ctrl.h"
|
||||
#include "soc/regi2c_saradc.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
static const uint32_t SAR2_CHANNEL = 9;
|
||||
static const uint32_t SAR1_CHANNEL = 7;
|
||||
static const uint32_t PATTERN_BIT_WIDTH = 6;
|
||||
static const uint32_t SAR1_ATTEN = 3;
|
||||
static const uint32_t SAR2_ATTEN = 3;
|
||||
|
||||
void bootloader_random_enable(void)
|
||||
{
|
||||
// pull SAR ADC out of reset
|
||||
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
|
||||
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
|
||||
|
||||
// enable SAR ADC APB clock
|
||||
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_CLK_EN);
|
||||
|
||||
// pull APB register out of reset
|
||||
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_RST_EN);
|
||||
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_RST_EN);
|
||||
|
||||
// enable ADC_CTRL_CLK (SAR ADC function clock)
|
||||
REG_SET_BIT(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_EN);
|
||||
|
||||
// select XTAL clock (40 MHz) source for ADC_CTRL_CLK
|
||||
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_SEL, 0);
|
||||
|
||||
// set the clock divider for ADC_CTRL_CLK to default value (in case it has been changed)
|
||||
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_DIV_NUM, 0);
|
||||
|
||||
// some ADC sensor registers are in power group PERIF_I2C and need to be enabled via PMU
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
|
||||
|
||||
// Config ADC circuit (Analog part) with I2C(HOST ID 0x69) and chose internal voltage as sampling source
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR , 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_RTC_ADDR , 1);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_ENCAL_REF_ADDR, 1);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_ENCAL_REF_ADDR, 1);
|
||||
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x08);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x66);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, 0x08);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_LOW_ADDR, 0x66);
|
||||
|
||||
// create patterns and set them in pattern table
|
||||
uint32_t pattern_one = (SAR2_CHANNEL << 2) | SAR2_ATTEN; // we want channel 9 with max attenuation
|
||||
uint32_t pattern_two = (SAR1_CHANNEL << 2) | SAR1_ATTEN; // we want channel 7 with max attenuation
|
||||
uint32_t pattern_table = 0 | (pattern_two << 3 * PATTERN_BIT_WIDTH) | pattern_one << 2 * PATTERN_BIT_WIDTH;
|
||||
REG_WRITE(SARADC_SAR_PATT_TAB1_REG, pattern_table);
|
||||
|
||||
// set pattern length to 2 (APB_SARADC_SAR_PATT_LEN counts from 0)
|
||||
REG_SET_FIELD(SARADC_CTRL_REG, SARADC_SAR_PATT_LEN, 1);
|
||||
|
||||
// Same as in C3
|
||||
REG_SET_FIELD(SARADC_CTRL_REG, SARADC_SAR_CLK_DIV, 15);
|
||||
|
||||
// set timer expiry (timer is ADC_CTRL_CLK)
|
||||
REG_SET_FIELD(SARADC_CTRL2_REG, SARADC_TIMER_TARGET, 200);
|
||||
|
||||
// enable timer
|
||||
REG_SET_BIT(SARADC_CTRL2_REG, SARADC_TIMER_EN);
|
||||
}
|
||||
|
||||
void bootloader_random_disable(void)
|
||||
{
|
||||
// disable timer
|
||||
REG_CLR_BIT(SARADC_CTRL2_REG, SARADC_TIMER_EN);
|
||||
|
||||
// Write reset value of this register
|
||||
REG_WRITE(SARADC_SAR_PATT_TAB1_REG, 0xFFFFFF);
|
||||
|
||||
// Revert ADC I2C configuration and initial voltage source setting
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x60);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, 0x60);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_LOW_ADDR, 0x0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_RTC_ADDR, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_ENCAL_REF_ADDR, 0);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_ENCAL_REF_ADDR, 0);
|
||||
|
||||
// disable ADC_CTRL_CLK (SAR ADC function clock)
|
||||
REG_WRITE(PCR_SARADC_CLKM_CONF_REG, 0x00404000);
|
||||
|
||||
// Set PCR_SARADC_CONF_REG to initial state
|
||||
REG_WRITE(PCR_SARADC_CONF_REG, 0x5);
|
||||
}
|
||||
@@ -461,33 +461,15 @@ static void set_actual_ota_seq(const bootloader_state_t *bs, int index)
|
||||
void bootloader_utility_load_boot_image_from_deep_sleep(void)
|
||||
{
|
||||
if (esp_rom_get_reset_reason(0) == RESET_REASON_CORE_DEEP_SLEEP) {
|
||||
#if SOC_RTC_FAST_MEM_SUPPORTED
|
||||
esp_partition_pos_t *partition = bootloader_common_get_rtc_retain_mem_partition();
|
||||
esp_image_metadata_t image_data;
|
||||
if (partition != NULL && bootloader_load_image_no_verify(partition, &image_data) == ESP_OK) {
|
||||
ESP_LOGI(TAG, "Fast booting app from partition at offset 0x%"PRIx32, partition->offset);
|
||||
bootloader_common_update_rtc_retain_mem(NULL, true);
|
||||
load_image(&image_data);
|
||||
}
|
||||
#else // !SOC_RTC_FAST_MEM_SUPPORTED
|
||||
bootloader_state_t bs = {0};
|
||||
if (bootloader_utility_load_partition_table(&bs)) {
|
||||
int index_of_last_loaded_app = FACTORY_INDEX;
|
||||
esp_ota_select_entry_t otadata[2];
|
||||
if (bs.ota_info.size && bootloader_common_read_otadata(&bs.ota_info, otadata) == ESP_OK) {
|
||||
int active_otadata = bootloader_common_get_active_otadata(otadata);
|
||||
if (active_otadata != -1) {
|
||||
index_of_last_loaded_app = (otadata[active_otadata].ota_seq - 1) % bs.app_count;
|
||||
}
|
||||
}
|
||||
esp_partition_pos_t partition = index_to_partition(&bs, index_of_last_loaded_app);
|
||||
if (partition != NULL) {
|
||||
esp_image_metadata_t image_data;
|
||||
if (partition.size && bootloader_load_image_no_verify(&partition, &image_data) == ESP_OK) {
|
||||
ESP_LOGI(TAG, "Fast booting app from partition at offset 0x%"PRIx32, partition.offset);
|
||||
if (bootloader_load_image_no_verify(partition, &image_data) == ESP_OK) {
|
||||
ESP_LOGI(TAG, "Fast booting app from partition at offset 0x%"PRIx32, partition->offset);
|
||||
bootloader_common_update_rtc_retain_mem(NULL, true);
|
||||
load_image(&image_data);
|
||||
}
|
||||
}
|
||||
#endif // !SOC_RTC_FAST_MEM_SUPPORTED
|
||||
ESP_LOGE(TAG, "Fast booting is not successful");
|
||||
ESP_LOGI(TAG, "Try to load an app as usual with all validations");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "hal/mmu_hal.h"
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/rwdt_ll.h"
|
||||
#include "hal/brownout_ll.h"
|
||||
|
||||
static const char *TAG = "boot.esp32c2";
|
||||
|
||||
@@ -82,8 +81,8 @@ static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable super WDT reset.
|
||||
bootloader_ana_super_wdt_reset_config(true);
|
||||
//Enable BOD reset (mode1)
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
//Enable BOD reset
|
||||
bootloader_ana_bod_reset_config(true);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
@@ -139,7 +138,7 @@ esp_err_t bootloader_init(void)
|
||||
}
|
||||
#endif // !CONFIG_APP_BUILD_TYPE_RAM
|
||||
|
||||
// check whether a WDT reset happened
|
||||
// check whether a WDT reset happend
|
||||
bootloader_check_wdt_reset();
|
||||
// config WDT
|
||||
bootloader_config_wdt();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -18,6 +18,17 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
void bootloader_ana_bod_reset_config(bool enable)
|
||||
{
|
||||
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST);
|
||||
|
||||
if (enable) {
|
||||
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
|
||||
} else {
|
||||
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
|
||||
}
|
||||
}
|
||||
|
||||
//Not supported but common bootloader calls the function. Do nothing
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "hal/rwdt_ll.h"
|
||||
#include "hal/brownout_ll.h"
|
||||
|
||||
static const char *TAG = "boot.esp32c3";
|
||||
|
||||
@@ -107,18 +106,18 @@ static inline void bootloader_ana_reset_config(void)
|
||||
case 0:
|
||||
case 1:
|
||||
//Disable BOD and GLITCH reset
|
||||
brownout_ll_ana_reset_enable(false);
|
||||
bootloader_ana_bod_reset_config(false);
|
||||
bootloader_ana_clock_glitch_reset_config(false);
|
||||
break;
|
||||
case 2:
|
||||
//Enable BOD reset. Disable GLITCH reset
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
bootloader_ana_bod_reset_config(true);
|
||||
bootloader_ana_clock_glitch_reset_config(false);
|
||||
break;
|
||||
case 3:
|
||||
default:
|
||||
//Enable BOD, and GLITCH reset
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
bootloader_ana_bod_reset_config(true);
|
||||
bootloader_ana_clock_glitch_reset_config(true);
|
||||
break;
|
||||
}
|
||||
@@ -183,7 +182,7 @@ esp_err_t bootloader_init(void)
|
||||
}
|
||||
#endif //#if !CONFIG_APP_BUILD_TYPE_RAM
|
||||
|
||||
// check whether a WDT reset happened
|
||||
// check whether a WDT reset happend
|
||||
bootloader_check_wdt_reset();
|
||||
// config WDT
|
||||
bootloader_config_wdt();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -18,6 +18,17 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
void bootloader_ana_bod_reset_config(bool enable)
|
||||
{
|
||||
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST);
|
||||
|
||||
if (enable) {
|
||||
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
|
||||
} else {
|
||||
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
|
||||
}
|
||||
}
|
||||
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
{
|
||||
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_GLITCH_RST);
|
||||
|
||||
@@ -38,10 +38,13 @@
|
||||
#include "esp_efuse.h"
|
||||
#include "hal/mmu_hal.h"
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/clk_tree_ll.h"
|
||||
#include "soc/lp_wdt_reg.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "hal/lpwdt_ll.h"
|
||||
#include "hal/regi2c_ctrl_ll.h"
|
||||
#if SOC_MODEM_CLOCK_SUPPORTED
|
||||
#include "modem/modem_lpcon_reg.h"
|
||||
#endif
|
||||
|
||||
static const char *TAG = "boot.esp32c5";
|
||||
|
||||
@@ -84,9 +87,11 @@ static void bootloader_super_wdt_auto_feed(void)
|
||||
|
||||
static inline void bootloader_hardware_init(void)
|
||||
{
|
||||
regi2c_ctrl_ll_master_enable_clock(true);
|
||||
regi2c_ctrl_ll_master_force_enable_clock(true); // TODO: IDF-8667 Remove this?
|
||||
regi2c_ctrl_ll_master_configure_clock();
|
||||
/* Enable analog i2c master clock */
|
||||
#if SOC_MODEM_CLOCK_SUPPORTED
|
||||
SET_PERI_REG_MASK(MODEM_LPCON_CLK_CONF_REG, MODEM_LPCON_CLK_I2C_MST_EN);
|
||||
SET_PERI_REG_MASK(MODEM_LPCON_I2C_MST_CLK_CONF_REG, MODEM_LPCON_CLK_I2C_MST_SEL_160M);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void bootloader_ana_reset_config(void)
|
||||
@@ -95,8 +100,8 @@ static inline void bootloader_ana_reset_config(void)
|
||||
//Enable super WDT reset.
|
||||
// bootloader_ana_super_wdt_reset_config(true);
|
||||
// TODO: [ESP32C5] IDF-8647
|
||||
//Enable BOD reset TODO: [ESP32C5] IDF-8667
|
||||
// brownout_ll_ana_reset_enable(true);
|
||||
//Enable BOD reset
|
||||
// bootloader_ana_bod_reset_config(true);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
@@ -158,7 +163,7 @@ esp_err_t bootloader_init(void)
|
||||
}
|
||||
#endif // !CONFIG_APP_BUILD_TYPE_RAM
|
||||
|
||||
// check whether a WDT reset happened
|
||||
// check whether a WDT reset happend
|
||||
bootloader_check_wdt_reset();
|
||||
// config WDT
|
||||
bootloader_config_wdt();
|
||||
|
||||
@@ -16,6 +16,12 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
|
||||
ESP_EARLY_LOGW("bootloader", "bootloader_ana_super_wdt_reset_config() has not been implemented on C5 yet");
|
||||
}
|
||||
|
||||
void bootloader_ana_bod_reset_config(bool enable)
|
||||
{
|
||||
// TODO: [ESP32C5] IDF-8667
|
||||
ESP_EARLY_LOGW("bootloader", "bootloader_ana_bod_reset_config() has not been implemented on C5 yet");
|
||||
}
|
||||
|
||||
//Not supported but common bootloader calls the function. Do nothing
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
{
|
||||
|
||||
@@ -23,12 +23,13 @@ esp_err_t esp_flash_encryption_enable_secure_features(void)
|
||||
ESP_LOGW(TAG, "Not disabling UART bootloader encryption");
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_CACHE
|
||||
ESP_LOGI(TAG, "Disable UART bootloader cache...");
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_SPI_DOWNLOAD_MSPI_DIS);
|
||||
#else
|
||||
ESP_LOGW(TAG, "Not disabling UART bootloader cache - SECURITY COMPROMISED");
|
||||
#endif
|
||||
// TODO: [ESP32C5] IDF-8623 check if the following code is still supported
|
||||
// #ifndef CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_CACHE
|
||||
// ESP_LOGI(TAG, "Disable UART bootloader cache...");
|
||||
// esp_efuse_write_field_bit(ESP_EFUSE_DIS_DOWNLOAD_ICACHE);
|
||||
// #else
|
||||
// ESP_LOGW(TAG, "Not disabling UART bootloader cache - SECURITY COMPROMISED");
|
||||
// #endif
|
||||
|
||||
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
|
||||
ESP_LOGI(TAG, "Disable JTAG...");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -43,8 +43,7 @@
|
||||
#include "soc/lp_wdt_reg.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "hal/lpwdt_ll.h"
|
||||
#include "hal/regi2c_ctrl_ll.h"
|
||||
#include "hal/brownout_ll.h"
|
||||
#include "modem/modem_lpcon_reg.h"
|
||||
|
||||
static const char *TAG = "boot.esp32c6";
|
||||
|
||||
@@ -96,16 +95,17 @@ static inline void bootloader_hardware_init(void)
|
||||
esp_rom_spiflash_fix_dummylen(1, 1);
|
||||
#endif
|
||||
|
||||
regi2c_ctrl_ll_master_enable_clock(true);
|
||||
regi2c_ctrl_ll_master_configure_clock();
|
||||
/* Enable analog i2c master clock */
|
||||
SET_PERI_REG_MASK(MODEM_LPCON_CLK_CONF_REG, MODEM_LPCON_CLK_I2C_MST_EN);
|
||||
SET_PERI_REG_MASK(MODEM_LPCON_I2C_MST_CLK_CONF_REG, MODEM_LPCON_CLK_I2C_MST_SEL_160M);
|
||||
}
|
||||
|
||||
static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable super WDT reset.
|
||||
bootloader_ana_super_wdt_reset_config(true);
|
||||
//Enable BOD mode1 hardware reset
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
//Enable BOD reset
|
||||
bootloader_ana_bod_reset_config(true);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
@@ -167,7 +167,7 @@ esp_err_t bootloader_init(void)
|
||||
}
|
||||
#endif // !CONFIG_APP_BUILD_TYPE_RAM
|
||||
|
||||
// check whether a WDT reset happened
|
||||
// check whether a WDT reset happend
|
||||
bootloader_check_wdt_reset();
|
||||
// config WDT
|
||||
bootloader_config_wdt();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -15,6 +15,17 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
|
||||
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_SUPER_WDT_RST);
|
||||
}
|
||||
|
||||
void bootloader_ana_bod_reset_config(bool enable)
|
||||
{
|
||||
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
|
||||
|
||||
if (enable) {
|
||||
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
|
||||
} else {
|
||||
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
|
||||
}
|
||||
}
|
||||
|
||||
//Not supported but common bootloader calls the function. Do nothing
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
{
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
#include "esp_efuse.h"
|
||||
#include "hal/mmu_hal.h"
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/clk_tree_ll.h"
|
||||
#include "soc/lp_wdt_reg.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "hal/lpwdt_ll.h"
|
||||
#include "hal/regi2c_ctrl_ll.h"
|
||||
|
||||
static const char *TAG = "boot.esp32c61";
|
||||
|
||||
@@ -85,17 +85,29 @@ static void bootloader_super_wdt_auto_feed(void)
|
||||
|
||||
static inline void bootloader_hardware_init(void)
|
||||
{
|
||||
regi2c_ctrl_ll_master_enable_clock(true);
|
||||
regi2c_ctrl_ll_master_force_enable_clock(true); // TODO: IDF-9274 Remove this?
|
||||
regi2c_ctrl_ll_master_configure_clock();
|
||||
// In 80MHz flash mode, ROM sets the mspi module clk divider to 2, fix it here
|
||||
#if CONFIG_ESPTOOLPY_FLASHFREQ_80M && !CONFIG_APP_BUILD_TYPE_RAM
|
||||
clk_ll_mspi_fast_set_hs_divider(6);
|
||||
esp_rom_spiflash_config_clk(1, 0);
|
||||
esp_rom_spiflash_config_clk(1, 1);
|
||||
esp_rom_spiflash_fix_dummylen(0, 1);
|
||||
esp_rom_spiflash_fix_dummylen(1, 1);
|
||||
#endif
|
||||
|
||||
//TODO: [ESP32C61] IDF-9276
|
||||
#if CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
|
||||
ESP_EARLY_LOGW(TAG, "ESP32C61 attention: analog i2c master clock enable skipped!!!");
|
||||
#else
|
||||
ESP_LOGW(TAG, "ESP32C61 attention: analog i2c master clock enable skipped!!!");
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable super WDT reset.
|
||||
bootloader_ana_super_wdt_reset_config(true);
|
||||
//Enable BOD reset TODO: IDF-9254 BOD support
|
||||
// brownout_ll_ana_reset_enable(true);
|
||||
//Enable BOD reset
|
||||
bootloader_ana_bod_reset_config(true);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
|
||||
@@ -18,6 +18,18 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
|
||||
// REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_SUPER_WDT_RST);
|
||||
}
|
||||
|
||||
void bootloader_ana_bod_reset_config(bool enable)
|
||||
{
|
||||
// lp_analog_peri_reg.h updated, now following registers
|
||||
// REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
|
||||
|
||||
if (enable) {
|
||||
REG_SET_BIT(LP_ANA_BOD_MODE1_CNTL_REG, LP_ANA_BOD_MODE1_RESET_ENA);
|
||||
} else {
|
||||
REG_CLR_BIT(LP_ANA_BOD_MODE1_CNTL_REG, LP_ANA_BOD_MODE1_RESET_ENA);
|
||||
}
|
||||
}
|
||||
|
||||
//Not supported but common bootloader calls the function. Do nothing
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
{
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <strings.h>
|
||||
#include "esp_flash_encrypt.h"
|
||||
#include "esp_secure_boot.h"
|
||||
#include "esp_efuse.h"
|
||||
#include "esp_efuse_table.h"
|
||||
#include "esp_log.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
static __attribute__((unused)) const char *TAG = "secure_boot";
|
||||
|
||||
esp_err_t esp_secure_boot_enable_secure_features(void)
|
||||
{
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
|
||||
|
||||
#ifdef CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE
|
||||
ESP_LOGI(TAG, "Enabling Security download mode...");
|
||||
esp_err_t err = esp_efuse_enable_rom_secure_download_mode();
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Could not enable Security download mode...");
|
||||
return err;
|
||||
}
|
||||
#elif CONFIG_SECURE_DISABLE_ROM_DL_MODE
|
||||
ESP_LOGI(TAG, "Disable ROM Download mode...");
|
||||
esp_err_t err = esp_efuse_disable_rom_download_mode();
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Could not disable ROM Download mode...");
|
||||
return err;
|
||||
}
|
||||
#else
|
||||
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
|
||||
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_DIS_USB_JTAG);
|
||||
// TODO in IDF-10694
|
||||
// esp_efuse_write_field_cnt(ESP_EFUSE_SOFT_DIS_JTAG, ESP_EFUSE_SOFT_DIS_JTAG[0]->bit_count);
|
||||
#else
|
||||
ESP_LOGW(TAG, "Not disabling JTAG - SECURITY COMPROMISED");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_AGGRESSIVE_REVOKE);
|
||||
#endif
|
||||
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_EN);
|
||||
|
||||
#ifndef CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
|
||||
bool rd_dis_now = true;
|
||||
#ifdef CONFIG_SECURE_FLASH_ENC_ENABLED
|
||||
/* If flash encryption is not enabled yet then don't read-disable efuses yet, do it later in the boot
|
||||
when Flash Encryption is being enabled */
|
||||
rd_dis_now = esp_flash_encryption_enabled();
|
||||
#endif
|
||||
if (rd_dis_now) {
|
||||
ESP_LOGI(TAG, "Prevent read disabling of additional efuses...");
|
||||
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_RD_DIS);
|
||||
}
|
||||
#else
|
||||
ESP_LOGW(TAG, "Allowing read disabling of additional efuses - SECURITY COMPROMISED");
|
||||
#endif
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "esp_private/regi2c_ctrl.h"
|
||||
#include "soc/regi2c_lp_bias.h"
|
||||
#include "soc/regi2c_bias.h"
|
||||
#include "modem/modem_lpcon_reg.h"
|
||||
#include "bootloader_console.h"
|
||||
#include "bootloader_flash_priv.h"
|
||||
#include "bootloader_soc.h"
|
||||
@@ -42,8 +43,7 @@
|
||||
#include "soc/lp_wdt_reg.h"
|
||||
#include "soc/pmu_reg.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "hal/regi2c_ctrl_ll.h"
|
||||
#include "hal/brownout_ll.h"
|
||||
#include "modem/modem_lpcon_reg.h"
|
||||
|
||||
static const char *TAG = "boot.esp32h2";
|
||||
|
||||
@@ -89,17 +89,16 @@ static inline void bootloader_hardware_init(void)
|
||||
/* Disable RF pll by default */
|
||||
CLEAR_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_RFPLL);
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_FORCE_RFPLL);
|
||||
|
||||
regi2c_ctrl_ll_master_enable_clock(true);
|
||||
regi2c_ctrl_ll_master_configure_clock();
|
||||
/* Enable analog i2c master clock */
|
||||
SET_PERI_REG_MASK(MODEM_LPCON_CLK_CONF_REG, MODEM_LPCON_CLK_I2C_MST_EN);
|
||||
}
|
||||
|
||||
static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable super WDT reset.
|
||||
bootloader_ana_super_wdt_reset_config(true);
|
||||
//Enable BOD reset (mode1)
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
//Enable BOD reset
|
||||
bootloader_ana_bod_reset_config(true);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
@@ -161,7 +160,7 @@ esp_err_t bootloader_init(void)
|
||||
}
|
||||
#endif // !CONFIG_APP_BUILD_TYPE_RAM
|
||||
|
||||
// check whether a WDT reset happened
|
||||
// check whether a WDT reset happend
|
||||
bootloader_check_wdt_reset();
|
||||
// config WDT
|
||||
bootloader_config_wdt();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -13,6 +13,17 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
|
||||
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_SUPER_WDT_RST);
|
||||
}
|
||||
|
||||
void bootloader_ana_bod_reset_config(bool enable)
|
||||
{
|
||||
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
|
||||
|
||||
if (enable) {
|
||||
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
|
||||
} else {
|
||||
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
|
||||
}
|
||||
}
|
||||
|
||||
//Not supported but common bootloader calls the function. Do nothing
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
{
|
||||
|
||||
@@ -41,15 +41,11 @@
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/clk_tree_ll.h"
|
||||
#include "hal/lpwdt_ll.h"
|
||||
#include "hal/spimem_flash_ll.h"
|
||||
#include "soc/lp_wdt_reg.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "soc/regi2c_syspll.h"
|
||||
#include "soc/regi2c_cpll.h"
|
||||
#include "soc/regi2c_bias.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
#include "hal/regi2c_ctrl_ll.h"
|
||||
#include "hal/brownout_ll.h"
|
||||
|
||||
static const char *TAG = "boot.esp32p4";
|
||||
|
||||
@@ -94,10 +90,7 @@ static void bootloader_super_wdt_auto_feed(void)
|
||||
|
||||
static inline void bootloader_hardware_init(void)
|
||||
{
|
||||
int __DECLARE_RCC_RC_ATOMIC_ENV __attribute__ ((unused)); // To avoid build errors/warnings about __DECLARE_RCC_RC_ATOMIC_ENV
|
||||
regi2c_ctrl_ll_master_enable_clock(true);
|
||||
regi2c_ctrl_ll_master_configure_clock();
|
||||
|
||||
// regi2c is enabled by default on ESP32P4, do nothing
|
||||
unsigned chip_version = efuse_hal_chip_revision();
|
||||
if (!ESP_CHIP_REV_ABOVE(chip_version, 1)) {
|
||||
// On ESP32P4 ECO0, the default (power on reset) CPLL and SPLL frequencies are very high, lower them to avoid bias may not be enough in bootloader
|
||||
@@ -108,21 +101,14 @@ static inline void bootloader_hardware_init(void)
|
||||
}
|
||||
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1, 10);
|
||||
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1_PVT, 10);
|
||||
|
||||
// IDF-10019 TODO: This is temporarily for ESP32P4-ECO0, please remove it when eco0 is not widly used.
|
||||
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused));
|
||||
if (likely(ESP_CHIP_REV_ABOVE(chip_version, 1))) {
|
||||
spimem_flash_ll_select_clk_source(0, FLASH_CLK_SRC_SPLL);
|
||||
spimem_ctrlr_ll_set_core_clock(0, 6);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable super WDT reset.
|
||||
bootloader_ana_super_wdt_reset_config(true);
|
||||
//Enable BOD reset (mode1)
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
//Enable BOD reset
|
||||
bootloader_ana_bod_reset_config(true);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_init(void)
|
||||
|
||||
@@ -5,12 +5,21 @@
|
||||
*/
|
||||
#include <stdbool.h>
|
||||
#include "soc/lp_analog_peri_reg.h"
|
||||
#include "soc/soc.h"
|
||||
#include "hal/brownout_ll.h"
|
||||
|
||||
void bootloader_ana_super_wdt_reset_config(bool enable)
|
||||
{
|
||||
//TODO: IDF-7514
|
||||
}
|
||||
|
||||
void bootloader_ana_bod_reset_config(bool enable)
|
||||
{
|
||||
REG_CLR_BIT(LP_ANALOG_PERI_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
|
||||
|
||||
brownout_ll_ana_reset_enable(enable);
|
||||
}
|
||||
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
{
|
||||
//TODO: IDF-7514
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "hal/mmu_hal.h"
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/rwdt_ll.h"
|
||||
#include "hal/brownout_ll.h"
|
||||
#include "xtensa/config/core.h"
|
||||
#include "xt_instr_macros.h"
|
||||
|
||||
@@ -134,7 +133,7 @@ static inline void bootloader_ana_reset_config(void)
|
||||
{
|
||||
//Enable WDT, BOD, and GLITCH reset
|
||||
bootloader_ana_super_wdt_reset_config(true);
|
||||
brownout_ll_ana_reset_enable(true);
|
||||
bootloader_ana_bod_reset_config(true);
|
||||
bootloader_ana_clock_glitch_reset_config(true);
|
||||
}
|
||||
|
||||
@@ -205,7 +204,7 @@ esp_err_t bootloader_init(void)
|
||||
}
|
||||
#endif // !CONFIG_APP_BUILD_TYPE_RAM
|
||||
|
||||
// check whether a WDT reset happened
|
||||
// check whether a WDT reset happend
|
||||
bootloader_check_wdt_reset();
|
||||
// config WDT
|
||||
bootloader_config_wdt();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -18,6 +18,17 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
void bootloader_ana_bod_reset_config(bool enable)
|
||||
{
|
||||
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST);
|
||||
|
||||
if (enable) {
|
||||
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
|
||||
} else {
|
||||
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
|
||||
}
|
||||
}
|
||||
|
||||
void bootloader_ana_clock_glitch_reset_config(bool enable)
|
||||
{
|
||||
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_GLITCH_RST);
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "esp_secure_boot.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
|
||||
//TODO:[ESP32C61] IDf-9232
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#define CRYPT_CNT ESP_EFUSE_FLASH_CRYPT_CNT
|
||||
#define WR_DIS_CRYPT_CNT ESP_EFUSE_WR_DIS_FLASH_CRYPT_CNT
|
||||
@@ -355,47 +357,22 @@ bool esp_flash_encryption_cfg_verify_release_mode(void)
|
||||
ESP_LOGW(TAG, "Not disabled UART bootloader cache (set DIS_DOWNLOAD_ICACHE->1)");
|
||||
}
|
||||
#endif
|
||||
bool soft_dis_jtag_complete = false;
|
||||
#if SOC_EFUSE_SOFT_DIS_JTAG
|
||||
size_t soft_dis_jtag_cnt_val = 0;
|
||||
esp_efuse_read_field_cnt(ESP_EFUSE_SOFT_DIS_JTAG, &soft_dis_jtag_cnt_val);
|
||||
soft_dis_jtag_complete = (soft_dis_jtag_cnt_val == ESP_EFUSE_SOFT_DIS_JTAG[0]->bit_count);
|
||||
if (soft_dis_jtag_complete) {
|
||||
bool hmac_key_found = false;
|
||||
hmac_key_found = esp_efuse_find_purpose(ESP_EFUSE_KEY_PURPOSE_HMAC_DOWN_JTAG, NULL);
|
||||
hmac_key_found |= esp_efuse_find_purpose(ESP_EFUSE_KEY_PURPOSE_HMAC_DOWN_ALL, NULL);
|
||||
if (!hmac_key_found) {
|
||||
ESP_LOGW(TAG, "SOFT_DIS_JTAG is set but HMAC key with respective purpose not found");
|
||||
soft_dis_jtag_complete = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!soft_dis_jtag_complete) {
|
||||
#if SOC_EFUSE_DIS_PAD_JTAG
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled JTAG PADs (set DIS_PAD_JTAG->1)");
|
||||
}
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled JTAG PADs (set DIS_PAD_JTAG->1)");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_EFUSE_DIS_USB_JTAG
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_USB_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled USB JTAG (set DIS_USB_JTAG->1)");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_EFUSE_HARD_DIS_JTAG
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_HARD_DIS_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled JTAG (set HARD_DIS_JTAG->1)");
|
||||
}
|
||||
#endif
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_USB_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled USB JTAG (set DIS_USB_JTAG->1)");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_EFUSE_DIS_DIRECT_BOOT
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
|
||||
@@ -405,6 +382,14 @@ bool esp_flash_encryption_cfg_verify_release_mode(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_EFUSE_HARD_DIS_JTAG
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_HARD_DIS_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled JTAG (set HARD_DIS_JTAG->1)");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_EFUSE_DIS_BOOT_REMAP
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_BOOT_REMAP);
|
||||
result &= secure;
|
||||
|
||||
@@ -16,16 +16,10 @@
|
||||
#include "esp_log.h"
|
||||
#include "hal/wdt_hal.h"
|
||||
|
||||
// Need to remove check and merge accordingly for ESP32C5 once key manager support added in IDF-8621
|
||||
#if SOC_KEY_MANAGER_SUPPORTED || CONFIG_IDF_TARGET_ESP32C5
|
||||
#if CONFIG_IDF_TARGET_ESP32C5
|
||||
#include "soc/keymng_reg.h"
|
||||
#include "hal/key_mgr_types.h"
|
||||
#include "soc/pcr_reg.h"
|
||||
#else
|
||||
#if SOC_KEY_MANAGER_SUPPORTED
|
||||
#include "hal/key_mgr_hal.h"
|
||||
#include "hal/mspi_timing_tuning_ll.h"
|
||||
#endif /* CONFIG_IDF_TARGET_ESP32C5 */
|
||||
#include "soc/keymng_reg.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK
|
||||
@@ -222,17 +216,17 @@ static esp_err_t check_and_generate_encryption_keys(void)
|
||||
}
|
||||
ESP_LOGI(TAG, "Using pre-loaded flash encryption key in efuse");
|
||||
}
|
||||
// Need to remove check for ESP32C5 and merge accordingly once key manager support added in IDF-8621
|
||||
#if SOC_KEY_MANAGER_SUPPORTED || CONFIG_IDF_TARGET_ESP32C5
|
||||
#if CONFIG_IDF_TARGET_ESP32C5
|
||||
REG_SET_FIELD(KEYMNG_STATIC_REG, KEYMNG_USE_EFUSE_KEY, 2);
|
||||
|
||||
#if SOC_KEY_MANAGER_SUPPORTED
|
||||
#if CONFIG_IDF_TARGET_ESP32C5 && SOC_KEY_MANAGER_SUPPORTED
|
||||
// TODO: [ESP32C5] IDF-8622 find a more proper place for these codes
|
||||
REG_SET_BIT(KEYMNG_STATIC_REG, KEYMNG_USE_EFUSE_KEY_FLASH);
|
||||
REG_SET_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
|
||||
REG_CLR_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
|
||||
#else
|
||||
#endif
|
||||
// Force Key Manager to use eFuse key for XTS-AES operation
|
||||
key_mgr_hal_set_key_usage(ESP_KEY_MGR_XTS_AES_128_KEY, ESP_KEY_MGR_USE_EFUSE_KEY);
|
||||
_mspi_timing_ll_reset_mspi();
|
||||
#endif /* CONFIG_IDF_TARGET_ESP32C5 */
|
||||
#endif
|
||||
|
||||
return ESP_OK;
|
||||
@@ -428,7 +422,7 @@ static esp_err_t encrypt_partition(int index, const esp_partition_info_t *partit
|
||||
&partition->pos,
|
||||
&image_data);
|
||||
should_encrypt = (err == ESP_OK);
|
||||
#ifdef CONFIG_SECURE_FLASH_ENCRYPT_ONLY_IMAGE_LEN_IN_APP_PART
|
||||
#ifdef SECURE_FLASH_ENCRYPT_ONLY_IMAGE_LEN_IN_APP_PART
|
||||
if (should_encrypt) {
|
||||
// Encrypt only the app image instead of encrypting the whole partition
|
||||
size = image_data.image_len;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -298,47 +298,38 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
bool soft_dis_jtag_complete = false;
|
||||
#if SOC_EFUSE_HARD_DIS_JTAG
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_HARD_DIS_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled JTAG (set HARD_DIS_JTAG->1)");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_EFUSE_SOFT_DIS_JTAG
|
||||
size_t soft_dis_jtag_cnt_val = 0;
|
||||
esp_efuse_read_field_cnt(ESP_EFUSE_SOFT_DIS_JTAG, &soft_dis_jtag_cnt_val);
|
||||
soft_dis_jtag_complete = (soft_dis_jtag_cnt_val == ESP_EFUSE_SOFT_DIS_JTAG[0]->bit_count);
|
||||
if (soft_dis_jtag_complete) {
|
||||
bool hmac_key_found = false;
|
||||
hmac_key_found = esp_efuse_find_purpose(ESP_EFUSE_KEY_PURPOSE_HMAC_DOWN_JTAG, NULL);
|
||||
hmac_key_found |= esp_efuse_find_purpose(ESP_EFUSE_KEY_PURPOSE_HMAC_DOWN_ALL, NULL);
|
||||
if (!hmac_key_found) {
|
||||
ESP_LOGW(TAG, "SOFT_DIS_JTAG is set but HMAC key with respective purpose not found");
|
||||
soft_dis_jtag_complete = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!soft_dis_jtag_complete) {
|
||||
#if SOC_EFUSE_HARD_DIS_JTAG
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_HARD_DIS_JTAG);
|
||||
if (soft_dis_jtag_cnt_val != ESP_EFUSE_SOFT_DIS_JTAG[0]->bit_count) {
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled JTAG (set HARD_DIS_JTAG->1)");
|
||||
}
|
||||
ESP_LOGW(TAG, "Not disabled JTAG in the soft way (set SOFT_DIS_JTAG->max)");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_EFUSE_DIS_PAD_JTAG
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled JTAG PADs (set DIS_PAD_JTAG->1)");
|
||||
}
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled JTAG PADs (set DIS_PAD_JTAG->1)");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_EFUSE_DIS_USB_JTAG
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_USB_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled USB JTAG (set DIS_USB_JTAG->1)");
|
||||
}
|
||||
#endif
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_USB_JTAG);
|
||||
result &= secure;
|
||||
if (!secure) {
|
||||
ESP_LOGW(TAG, "Not disabled USB JTAG (set DIS_USB_JTAG->1)");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
|
||||
secure = esp_efuse_read_field_bit(ESP_EFUSE_SECURE_BOOT_AGGRESSIVE_REVOKE);
|
||||
|
||||
@@ -70,7 +70,7 @@ esp_err_t esp_secure_boot_verify_ecdsa_signature_block(const esp_secure_boot_sig
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
if (sig_block->version != ESP_SECURE_BOOT_SCHEME) {
|
||||
if (sig_block->version != 0) {
|
||||
ESP_LOGE(TAG, "image has invalid signature version field 0x%08"PRIx32" (image without a signature?)", sig_block->version);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ esp_err_t esp_secure_boot_verify_ecdsa_signature_block(const esp_secure_boot_sig
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
if (sig_block->version != ESP_SECURE_BOOT_SCHEME) {
|
||||
if (sig_block->version != 0) {
|
||||
ESP_LOGE(TAG, "image has invalid signature version field 0x%08" PRIx32 " (image without a signature?)", sig_block->version);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
#include "esp32h2/rom/secure_boot.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#include "esp32p4/rom/secure_boot.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C5
|
||||
#include "esp32c5/rom/secure_boot.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C61
|
||||
#include "esp32c61/rom/secure_boot.h"
|
||||
#endif
|
||||
|
||||
esp_err_t verify_ecdsa_signature_block(const ets_secure_boot_signature_t *sig_block, const uint8_t *image_digest, const ets_secure_boot_sig_block_t *trusted_block);
|
||||
|
||||
@@ -44,10 +44,6 @@ static esp_err_t validate_signature_block(const ets_secure_boot_sig_block_t *blo
|
||||
|| block->block_crc != esp_rom_crc32_le(0, (uint8_t *)block, CRC_SIGN_BLOCK_LEN)) {
|
||||
return ESP_FAIL;
|
||||
}
|
||||
if (block->version != ESP_SECURE_BOOT_SCHEME) {
|
||||
ESP_LOGE(TAG, "%s signing scheme selected but signature block generated for %s scheme", esp_secure_boot_get_scheme_name(ESP_SECURE_BOOT_SCHEME), esp_secure_boot_get_scheme_name(block->version));
|
||||
return ESP_FAIL;
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,10 +61,6 @@ static esp_err_t validate_signature_block(const ets_secure_boot_sig_block_t *blo
|
||||
|| block->block_crc != esp_rom_crc32_le(0, (uint8_t *)block, CRC_SIGN_BLOCK_LEN)) {
|
||||
return ESP_FAIL;
|
||||
}
|
||||
if (block->version != ESP_SECURE_BOOT_SCHEME) {
|
||||
ESP_LOGE(TAG, "%s signing scheme selected but signature block generated for %s scheme", esp_secure_boot_get_scheme_name(ESP_SECURE_BOOT_SCHEME), esp_secure_boot_get_scheme_name(block->version));
|
||||
return ESP_FAIL;
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -152,21 +148,9 @@ esp_err_t esp_secure_boot_verify_sbv2_signature_block(const ets_secure_boot_sign
|
||||
int sb_result = ets_secure_boot_verify_signature(sig_block, image_digest, trusted.key_digests[0], verified_digest);
|
||||
#else
|
||||
ets_secure_boot_key_digests_t trusted_key_digests = {0};
|
||||
bool valid_sig_blk = false;
|
||||
for (unsigned i = 0; i < SECURE_BOOT_NUM_BLOCKS; i++) {
|
||||
if (sig_block->block[i].version != ESP_SECURE_BOOT_SCHEME) {
|
||||
ESP_LOGD(TAG, "%s signing scheme selected but signature block %d generated for %s scheme", esp_secure_boot_get_scheme_name(ESP_SECURE_BOOT_SCHEME), i, esp_secure_boot_get_scheme_name(sig_block->block[i].version));
|
||||
continue;
|
||||
} else {
|
||||
valid_sig_blk = true;
|
||||
}
|
||||
trusted_key_digests.key_digests[i] = &trusted.key_digests[i];
|
||||
}
|
||||
if (valid_sig_blk != true) {
|
||||
ESP_LOGE(TAG, "No signature block generated for valid scheme");
|
||||
ESP_LOGE(TAG, "%s signing scheme selected but no signature block for the selected scheme", esp_secure_boot_get_scheme_name(ESP_SECURE_BOOT_SCHEME));
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
// Key revocation happens in ROM bootloader.
|
||||
// Do NOT allow key revocation while verifying application
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
|
||||
@@ -7,7 +8,6 @@ from pytest_embedded import Dut
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32c5
|
||||
@pytest.mark.esp32c6
|
||||
@pytest.mark.esp32h2
|
||||
@pytest.mark.esp32s2
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user