forked from espressif/esp-idf
Compare commits
1127 Commits
uart_parti
...
v5.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c2820d377 | ||
|
|
daf8117cb9 | ||
|
|
f66322c9b7 | ||
|
|
e35dbbbee0 | ||
|
|
da1372d691 | ||
|
|
6d9c2b9c0f | ||
|
|
119048bb75 | ||
|
|
57bcbbb449 | ||
|
|
bc38724221 | ||
|
|
8b80e26f4d | ||
|
|
74eadefb1a | ||
|
|
b1d0ffba15 | ||
|
|
a2d0171a17 | ||
|
|
24fed6d3c2 | ||
|
|
a83a0ab02b | ||
|
|
291a008840 | ||
|
|
5cbd2a3877 | ||
|
|
c26ce742cf | ||
|
|
9b493740ab | ||
|
|
3d55047a09 | ||
|
|
061ba0c99e | ||
|
|
7c0e10ba41 | ||
|
|
4f39b2476e | ||
|
|
f8843158b2 | ||
|
|
8e031cf8c3 | ||
|
|
f86473e255 | ||
|
|
24f00874af | ||
|
|
6bad67bf3c | ||
|
|
8eab42d7e1 | ||
|
|
9d59600746 | ||
|
|
aa60465e13 | ||
|
|
2469db58a9 | ||
|
|
109532bbf9 | ||
|
|
6d749486b9 | ||
|
|
2fa5c7d9eb | ||
|
|
6de3fde3c2 | ||
|
|
e72c3b4ee4 | ||
|
|
9fcb33d3ac | ||
|
|
e1b32b4363 | ||
|
|
7f88cf3ee9 | ||
|
|
419e8b2e20 | ||
|
|
3f69abdb7e | ||
|
|
b0306575a8 | ||
|
|
3144cef12e | ||
|
|
2ed77df856 | ||
|
|
78f615f979 | ||
|
|
793fe61c81 | ||
|
|
2ed843bdd2 | ||
|
|
0076bb0289 | ||
|
|
5afa94872b | ||
|
|
d4aa25a38e | ||
|
|
57d976b7f3 | ||
|
|
154b7548cb | ||
|
|
7b95c5d571 | ||
|
|
7e31189ede | ||
|
|
99fe472c8f | ||
|
|
6e2b2a0e54 | ||
|
|
e1ef60deef | ||
|
|
03e9656ce0 | ||
|
|
0ba53566fa | ||
|
|
aa97a0fc3c | ||
|
|
6150ea9a43 | ||
|
|
62db86d229 | ||
|
|
8e6ec50bcc | ||
|
|
ccb69d4cf6 | ||
|
|
0ee066c8b5 | ||
|
|
8a44211856 | ||
|
|
b18506da8b | ||
|
|
4ecb1cec3c | ||
|
|
1312472337 | ||
|
|
a043a96abb | ||
|
|
2d14e692eb | ||
|
|
b301e03f57 | ||
|
|
202b74eca8 | ||
|
|
2ff128ebf4 | ||
|
|
3bcafe77d8 | ||
|
|
748d29b5ad | ||
|
|
2fe702e8f7 | ||
|
|
2c3b9ff383 | ||
|
|
87d39ac41b | ||
|
|
1185786adb | ||
|
|
36ef188b85 | ||
|
|
f2330fd2fb | ||
|
|
bbb160a083 | ||
|
|
49164ce77f | ||
|
|
18ce40a23a | ||
|
|
aeff03bac4 | ||
|
|
a92f4ed389 | ||
|
|
452e20d90b | ||
|
|
96c3f6c041 | ||
|
|
f9ae8dfb04 | ||
|
|
8f756b6a59 | ||
|
|
bb639472b9 | ||
|
|
a7ee422cff | ||
|
|
e9285cc50c | ||
|
|
6d455feb22 | ||
|
|
85a53f96ad | ||
|
|
5054e0caf3 | ||
|
|
a03b8e13be | ||
|
|
ab0e43d75b | ||
|
|
cf392937b6 | ||
|
|
23db06892b | ||
|
|
6f40f19047 | ||
|
|
409397f181 | ||
|
|
1de2bee28f | ||
|
|
69bd12d792 | ||
|
|
fef8695c7a | ||
|
|
d3a639bb06 | ||
|
|
e7f712f78f | ||
|
|
ef95009563 | ||
|
|
5425ab7b83 | ||
|
|
c6ea18fd55 | ||
|
|
21f7a2b152 | ||
|
|
3299b654b9 | ||
|
|
d6de1df245 | ||
|
|
c6161380d3 | ||
|
|
bd4f0b44f4 | ||
|
|
93651ddbd5 | ||
|
|
ca1ac73e0e | ||
|
|
569ac03d7f | ||
|
|
4da5de094e | ||
|
|
c7e8b6819c | ||
|
|
315f0fc3f1 | ||
|
|
b9ebf6cd91 | ||
|
|
36de1af357 | ||
|
|
b654a78646 | ||
|
|
8233c250de | ||
|
|
a63e9c5aef | ||
|
|
4542c463c6 | ||
|
|
ea05eba7f5 | ||
|
|
228e74e06c | ||
|
|
f3cc52d234 | ||
|
|
da3f2ea5ce | ||
|
|
c7c332761a | ||
|
|
597cfcb4f3 | ||
|
|
cbcfecd604 | ||
|
|
2e55890069 | ||
|
|
afab2130fd | ||
|
|
50e700792b | ||
|
|
0a33f8fda0 | ||
|
|
b565bbdbab | ||
|
|
df4667849c | ||
|
|
35771eed0e | ||
|
|
54f257b909 | ||
|
|
15e75f21a7 | ||
|
|
11b3f939a4 | ||
|
|
1fa9db53bd | ||
|
|
bcb3c32d3a | ||
|
|
8ad144a415 | ||
|
|
722cc23a89 | ||
|
|
95fb085fe3 | ||
|
|
c93d7d0132 | ||
|
|
1e11f287e1 | ||
|
|
36ae237691 | ||
|
|
44e7fecbe6 | ||
|
|
03e344df86 | ||
|
|
253fc4f35a | ||
|
|
7bbfe91432 | ||
|
|
7a71c4bb65 | ||
|
|
61fb531471 | ||
|
|
a387ec0123 | ||
|
|
8e5aee2261 | ||
|
|
3c6236df50 | ||
|
|
8eb5c15376 | ||
|
|
9912a9c029 | ||
|
|
de1cbf7f2f | ||
|
|
e6b590b243 | ||
|
|
b9616fdd7f | ||
|
|
553992e1fa | ||
|
|
95a101d359 | ||
|
|
e37d33cc1c | ||
|
|
60f820e7c0 | ||
|
|
1e5308211d | ||
|
|
e6815fd6a5 | ||
|
|
003a7f6bcb | ||
|
|
67a4de4e77 | ||
|
|
87c4227e44 | ||
|
|
c3044cad28 | ||
|
|
30307f6977 | ||
|
|
0ba139c535 | ||
|
|
aeb4e0288c | ||
|
|
b808062f2e | ||
|
|
ddff846e4e | ||
|
|
53fa7a7df0 | ||
|
|
7790c95832 | ||
|
|
41ccc00c15 | ||
|
|
c0b060c1a8 | ||
|
|
635e1489b7 | ||
|
|
3ecfa81c9b | ||
|
|
a0f37ef893 | ||
|
|
c34702fc0c | ||
|
|
ae5cf32ab9 | ||
|
|
d4d795c56d | ||
|
|
f30ee2a6bc | ||
|
|
72770713b9 | ||
|
|
5dc5f0e566 | ||
|
|
67141ce7b5 | ||
|
|
dd315ebc88 | ||
|
|
266f7e878c | ||
|
|
d2b7479f6f | ||
|
|
c06b3d213e | ||
|
|
721b0de1b1 | ||
|
|
222d7a7741 | ||
|
|
15da152e21 | ||
|
|
ec495372ab | ||
|
|
78f1241f78 | ||
|
|
8d3fcb78ee | ||
|
|
2acf21413c | ||
|
|
d3a9545e95 | ||
|
|
44c606e165 | ||
|
|
462ed8353d | ||
|
|
ff55cabe6d | ||
|
|
bcf5075278 | ||
|
|
18ba5dd4ab | ||
|
|
e348fdd5e6 | ||
|
|
31b88484a6 | ||
|
|
698392735c | ||
|
|
a64056fac2 | ||
|
|
c3959700b3 | ||
|
|
576264c704 | ||
|
|
3cbbcf25c7 | ||
|
|
34a8c8ae28 | ||
|
|
9555aa0912 | ||
|
|
7d07fe5047 | ||
|
|
5aee72a86f | ||
|
|
1ddbb7bceb | ||
|
|
5ad73e97e8 | ||
|
|
7b1648f004 | ||
|
|
945d750d5a | ||
|
|
97404fa883 | ||
|
|
f8ed34f75f | ||
|
|
c7a66c0801 | ||
|
|
5a9fc48b73 | ||
|
|
49262fd40c | ||
|
|
f8c10a5504 | ||
|
|
1a430290f2 | ||
|
|
f6c304005a | ||
|
|
d65c108888 | ||
|
|
d4ec677253 | ||
|
|
667c1b6e70 | ||
|
|
99b1a685c8 | ||
|
|
52c1538f01 | ||
|
|
f1fbac9dc8 | ||
|
|
0576fce0c8 | ||
|
|
952f1aa2b8 | ||
|
|
ed46ec4433 | ||
|
|
efd8c467d0 | ||
|
|
d7cdbbb07d | ||
|
|
5f93ec3b11 | ||
|
|
e121a77c92 | ||
|
|
5c0611cb3b | ||
|
|
565d0331f1 | ||
|
|
053a67f209 | ||
|
|
22a5444773 | ||
|
|
86eed3f3ab | ||
|
|
cb19765809 | ||
|
|
62eaef77ef | ||
|
|
f9ea7a47b1 | ||
|
|
26491fbe67 | ||
|
|
b8a4d9f74f | ||
|
|
b853fc6742 | ||
|
|
05eb9d0c4a | ||
|
|
737cce3c9f | ||
|
|
5ede5942b1 | ||
|
|
86a8f691e1 | ||
|
|
f9f71f0fa8 | ||
|
|
b02cb7d552 | ||
|
|
03ca56d8fb | ||
|
|
9a21f5fb81 | ||
|
|
767afc9ce4 | ||
|
|
22382490ab | ||
|
|
cd934c08ab | ||
|
|
3c085db83e | ||
|
|
17032b875a | ||
|
|
5436955fd9 | ||
|
|
1aab4bf1b2 | ||
|
|
5c75a994da | ||
|
|
76a66a7879 | ||
|
|
5d4598f986 | ||
|
|
80ef7b7494 | ||
|
|
8deb26be27 | ||
|
|
6cb64d7025 | ||
|
|
5fa3e381c9 | ||
|
|
35dc076e79 | ||
|
|
ebc370a796 | ||
|
|
653fa4a1f5 | ||
|
|
095d82eb9b | ||
|
|
4b5e246b5b | ||
|
|
4e4c9dc726 | ||
|
|
b26d933e08 | ||
|
|
447887de03 | ||
|
|
d79e743b79 | ||
|
|
77fb4e42bd | ||
|
|
8e8d922edc | ||
|
|
fbcdf56981 | ||
|
|
724f762f57 | ||
|
|
9659998ce3 | ||
|
|
a05a12526d | ||
|
|
d0c2b8337b | ||
|
|
ff6dd1f083 | ||
|
|
8763e28c0b | ||
|
|
f277fbf24e | ||
|
|
9f3a5eb3ab | ||
|
|
4d02ae2562 | ||
|
|
99601e8e57 | ||
|
|
8c89773e0d | ||
|
|
f870a03223 | ||
|
|
646492db0c | ||
|
|
6b473288c3 | ||
|
|
e7a0a93a40 | ||
|
|
433817915c | ||
|
|
836b594262 | ||
|
|
ca7cf4de4b | ||
|
|
65aa60f844 | ||
|
|
28a78ba1fb | ||
|
|
806012cc51 | ||
|
|
cd7fab3bdc | ||
|
|
d12312bf76 | ||
|
|
febc33a094 | ||
|
|
27f0aef7c1 | ||
|
|
e2113d927d | ||
|
|
8d303248cd | ||
|
|
325f1f33f5 | ||
|
|
9e1b5eb173 | ||
|
|
c74a5e3e8e | ||
|
|
761833493a | ||
|
|
998e365a61 | ||
|
|
d244c98858 | ||
|
|
eed1e02fdc | ||
|
|
37657757ba | ||
|
|
4300c344ca | ||
|
|
649f9a72ae | ||
|
|
52807c1f79 | ||
|
|
206b3a22ad | ||
|
|
cfcd8990f6 | ||
|
|
473771bc14 | ||
|
|
794d8bdad3 | ||
|
|
b05de813e3 | ||
|
|
86fe5a7313 | ||
|
|
f77da0d5b5 | ||
|
|
9309dc5670 | ||
|
|
73be9efbfb | ||
|
|
e347bdd44b | ||
|
|
f4721d8170 | ||
|
|
69f788024c | ||
|
|
b06a4c198a | ||
|
|
e3acb360e3 | ||
|
|
7d803e661e | ||
|
|
82b3f5413c | ||
|
|
c4bb6a3970 | ||
|
|
0fb61ec9e0 | ||
|
|
138cd7cf24 | ||
|
|
3341d6ac1b | ||
|
|
149ea88752 | ||
|
|
d512a2999a | ||
|
|
e6e09dbc4c | ||
|
|
9195bcbe22 | ||
|
|
e789554997 | ||
|
|
85156cceff | ||
|
|
7900eeca4e | ||
|
|
5f2fb56755 | ||
|
|
318ad17991 | ||
|
|
3f3c3d9a14 | ||
|
|
bdc099af7f | ||
|
|
c725253d53 | ||
|
|
dd11e4514b | ||
|
|
86ace15e10 | ||
|
|
a92d5e9358 | ||
|
|
5fdc217858 | ||
|
|
ebd04eb2fc | ||
|
|
cad9cc2ab2 | ||
|
|
1c5f26af2b | ||
|
|
bf0ba2bb51 | ||
|
|
cc1b79e98c | ||
|
|
1f8539e9b3 | ||
|
|
36139f8620 | ||
|
|
e7e3d5924e | ||
|
|
58cc66ac65 | ||
|
|
26fd34b864 | ||
|
|
192874f939 | ||
|
|
18aced40f9 | ||
|
|
58df18a361 | ||
|
|
74896d4187 | ||
|
|
054a0be454 | ||
|
|
6c6454357c | ||
|
|
f4e4591180 | ||
|
|
f1fa7b1408 | ||
|
|
fbd97514df | ||
|
|
9fb37219a2 | ||
|
|
35a590c437 | ||
|
|
889537960e | ||
|
|
a2eba1e25a | ||
|
|
ba8494eb87 | ||
|
|
08db2390e5 | ||
|
|
29a95d30cc | ||
|
|
913999b8c3 | ||
|
|
98c47bbfae | ||
|
|
81070bce92 | ||
|
|
ce124478f1 | ||
|
|
fbe0e5a358 | ||
|
|
716c5731ec | ||
|
|
3fca3a1223 | ||
|
|
f890bbe616 | ||
|
|
3c8926d3b6 | ||
|
|
2ebbfef5f4 | ||
|
|
a84b03dd41 | ||
|
|
1cb5c64fc0 | ||
|
|
86741aebd4 | ||
|
|
273f2be226 | ||
|
|
7029c169cb | ||
|
|
a75eab44ba | ||
|
|
bd5c6b0645 | ||
|
|
3b41c1a5a0 | ||
|
|
d715abb8fd | ||
|
|
dace9697b5 | ||
|
|
6bdfda8169 | ||
|
|
be796ba6c7 | ||
|
|
4bcbad08ea | ||
|
|
d4ebd1ec26 | ||
|
|
2d6bc67fb5 | ||
|
|
52b06af63f | ||
|
|
7d6ce29de9 | ||
|
|
a190bae264 | ||
|
|
d1a1156d4d | ||
|
|
8fb74a1235 | ||
|
|
00fb58c133 | ||
|
|
d63157b914 | ||
|
|
59a90dd17c | ||
|
|
9b7ce542f2 | ||
|
|
9acf088718 | ||
|
|
350d38f989 | ||
|
|
c8bb53292d | ||
|
|
ddd0843d0e | ||
|
|
cf1692c96c | ||
|
|
6d1b21b167 | ||
|
|
25f64d9cbd | ||
|
|
90d2dbad99 | ||
|
|
c6637ae369 | ||
|
|
1ceb4e4682 | ||
|
|
6af9dc6934 | ||
|
|
b1abc47d74 | ||
|
|
93f91c4f0f | ||
|
|
c61b2c4095 | ||
|
|
3f4dd2bf35 | ||
|
|
99af3abadf | ||
|
|
d9de2b7dde | ||
|
|
1bbc6fb9b8 | ||
|
|
72112c3fda | ||
|
|
f6ad4d5056 | ||
|
|
fe24a1c835 | ||
|
|
b37383f75b | ||
|
|
73d1c139e7 | ||
|
|
699af05b57 | ||
|
|
f96a118ebf | ||
|
|
098ecb1cf1 | ||
|
|
667011cd46 | ||
|
|
605fb6e894 | ||
|
|
be2ec1615c | ||
|
|
7e465dd526 | ||
|
|
e1781df75b | ||
|
|
f326d5d7ce | ||
|
|
ffdb0f012e | ||
|
|
257878ddb4 | ||
|
|
ffbdd8a145 | ||
|
|
e0f374d92b | ||
|
|
8aabaea4f5 | ||
|
|
e565643a3b | ||
|
|
5bb41c4932 | ||
|
|
a45778a028 | ||
|
|
db6e451f14 | ||
|
|
5747e16f74 | ||
|
|
dd00aa1776 | ||
|
|
7317a6213c | ||
|
|
4986601e66 | ||
|
|
ecf663cb7d | ||
|
|
96c2beeef2 | ||
|
|
3e49a5fb68 | ||
|
|
8612033b17 | ||
|
|
ac6e1341c4 | ||
|
|
92fab01566 | ||
|
|
441effd499 | ||
|
|
131330034a | ||
|
|
6d888a9584 | ||
|
|
f693485ad0 | ||
|
|
a98c20d4e0 | ||
|
|
f93e1bc43b | ||
|
|
b78bcaea36 | ||
|
|
ac3a3f801d | ||
|
|
d43f647f80 | ||
|
|
128534dd66 | ||
|
|
dc23968cc2 | ||
|
|
c4b2f65031 | ||
|
|
589020f0df | ||
|
|
cfc878a650 | ||
|
|
ef9bbf344b | ||
|
|
ad9e0d5b7c | ||
|
|
4a9fb951cf | ||
|
|
8c8f8836e5 | ||
|
|
49826c241b | ||
|
|
954132b68a | ||
|
|
71b0d14b21 | ||
|
|
8163aa8496 | ||
|
|
c28509987c | ||
|
|
594137b0e3 | ||
|
|
8108f35850 | ||
|
|
0dc38beb81 | ||
|
|
b5dd19e613 | ||
|
|
0aab10f023 | ||
|
|
53744fe62c | ||
|
|
f84739cce0 | ||
|
|
408d841dfe | ||
|
|
fc3ecc2527 | ||
|
|
ebd77e121d | ||
|
|
e9220ca8e6 | ||
|
|
331e368647 | ||
|
|
03a4e24394 | ||
|
|
bc29f45224 | ||
|
|
59cd4c481d | ||
|
|
a4843338e8 | ||
|
|
17ec36e3e0 | ||
|
|
488c9c6d3f | ||
|
|
6345fd74a4 | ||
|
|
f58ca2bde3 | ||
|
|
7cd2a1483e | ||
|
|
ca4133f2c3 | ||
|
|
0cdeed5329 | ||
|
|
805b4d3158 | ||
|
|
93f7ae66c2 | ||
|
|
19dcf3c1a8 | ||
|
|
55fb426d2e | ||
|
|
6d7225f336 | ||
|
|
5b09d8d66e | ||
|
|
95dd312cb0 | ||
|
|
176b9c9dba | ||
|
|
9b9f991ec5 | ||
|
|
8379cd7b92 | ||
|
|
e456840f2c | ||
|
|
92208b309d | ||
|
|
8b1b4df6f7 | ||
|
|
89e47be331 | ||
|
|
0731b3c14d | ||
|
|
2e06b60757 | ||
|
|
97a13a769a | ||
|
|
487b522629 | ||
|
|
e2edf1318b | ||
|
|
976f186a10 | ||
|
|
7a04d353b5 | ||
|
|
c670044eab | ||
|
|
51bae98066 | ||
|
|
2ad251bd1d | ||
|
|
b8820cf4be | ||
|
|
f36f04ef0d | ||
|
|
5bac8a9382 | ||
|
|
6f4b1d8767 | ||
|
|
f4138ade17 | ||
|
|
334c9ac268 | ||
|
|
c277ec9e6d | ||
|
|
bbdc6cfe4f | ||
|
|
a85d7cbe21 | ||
|
|
aac6f2c911 | ||
|
|
ed9f2827cc | ||
|
|
1e788836a5 | ||
|
|
58137e67b2 | ||
|
|
6030cf5b1b | ||
|
|
25a6b4f71c | ||
|
|
f708e43b03 | ||
|
|
0646301e81 | ||
|
|
3412026c77 | ||
|
|
05382efdfe | ||
|
|
9909d42b67 | ||
|
|
1937a28539 | ||
|
|
3146964e1a | ||
|
|
446aa359d3 | ||
|
|
aa87a691a6 | ||
|
|
faca49d791 | ||
|
|
05fa0e76f0 | ||
|
|
ae31b783f3 | ||
|
|
0a859b5356 | ||
|
|
f04f21b352 | ||
|
|
ffab5890e4 | ||
|
|
da06959166 | ||
|
|
7797db32f6 | ||
|
|
6011f69d94 | ||
|
|
edb344b56d | ||
|
|
fd31502ca7 | ||
|
|
8da106901a | ||
|
|
cab5334de2 | ||
|
|
f335a2d6ea | ||
|
|
012de83f3c | ||
|
|
ceffa4fb73 | ||
|
|
4defdd90c3 | ||
|
|
c02a6fc523 | ||
|
|
cd1ce6164b | ||
|
|
e293123154 | ||
|
|
7576f17b20 | ||
|
|
0880fc007a | ||
|
|
b8044d0f74 | ||
|
|
84053a42f4 | ||
|
|
a1c8f06211 | ||
|
|
668a2ab2ef | ||
|
|
b592934f0a | ||
|
|
41e7f893aa | ||
|
|
4d7cd8f23b | ||
|
|
e5c7999f08 | ||
|
|
6925877bea | ||
|
|
5abadc5b38 | ||
|
|
6b7b8ea3d2 | ||
|
|
524f44dfc3 | ||
|
|
0c476d4361 | ||
|
|
8e35c7854d | ||
|
|
79fe10fe1c | ||
|
|
67c1de1eeb | ||
|
|
1569b826ad | ||
|
|
b1a68f5849 | ||
|
|
c5a9e39653 | ||
|
|
3952879feb | ||
|
|
b70331a9b7 | ||
|
|
d3dbbf1351 | ||
|
|
0f937a7e90 | ||
|
|
bcf13b4be7 | ||
|
|
388ed349e5 | ||
|
|
f29110eee7 | ||
|
|
88d639f8cb | ||
|
|
6237a97b10 | ||
|
|
d566bd431b | ||
|
|
0609f9111e | ||
|
|
31d7a2056c | ||
|
|
c7c70a8ec6 | ||
|
|
e49faab8d4 | ||
|
|
706b5b483e | ||
|
|
274321d82c | ||
|
|
2830a44495 | ||
|
|
7df7db7284 | ||
|
|
8af82e8a22 | ||
|
|
38b95cf146 | ||
|
|
0fae01c7b0 | ||
|
|
7167b04e6e | ||
|
|
e12812a4d7 | ||
|
|
00f21c37fe | ||
|
|
7eaf08631e | ||
|
|
2e8b169bfe | ||
|
|
c881b9e829 | ||
|
|
7ad5dc1fef | ||
|
|
b908018780 | ||
|
|
e840c84322 | ||
|
|
85bc8bb63c | ||
|
|
f2f74b8b89 | ||
|
|
9dfc163691 | ||
|
|
3d9f6a1299 | ||
|
|
c828775d8f | ||
|
|
7fb15156ae | ||
|
|
a47e157731 | ||
|
|
55d5ba38c6 | ||
|
|
a3fe6540b6 | ||
|
|
e699e8a4ed | ||
|
|
9389bde893 | ||
|
|
25a1ad7e98 | ||
|
|
0e0588b86f | ||
|
|
de01dd8ac8 | ||
|
|
443e1cfd11 | ||
|
|
497858f8d9 | ||
|
|
a87fe7aa3a | ||
|
|
d7a8b7374e | ||
|
|
53135e389c | ||
|
|
1816632e65 | ||
|
|
7564ff78d2 | ||
|
|
50948285c1 | ||
|
|
5a5a86a16b | ||
|
|
8c1cad3a67 | ||
|
|
d8296b1fda | ||
|
|
bd9db4e08c | ||
|
|
79031f1905 | ||
|
|
b6e0bb91e8 | ||
|
|
e5079eb28e | ||
|
|
3c22283b6b | ||
|
|
183e810422 | ||
|
|
7cfafa1d4b | ||
|
|
034245938c | ||
|
|
a5bde4c061 | ||
|
|
e09ef803d6 | ||
|
|
886a9acbcf | ||
|
|
1b84759d02 | ||
|
|
f33430deb4 | ||
|
|
f9e0f46f47 | ||
|
|
4b1d137342 | ||
|
|
66c456ab59 | ||
|
|
ce8af835b2 | ||
|
|
89ef743876 | ||
|
|
4026e64c32 | ||
|
|
a767bcc509 | ||
|
|
cb90787ac5 | ||
|
|
a2cc9fc69b | ||
|
|
5f1053ef43 | ||
|
|
ff5d32aa53 | ||
|
|
ad2846b830 | ||
|
|
52d5a4321c | ||
|
|
fc1b1b129c | ||
|
|
9dcd2990a7 | ||
|
|
bd0fc67f13 | ||
|
|
e8e8e2bc2a | ||
|
|
829419cef9 | ||
|
|
77e88f98cd | ||
|
|
192f01c65f | ||
|
|
d6d4de0907 | ||
|
|
3779757cd3 | ||
|
|
3b3a6b4725 | ||
|
|
a0a85db5f5 | ||
|
|
7f844e0e0f | ||
|
|
d70e7d6534 | ||
|
|
4eda7b124d | ||
|
|
f6fede26b7 | ||
|
|
6aa4f8b63e | ||
|
|
944329fff4 | ||
|
|
0f1bec184d | ||
|
|
183834a82c | ||
|
|
714c7738cd | ||
|
|
25346eb694 | ||
|
|
b3f2e1957b | ||
|
|
5703a780af | ||
|
|
b06209230c | ||
|
|
68fbe1dd83 | ||
|
|
9e9577b3f2 | ||
|
|
2bde704d1a | ||
|
|
190f021ba8 | ||
|
|
cd913c60be | ||
|
|
2837c83dc9 | ||
|
|
3375c87e55 | ||
|
|
5a1e5d04d0 | ||
|
|
174fa30ade | ||
|
|
9b112e2a70 | ||
|
|
76dbdaadf2 | ||
|
|
285e4ac4f3 | ||
|
|
304a655804 | ||
|
|
efe62a875c | ||
|
|
ee02d14cd6 | ||
|
|
a8f9246123 | ||
|
|
336f22c097 | ||
|
|
b9f2be9200 | ||
|
|
12f8c24846 | ||
|
|
0e57dc044e | ||
|
|
ce9bbd66ba | ||
|
|
1468e5aff2 | ||
|
|
6f28a59a27 | ||
|
|
37101f5e0f | ||
|
|
82903b0bc6 | ||
|
|
e7e7605d22 | ||
|
|
bd45800cd5 | ||
|
|
36834f34cd | ||
|
|
2ab0921a80 | ||
|
|
2803aed082 | ||
|
|
122b579024 | ||
|
|
da2c883622 | ||
|
|
e3f5a5a347 | ||
|
|
80d4c75b89 | ||
|
|
7a214c1fab | ||
|
|
d79c4f7e28 | ||
|
|
9695a404f2 | ||
|
|
5d7d1a180a | ||
|
|
1d5cf825b4 | ||
|
|
668e739263 | ||
|
|
29d92facf6 | ||
|
|
c93bd21056 | ||
|
|
e2f24fb9fd | ||
|
|
526e1b6970 | ||
|
|
d80b192e89 | ||
|
|
cfcedfe42d | ||
|
|
43175ff671 | ||
|
|
84bd87231d | ||
|
|
d00f8b7898 | ||
|
|
a5eb720a9f | ||
|
|
b5c5c046d6 | ||
|
|
ef47084025 | ||
|
|
0694880e5b | ||
|
|
ecedb5fc5e | ||
|
|
cc9520b3dc | ||
|
|
29ab5643dc | ||
|
|
31c8a6ee77 | ||
|
|
53a064274f | ||
|
|
afa697bd74 | ||
|
|
4db067f8dc | ||
|
|
6f13d341c6 | ||
|
|
6103fc1430 | ||
|
|
47605ef8c4 | ||
|
|
623351e791 | ||
|
|
daf465c038 | ||
|
|
fb271d25d2 | ||
|
|
e767502c6a | ||
|
|
25039926a6 | ||
|
|
1b4e4d7f83 | ||
|
|
e7b555de8d | ||
|
|
3f63fd91ec | ||
|
|
7d4af9aedd | ||
|
|
0af23ceb2b | ||
|
|
bd21db34b2 | ||
|
|
8886dba9d1 | ||
|
|
bbdcabe250 | ||
|
|
a47b17e4e0 | ||
|
|
0f24828900 | ||
|
|
c166bf306f | ||
|
|
2a04297e64 | ||
|
|
a3774cae8a | ||
|
|
da9e87a711 | ||
|
|
34a35b9591 | ||
|
|
1bc92b46fd | ||
|
|
023d772d90 | ||
|
|
20bd6add52 | ||
|
|
236affbff2 | ||
|
|
985090a453 | ||
|
|
850d102ea5 | ||
|
|
223b99aad5 | ||
|
|
def8b9b639 | ||
|
|
7fe45180db | ||
|
|
0cd2e72dc1 | ||
|
|
4ff53bc9c7 | ||
|
|
0aa10dcb43 | ||
|
|
906b3df54b | ||
|
|
39197864a1 | ||
|
|
bb305bd109 | ||
|
|
e5ab487e3c | ||
|
|
6b07039281 | ||
|
|
09d222c38d | ||
|
|
ced490fc6e | ||
|
|
05b6d92042 | ||
|
|
d85744af43 | ||
|
|
5af12cf722 | ||
|
|
a3c9a39304 | ||
|
|
830d836fb1 | ||
|
|
5e0fe45c25 | ||
|
|
dac9e60690 | ||
|
|
92780d3f88 | ||
|
|
138b3390c5 | ||
|
|
60c561792c | ||
|
|
f48f07a418 | ||
|
|
b88913ca27 | ||
|
|
4e8bb8a082 | ||
|
|
c2ae806661 | ||
|
|
2f6a7ec1ae | ||
|
|
7a92f14df6 | ||
|
|
02cc012db5 | ||
|
|
4ed30165d8 | ||
|
|
719a2313be | ||
|
|
315b1ec4ae | ||
|
|
079acc88a7 | ||
|
|
903307b191 | ||
|
|
516e1131a7 | ||
|
|
a516ca527d | ||
|
|
ab4fa65d0d | ||
|
|
409a75936a | ||
|
|
b1662f643a | ||
|
|
8f58a27418 | ||
|
|
e5d377be8d | ||
|
|
0f6adbfd25 | ||
|
|
688b86ba24 | ||
|
|
4cf553509e | ||
|
|
ef3c64d006 | ||
|
|
56ec6b8b66 | ||
|
|
fbbfa3bab3 | ||
|
|
5fdf844c0a | ||
|
|
76d90ba1ca | ||
|
|
3eab76508e | ||
|
|
c37e7ced7d | ||
|
|
9e2decf7df | ||
|
|
8805bf97d3 | ||
|
|
3915ea30f2 | ||
|
|
9181ecabf8 | ||
|
|
37cb1521a1 | ||
|
|
af5ddf0eb6 | ||
|
|
2e2740d20b | ||
|
|
65ce617a8d | ||
|
|
aa3e5d9832 | ||
|
|
b813889b62 | ||
|
|
fe3bb073f9 | ||
|
|
e8c3b6418c | ||
|
|
f22b03cd7e | ||
|
|
bb72e51d6a | ||
|
|
fd89e9f144 | ||
|
|
8a17f7f8c5 | ||
|
|
7d9970590a | ||
|
|
b1c4c9ae2f | ||
|
|
c122f727d1 | ||
|
|
fa3cdccb18 | ||
|
|
438c0634af | ||
|
|
94aa1c0d5d | ||
|
|
2d5d2509fb | ||
|
|
68c1423cf3 | ||
|
|
1f0931f6d1 | ||
|
|
47d0a913e0 | ||
|
|
bc89933ad6 | ||
|
|
b56ad1d633 | ||
|
|
5e65f632a3 | ||
|
|
31ef58d98e | ||
|
|
569f6c0213 | ||
|
|
7bba3dfe8a | ||
|
|
ed5a540439 | ||
|
|
5cd5ede2f5 | ||
|
|
dc6fc5a1f5 | ||
|
|
5c722289b6 | ||
|
|
f4f1d20c82 | ||
|
|
4207ec8b3b | ||
|
|
6aa6883af4 | ||
|
|
22f36bea53 | ||
|
|
37d8e97a9d | ||
|
|
e4a9243517 | ||
|
|
e83fc30b67 | ||
|
|
85e86626ff | ||
|
|
30f0c6f5db | ||
|
|
6048d26493 | ||
|
|
8fc6dad7ff | ||
|
|
adb468bade | ||
|
|
e1c0ad9189 | ||
|
|
2822cc671a | ||
|
|
e390c17f99 | ||
|
|
f75e399139 | ||
|
|
9d7a4e5917 | ||
|
|
fbe93aa25e | ||
|
|
07318a4987 | ||
|
|
15636a2f14 | ||
|
|
b8a7d96e98 | ||
|
|
2151f23f46 | ||
|
|
234dce0e7f | ||
|
|
e0312feddb | ||
|
|
a34f1eb6f9 | ||
|
|
8580f9f622 | ||
|
|
999b10d2d4 | ||
|
|
43cd3491c9 | ||
|
|
9240757145 | ||
|
|
914a4810a9 | ||
|
|
48ed77c9cc | ||
|
|
a61663d63b | ||
|
|
b5c02eb3d8 | ||
|
|
28bf5eacb9 | ||
|
|
8d4b04742c | ||
|
|
a09d5747e1 | ||
|
|
f70bec1cf8 | ||
|
|
4cc82c7d66 | ||
|
|
0e966ba0d6 | ||
|
|
6abf54e150 | ||
|
|
9c2a5ac60e | ||
|
|
fb52ad1d26 | ||
|
|
c46fe1fa4f | ||
|
|
dfe11ebb47 | ||
|
|
0960a602f4 | ||
|
|
15202df249 | ||
|
|
5fef371bad | ||
|
|
be95e8e14b | ||
|
|
3ea47a6cf3 | ||
|
|
1a685b7e1c | ||
|
|
cad2ff8de5 | ||
|
|
17b7419786 | ||
|
|
69a9b17587 | ||
|
|
b873befcd8 | ||
|
|
10b3296085 | ||
|
|
b282c41954 | ||
|
|
928b7f6efc | ||
|
|
e8f76a93a1 | ||
|
|
91fe5d7fa8 | ||
|
|
91c2390897 | ||
|
|
52bcb74b67 | ||
|
|
ea6dd7344d | ||
|
|
e422e12f17 | ||
|
|
16d7351cbc | ||
|
|
71f83bd02b | ||
|
|
4b0faf47b4 | ||
|
|
a56249f631 | ||
|
|
bde6b9141f | ||
|
|
06587938fb | ||
|
|
8480fb3c6f | ||
|
|
00a6f825b0 | ||
|
|
78b272c092 | ||
|
|
538b0fc180 | ||
|
|
853a944cd0 | ||
|
|
1917e7f532 | ||
|
|
84569bc94f | ||
|
|
35f0fdcd36 | ||
|
|
479f7bfdc4 | ||
|
|
75e0cc387e | ||
|
|
d5d07b44ef | ||
|
|
f9ac9f052e | ||
|
|
8b098ae53c | ||
|
|
14bc7c01ea | ||
|
|
71c437767f | ||
|
|
e3fe456cf9 | ||
|
|
41ce4c9e07 | ||
|
|
2c35c09742 | ||
|
|
78362aff04 | ||
|
|
7cf389deab | ||
|
|
356e7b6954 | ||
|
|
a2d26ab56f | ||
|
|
779106e49c | ||
|
|
63ef26e9ee | ||
|
|
68a95f5c94 | ||
|
|
8b1f8cb20e | ||
|
|
0dea1a84d6 | ||
|
|
af18afd279 | ||
|
|
94e55817d2 | ||
|
|
d21a0a9b64 | ||
|
|
32adbe72b6 | ||
|
|
170d44b75d | ||
|
|
e27594efc1 | ||
|
|
56625cda88 | ||
|
|
5304897608 | ||
|
|
976cf648f7 | ||
|
|
6d7fd7a722 | ||
|
|
0c5d3749f1 | ||
|
|
3b2eb13199 | ||
|
|
e1aed77c72 | ||
|
|
76d87acd59 | ||
|
|
24a6994471 | ||
|
|
ecf7f8257f | ||
|
|
551cb70a1b | ||
|
|
85a742351c | ||
|
|
6932df2ce8 | ||
|
|
35aaccdbc1 | ||
|
|
09f1411389 | ||
|
|
35ed582ebf | ||
|
|
ad8d75222a | ||
|
|
368f71443b | ||
|
|
dbd394cb4a | ||
|
|
88c345aca8 | ||
|
|
2e44cb9387 | ||
|
|
c8fa2a1f42 | ||
|
|
0f32537b93 | ||
|
|
c1a8efaf09 | ||
|
|
a89abd5eac | ||
|
|
04cd469e4a | ||
|
|
31dc34a909 | ||
|
|
a03cbdba2e | ||
|
|
b8de3dfb35 | ||
|
|
a8efd39877 | ||
|
|
c9e7d09e0a | ||
|
|
646cb24b71 | ||
|
|
8baade44fd | ||
|
|
2db5607060 | ||
|
|
0aa8d7f7c9 | ||
|
|
59e3a1f046 | ||
|
|
e5a5cb8779 | ||
|
|
c9be3c2dc6 | ||
|
|
8ea7ae7086 | ||
|
|
67ab814756 | ||
|
|
67039c590d | ||
|
|
29003010a3 | ||
|
|
7481f7eb9e | ||
|
|
bfebd2e3ff | ||
|
|
054706c115 | ||
|
|
df64e63bbd | ||
|
|
3b0cf1a2ea | ||
|
|
12c49601c3 | ||
|
|
36e78b3bd3 | ||
|
|
82802eb460 | ||
|
|
68d680bafd | ||
|
|
b79c8faba4 | ||
|
|
019afc0f80 | ||
|
|
0e43df1a47 | ||
|
|
2afa1cc04d | ||
|
|
91006fdee1 | ||
|
|
59230175df | ||
|
|
98fccdef20 | ||
|
|
49fbe54bc4 | ||
|
|
d7dd068478 | ||
|
|
1d87c94ca3 | ||
|
|
c433d95441 | ||
|
|
30acf8b5d1 | ||
|
|
3d95fd17e3 | ||
|
|
504a248ba1 | ||
|
|
295f1576e1 | ||
|
|
e36118f4f0 | ||
|
|
49b8292f51 | ||
|
|
ea05f7f647 | ||
|
|
e2c732c906 | ||
|
|
a5fee4b8cc | ||
|
|
1254494dd8 | ||
|
|
64b9d85a76 | ||
|
|
ec8de8a1f9 | ||
|
|
c366277e64 | ||
|
|
31befbfad3 | ||
|
|
dd8b4fa06e | ||
|
|
343bb81729 | ||
|
|
7946eb51e0 | ||
|
|
367059b93d | ||
|
|
454c3140ad | ||
|
|
b0a9704c3d | ||
|
|
bab289ca78 | ||
|
|
81020a3748 | ||
|
|
ab2e360266 | ||
|
|
500165ffb3 | ||
|
|
69d72ca243 | ||
|
|
2b12fb6daa | ||
|
|
7f42ed38fd | ||
|
|
b763700bc8 | ||
|
|
764f5414ff | ||
|
|
1e37c32fb6 | ||
|
|
ee5e2798ba | ||
|
|
eeb4baf17f | ||
|
|
17a023989b | ||
|
|
ad910e3ce0 | ||
|
|
f5c71b8715 | ||
|
|
7c9bec2633 | ||
|
|
c17aa3e020 | ||
|
|
2980c7f5e5 | ||
|
|
9685b3b4ca | ||
|
|
8b8956f7ed | ||
|
|
1754c8f8e5 | ||
|
|
2770a95a5f | ||
|
|
f012157cf9 | ||
|
|
3e0611757b | ||
|
|
802e7b2192 | ||
|
|
a2ffd9e955 | ||
|
|
0505eb80c9 | ||
|
|
ae6f824fcf | ||
|
|
e0e285b841 | ||
|
|
2a05eb8fd3 | ||
|
|
651e5adbda | ||
|
|
2558760224 | ||
|
|
0e6c74e93d | ||
|
|
b21b7294c6 | ||
|
|
131609cf29 | ||
|
|
92cc8a5512 | ||
|
|
7c03514a28 | ||
|
|
5f62667aba | ||
|
|
c6810a102b | ||
|
|
9677b9bfaf | ||
|
|
6fe128ac6f | ||
|
|
33103306a6 | ||
|
|
851679e63a | ||
|
|
280f6cb4e9 | ||
|
|
cf5bdf5e9f | ||
|
|
661a487610 |
@@ -1,4 +1,4 @@
|
||||
[codespell]
|
||||
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb,components/wpa_supplicant/*,components/esp_wifi/*,*.pem,components/newlib/COPYING.*,docs/sphinx-known-warnings.txt
|
||||
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,registr,oen,parms
|
||||
write-changes = true
|
||||
|
||||
165
.flake8
Normal file
165
.flake8
Normal file
@@ -0,0 +1,165 @@
|
||||
[flake8]
|
||||
|
||||
select =
|
||||
# Full lists are given in order to suppress all errors from other plugins
|
||||
# Full list of pyflakes error codes:
|
||||
F401, # module imported but unused
|
||||
F402, # import module from line N shadowed by loop variable
|
||||
F403, # 'from module import *' used; unable to detect undefined names
|
||||
F404, # future import(s) name after other statements
|
||||
F405, # name may be undefined, or defined from star imports: module
|
||||
F406, # 'from module import *' only allowed at module level
|
||||
F407, # an undefined __future__ feature name was imported
|
||||
F601, # dictionary key name repeated with different values
|
||||
F602, # dictionary key variable name repeated with different values
|
||||
F621, # too many expressions in an assignment with star-unpacking
|
||||
F622, # two or more starred expressions in an assignment (a, *b, *c = d)
|
||||
F631, # assertion test is a tuple, which are always True
|
||||
F701, # a break statement outside of a while or for loop
|
||||
F702, # a continue statement outside of a while or for loop
|
||||
F703, # a continue statement in a finally block in a loop
|
||||
F704, # a yield or yield from statement outside of a function
|
||||
F705, # a return statement with arguments inside a generator
|
||||
F706, # a return statement outside of a function/method
|
||||
F707, # an except: block as not the last exception handler
|
||||
F721, F722, # doctest syntax error syntax error in forward type annotation
|
||||
F811, # redefinition of unused name from line N
|
||||
F812, # list comprehension redefines name from line N
|
||||
F821, # undefined name name
|
||||
F822, # undefined name name in __all__
|
||||
F823, # local variable name referenced before assignment
|
||||
F831, # duplicate argument name in function definition
|
||||
F841, # local variable name is assigned to but never used
|
||||
F901, # raise NotImplemented should be raise NotImplementedError
|
||||
|
||||
# Full list of pycodestyle violations:
|
||||
E101, # indentation contains mixed spaces and tabs
|
||||
E111, # indentation is not a multiple of four
|
||||
E112, # expected an indented block
|
||||
E113, # unexpected indentation
|
||||
E114, # indentation is not a multiple of four (comment)
|
||||
E115, # expected an indented block (comment)
|
||||
E116, # unexpected indentation (comment)
|
||||
E121, # continuation line under-indented for hanging indent
|
||||
E122, # continuation line missing indentation or outdented
|
||||
E123, # closing bracket does not match indentation of opening bracket's line
|
||||
E124, # closing bracket does not match visual indentation
|
||||
E125, # continuation line with same indent as next logical line
|
||||
E126, # continuation line over-indented for hanging indent
|
||||
E127, # continuation line over-indented for visual indent
|
||||
E128, # continuation line under-indented for visual indent
|
||||
E129, # visually indented line with same indent as next logical line
|
||||
E131, # continuation line unaligned for hanging indent
|
||||
E133, # closing bracket is missing indentation
|
||||
E201, # whitespace after '('
|
||||
E202, # whitespace before ')'
|
||||
E203, # whitespace before ':'
|
||||
E211, # whitespace before '('
|
||||
E221, # multiple spaces before operator
|
||||
E222, # multiple spaces after operator
|
||||
E223, # tab before operator
|
||||
E224, # tab after operator
|
||||
E225, # missing whitespace around operator
|
||||
E226, # missing whitespace around arithmetic operator
|
||||
E227, # missing whitespace around bitwise or shift operator
|
||||
E228, # missing whitespace around modulo operator
|
||||
E231, # missing whitespace after ',', ';', or ':'
|
||||
E241, # multiple spaces after ','
|
||||
E242, # tab after ','
|
||||
E251, # unexpected spaces around keyword / parameter equals
|
||||
E261, # at least two spaces before inline comment
|
||||
E262, # inline comment should start with '# '
|
||||
E265, # block comment should start with '# '
|
||||
E266, # too many leading '#' for block comment
|
||||
E271, # multiple spaces after keyword
|
||||
E272, # multiple spaces before keyword
|
||||
E273, # tab after keyword
|
||||
E274, # tab before keyword
|
||||
E275, # missing whitespace after keyword
|
||||
E301, # expected 1 blank line, found 0
|
||||
E302, # expected 2 blank lines, found 0
|
||||
E303, # too many blank lines
|
||||
E304, # blank lines found after function decorator
|
||||
E305, # expected 2 blank lines after end of function or class
|
||||
E306, # expected 1 blank line before a nested definition
|
||||
E401, # multiple imports on one line
|
||||
E402, # module level import not at top of file
|
||||
E501, # line too long (82 > 79 characters)
|
||||
E502, # the backslash is redundant between brackets
|
||||
E701, # multiple statements on one line (colon)
|
||||
E702, # multiple statements on one line (semicolon)
|
||||
E703, # statement ends with a semicolon
|
||||
E704, # multiple statements on one line (def)
|
||||
E711, # comparison to None should be 'if cond is None:'
|
||||
E712, # comparison to True should be 'if cond is True:' or 'if cond:'
|
||||
E713, # test for membership should be 'not in'
|
||||
E714, # test for object identity should be 'is not'
|
||||
E721, # do not compare types, use 'isinstance()'
|
||||
E722, # do not use bare except, specify exception instead
|
||||
E731, # do not assign a lambda expression, use a def
|
||||
E741, # do not use variables named 'l', 'O', or 'I'
|
||||
E742, # do not define classes named 'l', 'O', or 'I'
|
||||
E743, # do not define functions named 'l', 'O', or 'I'
|
||||
E901, # SyntaxError or IndentationError
|
||||
E902, # IOError
|
||||
W191, # indentation contains tabs
|
||||
W291, # trailing whitespace
|
||||
W292, # no newline at end of file
|
||||
W293, # blank line contains whitespace
|
||||
W391, # blank line at end of file
|
||||
W503, # line break before binary operator
|
||||
W504, # line break after binary operator
|
||||
W505, # doc line too long (82 > 79 characters)
|
||||
W601, # .has_key() is deprecated, use 'in'
|
||||
W602, # deprecated form of raising exception
|
||||
W603, # '<>' is deprecated, use '!='
|
||||
W604, # backticks are deprecated, use 'repr()'
|
||||
W605, # invalid escape sequence 'x'
|
||||
W606, # 'async' and 'await' are reserved keywords starting with Python 3.7
|
||||
|
||||
# Full list of flake8 violations
|
||||
E999, # failed to compile a file into an Abstract Syntax Tree for the plugins that require it
|
||||
|
||||
# Full list of mccabe violations
|
||||
C901 # complexity value provided by the user
|
||||
|
||||
ignore =
|
||||
E221, # multiple spaces before operator
|
||||
E231, # missing whitespace after ',', ';', or ':'
|
||||
E241, # multiple spaces after ','
|
||||
W503, # line break before binary operator
|
||||
W504 # line break after binary operator
|
||||
|
||||
max-line-length = 160
|
||||
|
||||
show_source = True
|
||||
|
||||
statistics = True
|
||||
|
||||
exclude =
|
||||
.git,
|
||||
__pycache__,
|
||||
# submodules
|
||||
components/bootloader/subproject/components/micro-ecc/micro-ecc,
|
||||
components/bt/host/nimble/nimble,
|
||||
components/cmock/CMock,
|
||||
components/json/cJSON,
|
||||
components/mbedtls/mbedtls,
|
||||
components/openthread/openthread,
|
||||
components/unity/unity,
|
||||
components/spiffs/spiffs,
|
||||
# autogenerated scripts
|
||||
components/protocomm/python/constants_pb2.py,
|
||||
components/protocomm/python/sec0_pb2.py,
|
||||
components/protocomm/python/sec1_pb2.py,
|
||||
components/protocomm/python/sec2_pb2.py,
|
||||
components/protocomm/python/session_pb2.py,
|
||||
components/wifi_provisioning/python/wifi_ctrl_pb2.py,
|
||||
components/wifi_provisioning/python/wifi_scan_pb2.py,
|
||||
components/wifi_provisioning/python/wifi_config_pb2.py,
|
||||
components/wifi_provisioning/python/wifi_constants_pb2.py,
|
||||
components/esp_local_ctrl/python/esp_local_ctrl_pb2.py,
|
||||
|
||||
per-file-ignores =
|
||||
# Sphinx conf.py files use star imports to setup config variables
|
||||
docs/conf_common.py: F405
|
||||
20
.github/ISSUE_TEMPLATE/01_build_install_bug.yml
vendored
20
.github/ISSUE_TEMPLATE/01_build_install_bug.yml
vendored
@@ -95,26 +95,6 @@ body:
|
||||
render: plain
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: diag
|
||||
attributes:
|
||||
label: Diagnostic report archive.
|
||||
description: |
|
||||
Diagnostic report for ESP-IDF created using [idf.py diag](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-diag.html) or [esp-idf-diag](https://github.com/espressif/esp-idf-diag). The `idf.py diag` command is available beginning with ESP-IDF version 5.5. For older versions, you may want to consider using the `esp-idf-diag` command.
|
||||
|
||||
In your project directory, execute the following command:
|
||||
|
||||
Using `idf.py diag`
|
||||
1. idf.py diag
|
||||
|
||||
Using `esp-idf-diag`
|
||||
1. pip install esp-idf-diag
|
||||
2. esp-idf-diag create
|
||||
|
||||
Once the report is generated, the tool will guide you with the next steps.
|
||||
placeholder: Please attach the diagnostic report zip file here.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: more-info
|
||||
attributes:
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/02_runtime_bug.yml
vendored
20
.github/ISSUE_TEMPLATE/02_runtime_bug.yml
vendored
@@ -123,26 +123,6 @@ body:
|
||||
render: plain
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: diag
|
||||
attributes:
|
||||
label: Diagnostic report archive.
|
||||
description: |
|
||||
Diagnostic report for ESP-IDF created using [idf.py diag](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-diag.html) or [esp-idf-diag](https://github.com/espressif/esp-idf-diag). The `idf.py diag` command is available beginning with ESP-IDF version 5.5. For older versions, you may want to consider using the `esp-idf-diag` command.
|
||||
|
||||
In your project directory, execute the following command:
|
||||
|
||||
Using `idf.py diag`
|
||||
1. idf.py diag
|
||||
|
||||
Using `esp-idf-diag`
|
||||
1. pip install esp-idf-diag
|
||||
2. esp-idf-diag create
|
||||
|
||||
Once the report is generated, the tool will guide you with the next steps.
|
||||
placeholder: Please attach the diagnostic report zip file here.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: more-info
|
||||
attributes:
|
||||
|
||||
9
.github/workflows/release_zips.yml
vendored
9
.github/workflows/release_zips.yml
vendored
@@ -11,8 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Create a recursive clone source zip
|
||||
uses: espressif/release-zips-action@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
release_project_name: ESP-IDF
|
||||
git_extra_args: --shallow-since="1 year ago"
|
||||
uses: espressif/github-actions/release_zips@master
|
||||
env:
|
||||
RELEASE_PROJECT_NAME: ESP-IDF
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
1
.github/workflows/vulnerability_scan.yml
vendored
1
.github/workflows/vulnerability_scan.yml
vendored
@@ -27,7 +27,6 @@ jobs:
|
||||
|
||||
- name: Vulnerability scan
|
||||
env:
|
||||
SBOM_CHECK_LOCAL_DB: ${{ vars.SBOM_CHECK_LOCAL_DB }}
|
||||
SBOM_MATTERMOST_WEBHOOK: ${{ secrets.SBOM_MATTERMOST_WEBHOOK }}
|
||||
NVDAPIKEY: ${{ secrets.NVDAPIKEY }}
|
||||
uses: espressif/esp-idf-sbom-action@master
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -37,7 +37,6 @@ components/**/build/
|
||||
components/**/build_*_*/
|
||||
components/**/sdkconfig
|
||||
components/**/sdkconfig.old
|
||||
components/**/test_apps/wifi_nvs_config/nvs_data_suffix.csv
|
||||
|
||||
# Example project files
|
||||
examples/**/build/
|
||||
|
||||
@@ -2,253 +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
|
||||
/ROADMAP*.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
|
||||
/ruff.toml @esp-idf-codeowners/tools
|
||||
/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
|
||||
/components/esp_psram/system_layer/ @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_security/ @esp-idf-codeowners/security
|
||||
/components/esp_system/ @esp-idf-codeowners/system
|
||||
/components/esp_tee/ @esp-idf-codeowners/security
|
||||
/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/peripherals @esp-idf-codeowners/system
|
||||
/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/peripherals @esp-idf-codeowners/system
|
||||
/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/docs_not_updated/ @esp-idf-codeowners/all-maintainers
|
||||
/docs/**/api-guides/tools/ @esp-idf-codeowners/tools
|
||||
/docs/en/api-guides/core_dump.rst @esp-idf-codeowners/debugging
|
||||
/docs/**/api-guides/wifi* @esp-idf-codeowners/wifi
|
||||
/docs/**/api-guides/esp-wifi-mesh.rst @esp-idf-codeowners/wifi
|
||||
/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/lowpower/ @esp-idf-codeowners/power-management @esp-idf-codeowners/system
|
||||
/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/bt/ @esp-idf-codeowners/bluetooth
|
||||
/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
|
||||
|
||||
@@ -145,11 +145,11 @@ check if there's a suitable `.if-<if-anchor-you-need>` anchor
|
||||
1. if there is, create a rule following [`rules` Template Naming Rules](#rules-template-naming-rules).For detail information, please refer to [GitLab Documentation `rules-if`](https://docs.gitlab.com/ee/ci/yaml/README.html#rulesif). Here's an example.
|
||||
|
||||
```yaml
|
||||
.rules:patterns:clang_tidy:
|
||||
.rules:patterns:python-files:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-c-files
|
||||
changes: *patterns-python-files
|
||||
```
|
||||
|
||||
2. if there isn't
|
||||
|
||||
@@ -231,18 +231,13 @@ pytest_build_system_macos:
|
||||
- .after_script:build:macos:upload-failed-job-logs:ccache-show-stats
|
||||
- .rules:build:macos
|
||||
tags:
|
||||
- macos
|
||||
- macos_shell
|
||||
parallel: 3
|
||||
variables:
|
||||
PYENV_VERSION: "3.9"
|
||||
PYENV_VERSION: "3.8"
|
||||
# CCACHE_DIR: "/cache/idf_ccache". On macOS, you cannot write to this folder due to insufficient permissions.
|
||||
CCACHE_DIR: "" # ccache will use "$HOME/Library/Caches/ccache".
|
||||
CCACHE_MAXSIZE: "5G" # To preserve the limited Macbook storage. CCACHE automatically prunes old caches to fit the set limit.
|
||||
# Workaround for a bug in Parallels executor where CI_PROJECT_DIR is not an absolute path,
|
||||
# but a relative path to the build directory (builds/espressif/esp-idf instead of ~/builds/espressif/esp-idf.
|
||||
# GitLab sets the project dir to this template `<builds_dir>/<namespace>/<project_name>`
|
||||
IDF_PATH: "/Users/espressif/builds/espressif/esp-idf"
|
||||
|
||||
build_docker:
|
||||
extends:
|
||||
- .before_script:minimal
|
||||
|
||||
@@ -40,7 +40,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: v6.0-dev
|
||||
LATEST_GIT_TAG: v5.4.1
|
||||
|
||||
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
|
||||
# by default we will fetch all submodules
|
||||
@@ -55,9 +55,9 @@ variables:
|
||||
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
|
||||
|
||||
# Docker images
|
||||
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v6.0:1"
|
||||
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v6.0:1-1"
|
||||
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v6.0:1"
|
||||
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:2"
|
||||
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:5"
|
||||
PRE_COMMIT_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-pre-commit:1"
|
||||
|
||||
@@ -70,7 +70,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.v6.0.txt"
|
||||
CI_PYTHON_CONSTRAINT_FILE: "espidf.constraints.v5.4.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.
|
||||
@@ -88,7 +88,7 @@ variables:
|
||||
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.4.txt"
|
||||
|
||||
IDF_CI_BUILD: 1
|
||||
|
||||
@@ -140,13 +140,6 @@ variables:
|
||||
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
|
||||
export IDF_MIRROR_PREFIX_MAP=
|
||||
fi
|
||||
# Optimize pip install
|
||||
if echo "${CI_RUNNER_TAGS}" | grep "shiny"; then
|
||||
export PIP_INDEX_URL="${PIP_INDEX_URL_SHINY}"
|
||||
fi
|
||||
if [[ "$(uname -m)" == "x86_64" ]] || [[ "$(uname -m)" == "aarch64" ]]; then
|
||||
export IDF_PIP_WHEELS_URL=""
|
||||
fi
|
||||
|
||||
if [[ "${CI_JOB_STAGE}" != "target_test" ]]; then
|
||||
section_start "running_install_sh" "Running install.sh"
|
||||
@@ -198,21 +191,13 @@ variables:
|
||||
fi
|
||||
|
||||
# Custom OpenOCD
|
||||
if [[ "$CI_JOB_STAGE" == "target_test" ]]; then
|
||||
machine="$(uname -m)"
|
||||
if [[ "$machine" == "armv7l" ]] ; then
|
||||
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARMHF"
|
||||
elif [[ "$machine" == "aarch64" ]] ; then
|
||||
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARM64"
|
||||
fi
|
||||
if [[ ! -z "$OOCD_DISTRO_URL" ]]; then
|
||||
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
|
||||
wget $OOCD_DISTRO_URL
|
||||
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
|
||||
tar -x -f $ARCH_NAME
|
||||
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
|
||||
export PATH=$PWD/openocd-esp32/bin:$PATH
|
||||
fi
|
||||
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
|
||||
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
|
||||
wget $OOCD_DISTRO_URL
|
||||
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
|
||||
tar -x -f $ARCH_NAME
|
||||
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
|
||||
export PATH=$PWD/openocd-esp32/bin:$PATH
|
||||
fi
|
||||
|
||||
if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then
|
||||
@@ -243,6 +228,8 @@ variables:
|
||||
# Ensure pyenv and PYENV_VERSION installed
|
||||
- eval "$(pyenv init -)"
|
||||
- *common-before_scripts
|
||||
# On macOS, these tools need to be installed
|
||||
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
|
||||
# remove idf-env.json, since it may contains enabled "features"
|
||||
- rm -f $IDF_TOOLS_PATH/idf-env.json
|
||||
# This adds tools (compilers) and the version-specific Python environment to PATH
|
||||
@@ -332,32 +319,26 @@ variables:
|
||||
- *git_init
|
||||
- *git_fetch_from_mirror_url_if_exists
|
||||
- |
|
||||
# Store the diff output in a temporary file
|
||||
TEMP_FILE=$(mktemp)
|
||||
# merged results pipelines, by default
|
||||
if [[ -n $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ]]; then
|
||||
git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git fetch origin $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA > "$TEMP_FILE"
|
||||
GIT_DIFF_OUTPUT=$(cat "$TEMP_FILE")
|
||||
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA)
|
||||
git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
# merge request pipelines, when the mr got conflicts
|
||||
elif [[ -n $CI_MERGE_REQUEST_DIFF_BASE_SHA ]]; then
|
||||
git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_COMMIT_SHA > "$TEMP_FILE"
|
||||
GIT_DIFF_OUTPUT=$(cat "$TEMP_FILE")
|
||||
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_COMMIT_SHA)
|
||||
# other pipelines, like the protected branches pipelines
|
||||
elif [[ "$CI_COMMIT_BEFORE_SHA" != "0000000000000000000000000000000000000000" ]]; then
|
||||
git fetch origin $CI_COMMIT_BEFORE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git diff --name-only $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA > "$TEMP_FILE"
|
||||
GIT_DIFF_OUTPUT=$(cat "$TEMP_FILE")
|
||||
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA)
|
||||
else
|
||||
# pipeline source could be web, scheduler, etc.
|
||||
git fetch origin $CI_COMMIT_SHA --depth=2 ${GIT_FETCH_EXTRA_FLAGS}
|
||||
git diff --name-only $CI_COMMIT_SHA~1 $CI_COMMIT_SHA > "$TEMP_FILE"
|
||||
GIT_DIFF_OUTPUT=$(cat "$TEMP_FILE")
|
||||
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_COMMIT_SHA~1 $CI_COMMIT_SHA)
|
||||
fi
|
||||
- *git_checkout_ci_commit_sha
|
||||
- *common-before_scripts
|
||||
|
||||
@@ -9,14 +9,8 @@
|
||||
extra_default_build_targets:
|
||||
- esp32c5
|
||||
- esp32c61
|
||||
- esp32h21
|
||||
- esp32h4
|
||||
|
||||
bypass_check_test_targets:
|
||||
- esp32h21
|
||||
- esp32h4
|
||||
- esp32c5
|
||||
- esp32c61
|
||||
|
||||
#
|
||||
# These lines would
|
||||
|
||||
@@ -90,5 +90,3 @@
|
||||
- windows
|
||||
specific_rules:
|
||||
- if-schedule-test-build-system-windows
|
||||
patterns:
|
||||
- build_system_win
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
image: $ESP_ENV_IMAGE
|
||||
tags: [ deploy ]
|
||||
|
||||
# Check this before push_to_github
|
||||
check_submodule_sync:
|
||||
extends:
|
||||
- .deploy_job_template
|
||||
@@ -30,9 +31,8 @@ push_to_github:
|
||||
extends:
|
||||
- .deploy_job_template
|
||||
- .before_script:minimal
|
||||
- .rules:protected:deploy
|
||||
- .rules:push_to_github
|
||||
needs:
|
||||
# submodule must be synced before pushing to github
|
||||
- check_submodule_sync
|
||||
tags: [ brew, github_sync ]
|
||||
variables:
|
||||
@@ -45,16 +45,12 @@ push_to_github:
|
||||
- git remote remove github &>/dev/null || true
|
||||
- git remote add github git@github.com:espressif/esp-idf.git
|
||||
- tools/ci/push_to_github.sh
|
||||
environment:
|
||||
name: push_to_github_production
|
||||
deployment_tier: production
|
||||
url: "https://github.com/espressif/esp-idf"
|
||||
|
||||
deploy_update_SHA_in_esp-dockerfiles:
|
||||
extends:
|
||||
- .deploy_job_template
|
||||
- .before_script:minimal
|
||||
- .rules:protected:deploy
|
||||
- .rules:protected-no_label-always
|
||||
dependencies: []
|
||||
variables:
|
||||
GIT_DEPTH: 2
|
||||
@@ -63,6 +59,3 @@ deploy_update_SHA_in_esp-dockerfiles:
|
||||
- 'curl --header "PRIVATE-TOKEN: ${ESPCI_SCRIPTS_TOKEN}" -o create_MR_in_esp_dockerfile.sh $GITLAB_HTTP_SERVER/api/v4/projects/1260/repository/files/create_MR_in_esp_dockerfile%2Fcreate_MR_in_esp_dockerfile.sh/raw\?ref\=master'
|
||||
- chmod +x create_MR_in_esp_dockerfile.sh
|
||||
- ./create_MR_in_esp_dockerfile.sh
|
||||
environment:
|
||||
name: eploy_update_SHA_in_esp-dockerfiles_production
|
||||
deployment_tier: production
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
- "**/*.rst"
|
||||
- "CONTRIBUTING.rst"
|
||||
- "**/soc_caps.h"
|
||||
- "**/Kconfig*"
|
||||
|
||||
.patterns-docs-partial: &patterns-docs-partial
|
||||
- "components/**/*.h"
|
||||
- "components/**/Kconfig*"
|
||||
- "components/**/CMakeList.txt"
|
||||
- "components/**/sdkconfig*"
|
||||
- "tools/tools.json"
|
||||
@@ -19,9 +19,12 @@
|
||||
.patterns-docs-preview: &patterns-docs-preview
|
||||
- "docs/**/*"
|
||||
|
||||
.if-protected-check: &if-protected-check
|
||||
.if-protected: &if-protected
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/)'
|
||||
|
||||
.if-protected-no_label: &if-protected-no_label
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
|
||||
|
||||
.if-qa-test-tag: &if-qa-test-tag
|
||||
if: '$CI_COMMIT_TAG =~ /^qa-test/'
|
||||
|
||||
@@ -38,7 +41,7 @@
|
||||
rules:
|
||||
- <<: *if-qa-test-tag
|
||||
when: never
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build_docs
|
||||
- <<: *if-label-docs_full
|
||||
- <<: *if-dev-push
|
||||
@@ -61,7 +64,7 @@ check_readme_links:
|
||||
tags: ["build", "amd64", "internet"]
|
||||
allow_failure: true
|
||||
rules:
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-example-readme
|
||||
script:
|
||||
@@ -85,15 +88,13 @@ check_docs_lang_sync:
|
||||
artifacts: false
|
||||
optional: true
|
||||
script:
|
||||
- if [ -n "${BREATHE_ALT_INSTALL_URL_PY39}" ]; then
|
||||
pip uninstall -y breathe && pip install -U ${BREATHE_ALT_INSTALL_URL_PY39};
|
||||
fi
|
||||
- if [ -n "${BREATHE_ALT_INSTALL_URL}" ]; then pip uninstall -y breathe && pip install -U ${BREATHE_ALT_INSTALL_URL}; fi
|
||||
- cd docs
|
||||
- build-docs -t $DOCTGT -bs $DOC_BUILDERS -l $DOCLANG build
|
||||
parallel:
|
||||
matrix:
|
||||
- DOCLANG: ["en", "zh_CN"]
|
||||
DOCTGT: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c2", "esp32c6", "esp32c61", "esp32c5", "esp32h2", "esp32h4", "esp32h21", "esp32p4"]
|
||||
DOCTGT: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c2", "esp32c6", "esp32c61", "esp32c5","esp32h2", "esp32p4"]
|
||||
|
||||
check_docs_gh_links:
|
||||
image: $ESP_IDF_DOC_ENV_IMAGE
|
||||
@@ -143,16 +144,11 @@ build_docs_html_partial:
|
||||
variables:
|
||||
DOCS_BUILD_DIR: "${IDF_PATH}/docs/_build/"
|
||||
PYTHONUNBUFFERED: 1
|
||||
# ensure all tags are fetched, need to know the latest/stable tag for the docs
|
||||
GIT_STRATEGY: clone
|
||||
GIT_DEPTH: 0
|
||||
stage: test_deploy
|
||||
tags:
|
||||
- deploy
|
||||
- shiny
|
||||
script:
|
||||
# ensure all tags are fetched, need to know the latest/stable tag for the docs
|
||||
- git fetch --tags --prune
|
||||
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
|
||||
- export GIT_VER=$(git describe --always ${PIPELINE_COMMIT_SHA} --)
|
||||
- deploy-docs
|
||||
@@ -179,17 +175,14 @@ deploy_docs_preview:
|
||||
DOCS_DEPLOY_SERVER_USER: "$DOCS_SERVER_USER"
|
||||
DOCS_DEPLOY_PATH: "$DOCS_PATH"
|
||||
DOCS_DEPLOY_URL_BASE: "https://$DOCS_PREVIEW_SERVER_URL/docs/esp-idf"
|
||||
environment:
|
||||
name: deploy_docs_preview
|
||||
deployment_tier: staging
|
||||
url: "https://$DOCS_PREVIEW_SERVER_URL/docs/esp-idf"
|
||||
|
||||
# stage: post_deploy
|
||||
deploy_docs_production:
|
||||
# The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings
|
||||
extends:
|
||||
- .deploy_docs_template
|
||||
- .rules:protected:deploy
|
||||
rules:
|
||||
- <<: *if-protected-no_label
|
||||
stage: post_deploy
|
||||
dependencies: # set dependencies to null to avoid missing artifacts issue
|
||||
needs: # ensure runs after push_to_github succeeded
|
||||
@@ -204,15 +197,12 @@ deploy_docs_production:
|
||||
DOCS_DEPLOY_PATH: "$DOCS_PROD_PATH"
|
||||
DOCS_DEPLOY_URL_BASE: "https://docs.espressif.com/projects/esp-idf"
|
||||
DEPLOY_STABLE: 1
|
||||
environment:
|
||||
name: deploy_docs_production
|
||||
deployment_tier: production
|
||||
url: "https://docs.espressif.com/projects/esp-idf"
|
||||
|
||||
check_doc_links:
|
||||
extends:
|
||||
- .build_docs_template
|
||||
- .rules:protected:deploy
|
||||
rules:
|
||||
- <<: *if-protected-no_label
|
||||
stage: post_deploy
|
||||
needs:
|
||||
- job: deploy_docs_production
|
||||
|
||||
@@ -33,8 +33,6 @@ check_public_headers:
|
||||
- IDF_TARGET=esp32h2 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf-
|
||||
- IDF_TARGET=esp32p4 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf-
|
||||
- IDF_TARGET=esp32c61 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf-
|
||||
- IDF_TARGET=esp32h21 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf-
|
||||
- IDF_TARGET=esp32h4 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf-
|
||||
|
||||
test_nvs_coverage:
|
||||
extends:
|
||||
@@ -113,8 +111,7 @@ test_cli_installer:
|
||||
script:
|
||||
# Tools must be downloaded for testing
|
||||
# We could use "idf_tools.py download all", but we don't want to install clang because of its huge size
|
||||
# cmake@version that is supported
|
||||
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
|
||||
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
|
||||
- cd ${IDF_PATH}/tools/test_idf_tools
|
||||
- python3 -m pip install jsonschema
|
||||
- python3 ./test_idf_tools.py -v
|
||||
@@ -207,14 +204,10 @@ test_tools:
|
||||
- pytest --noconftest test_idf_py.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY.xml || stat=1
|
||||
- pytest --noconftest test_hints.py --junitxml=${IDF_PATH}/XUNIT_HINTS.xml || stat=1
|
||||
- pytest --noconftest test_idf_qemu.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY_QEMU.xml || stat=1
|
||||
- cd ${IDF_PATH}/tools/test_bsasm
|
||||
- pytest --noconftest test_bsasm.py --junitxml=${IDF_PATH}/XUNIT_BSASM.xml || stat=1
|
||||
- cd ${IDF_PATH}/tools/test_mkdfu
|
||||
- pytest --noconftest test_mkdfu.py --junitxml=${IDF_PATH}/XUNIT_MKDFU.xml || stat=1
|
||||
- cd ${IDF_PATH}/tools/test_idf_size
|
||||
- pytest --noconftest test_idf_size.py --junitxml=${IDF_PATH}/XUNIT_IDF_SIZE.xml || stat=1
|
||||
- cd ${IDF_PATH}/tools/test_idf_diag
|
||||
- pytest --noconftest test_idf_diag.py --junitxml=${IDF_PATH}/XUNIT_IDF_DIAG.xml || stat=1
|
||||
- cd ${IDF_PATH}
|
||||
- shellcheck -s sh tools/detect_python.sh || stat=1
|
||||
- shellcheck -s bash tools/detect_python.sh || stat=1
|
||||
@@ -240,7 +233,6 @@ test_mqtt_on_host:
|
||||
|
||||
test_transport_on_host:
|
||||
extends: .host_test_template
|
||||
allow_failure: true # IDFCI-2781 [v5.5, v5.4] test_transport_on_host fails on ubuntu 24.04
|
||||
script:
|
||||
- cd ${IDF_PATH}/components/tcp_transport/host_test
|
||||
- idf.py build
|
||||
@@ -292,11 +284,8 @@ test_pytest_qemu:
|
||||
matrix:
|
||||
- IDF_TARGET: "esp32"
|
||||
INSTALL_EXTRA_TOOLS: "qemu-xtensa"
|
||||
# Skip Clang + Xtensa tests due to bootloader size issue
|
||||
IDF_TOOLCHAIN: [gcc]
|
||||
- IDF_TARGET: "esp32c3"
|
||||
INSTALL_EXTRA_TOOLS: "qemu-riscv32"
|
||||
IDF_TOOLCHAIN: [gcc, clang]
|
||||
script:
|
||||
- run_cmd python tools/ci/ci_build_apps.py . -v
|
||||
--target $IDF_TARGET
|
||||
@@ -349,7 +338,7 @@ test_pytest_macos:
|
||||
- .host_test_template
|
||||
- .before_script:build:macos
|
||||
tags:
|
||||
- macos
|
||||
- macos_shell
|
||||
artifacts:
|
||||
paths:
|
||||
- XUNIT_RESULT.xml
|
||||
@@ -358,24 +347,19 @@ test_pytest_macos:
|
||||
reports:
|
||||
junit: XUNIT_RESULT.xml
|
||||
variables:
|
||||
PYENV_VERSION: "3.9"
|
||||
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
|
||||
# Workaround for a bug in Parallels executor where CI_PROJECT_DIR is not an absolute path,
|
||||
# but a relative path to the build directory (builds/espressif/esp-idf instead of ~/builds/espressif/esp-idf.
|
||||
# GitLab sets the project dir to this template `<builds_dir>/<namespace>/<project_name>`
|
||||
IDF_PATH: "/Users/espressif/builds/espressif/esp-idf"
|
||||
script:
|
||||
- run_cmd python tools/ci/ci_build_apps.py components examples tools/test_apps -v
|
||||
--target linux
|
||||
--pytest-apps
|
||||
-m \"host_test and macos\"
|
||||
-m \"host_test and macos_shell\"
|
||||
--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\"
|
||||
-m \"host_test and macos_shell\"
|
||||
--junitxml=XUNIT_RESULT.xml
|
||||
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
|
||||
--app-info-filepattern \"list_job_*.txt\"
|
||||
|
||||
@@ -1,32 +1,13 @@
|
||||
.post_deploy_template:
|
||||
stage: post_deploy
|
||||
image: $ESP_ENV_IMAGE
|
||||
|
||||
generate_failed_jobs_report:
|
||||
extends:
|
||||
- .post_deploy_template
|
||||
stage: post_deploy
|
||||
tags: [build, shiny]
|
||||
image: $ESP_ENV_IMAGE
|
||||
when: always
|
||||
dependencies: [] # Do not download artifacts from the previous stages
|
||||
artifacts:
|
||||
expire_in: 2 week
|
||||
expire_in: 1 week
|
||||
when: always
|
||||
paths:
|
||||
- job_report.html
|
||||
script:
|
||||
- python tools/ci/dynamic_pipelines/scripts/generate_report.py --report-type job
|
||||
|
||||
sync_support_status:
|
||||
extends:
|
||||
- .post_deploy_template
|
||||
- .rules:master:push
|
||||
tags: [ brew, github_sync ]
|
||||
needs:
|
||||
- push_to_github
|
||||
cache: []
|
||||
before_script: []
|
||||
script:
|
||||
- curl --fail --request POST --form token="$IDF_STATUS_TRIG_TOKEN" --form ref="$IDF_STATUS_BRANCH" --form "variables[UPLOAD_TO_S3]=true" "$IDF_STATUS_TRIG_URL"
|
||||
environment:
|
||||
name: sync_support_status_production
|
||||
deployment_tier: production
|
||||
|
||||
@@ -10,7 +10,7 @@ check_version:
|
||||
# esp_idf_version.h in a branch before tagging the next version.
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .rules:protected:check
|
||||
- .rules:protected
|
||||
tags: [ brew, github_sync ]
|
||||
variables:
|
||||
# need a full clone to get the latest tag
|
||||
@@ -72,7 +72,7 @@ check_chip_support_components:
|
||||
expire_in: 1 week
|
||||
script:
|
||||
- python tools/ci/check_soc_headers_leak.py
|
||||
- find ${IDF_PATH}/components/soc/**/include/soc/ ${IDF_PATH}/components/soc/**/register/soc/ -name "*_struct.h" -print0 | xargs -0 -n1 ./tools/ci/check_soc_struct_headers.py
|
||||
- find ${IDF_PATH}/components/soc/**/include/soc/ -name "*_struct.h" -print0 | xargs -0 -n1 ./tools/ci/check_soc_struct_headers.py
|
||||
- tools/ci/check_esp_memory_utils_headers.sh
|
||||
|
||||
check_esp_err_to_name:
|
||||
@@ -165,8 +165,6 @@ pipeline_variables:
|
||||
if [ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]; then
|
||||
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
|
||||
fi
|
||||
- echo "OOCD_DISTRO_URL_ARMHF=$OOCD_DISTRO_URL_ARMHF" >> pipeline.env
|
||||
- echo "OOCD_DISTRO_URL_ARM64=$OOCD_DISTRO_URL_ARM64" >> pipeline.env
|
||||
- python tools/ci/ci_process_description.py
|
||||
- cat pipeline.env
|
||||
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
# Add folders excluded by "???[!t]" and "??[!s]?"
|
||||
# pre-commit: tools/ci/check_rules_components_patterns.py
|
||||
- "components/bt/host/**/*"
|
||||
- "components/esp_psram/system_layer/*"
|
||||
|
||||
.patterns-downloadable-tools: &patterns-downloadable-tools
|
||||
- "tools/idf_tools.py"
|
||||
@@ -56,9 +55,6 @@
|
||||
- "tools/ci/ci_build_apps.py"
|
||||
- "tools/test_build_system/**/*"
|
||||
|
||||
.patterns-build_system_win: &patterns-build_system_win
|
||||
- "tools/test_build_system/**/*"
|
||||
|
||||
.patterns-build_macos: &patterns-build_macos
|
||||
- "tools/ci/test_configure_ci_environment.sh"
|
||||
|
||||
@@ -72,7 +68,6 @@
|
||||
- "tools/ci/check_public_headers.py"
|
||||
- "tools/ci/check_register_rw_half_word.cmake"
|
||||
- "tools/ci/check_register_rw_half_word.py"
|
||||
- "examples/build_system/**/*"
|
||||
|
||||
.patterns-host_test: &patterns-host_test
|
||||
- ".gitlab/ci/host-test.yml"
|
||||
@@ -97,8 +92,6 @@
|
||||
- "tools/idf_size.py"
|
||||
- "tools/test_idf_size/**/*"
|
||||
|
||||
- "tools/test_idf_diag/**/*"
|
||||
|
||||
- "tools/tools.json"
|
||||
- "tools/tools_schema.json"
|
||||
- "tools/idf_tools.py"
|
||||
@@ -131,9 +124,6 @@
|
||||
|
||||
- "tools/check_python_dependencies.py"
|
||||
|
||||
- "tools/bsasm.py"
|
||||
- "tools/test_bsasm/**/*"
|
||||
|
||||
.patterns-docker: &patterns-docker
|
||||
- "tools/docker/**/*"
|
||||
|
||||
@@ -170,19 +160,19 @@
|
||||
##############
|
||||
# if anchors #
|
||||
##############
|
||||
.if-master-push: &if-master-push
|
||||
if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "push"'
|
||||
.if-ref-master: &if-ref-master
|
||||
if: '$CI_COMMIT_REF_NAME == "master"'
|
||||
|
||||
.if-release-tag: &if-release-tag
|
||||
.if-tag-release: &if-tag-release
|
||||
if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/'
|
||||
|
||||
.if-protected-check: &if-protected-check
|
||||
.if-protected: &if-protected
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) || $CI_COMMIT_TAG =~ /^qa-test/'
|
||||
|
||||
.if-protected-deploy: &if-protected-deploy
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "api")'
|
||||
.if-protected-no_label: &if-protected-no_label
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
|
||||
|
||||
.if-protected-branch-push: &if-protected-branch-push
|
||||
.if-protected-ref-push: &if-protected-ref-push
|
||||
# rules:changes always evaluates to true for new branch pipelines or when there is no Git push event
|
||||
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/) && $CI_PIPELINE_SOURCE == "push"'
|
||||
|
||||
@@ -192,6 +182,9 @@
|
||||
.if-dev-push: &if-dev-push
|
||||
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
|
||||
|
||||
.if-schedule: &if-schedule
|
||||
if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
|
||||
.if-schedule-nightly: &if-schedule-nightly
|
||||
if: '$CI_PIPELINE_SOURCE == "schedule" && $INCLUDE_NIGHTLY_RUN == "1"'
|
||||
|
||||
@@ -211,41 +204,46 @@
|
||||
# Rules #
|
||||
#########
|
||||
### Branches ###
|
||||
.rules:protected:check:
|
||||
.rules:protected:
|
||||
rules:
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
|
||||
.rules:protected:deploy:
|
||||
.rules:push_to_github:
|
||||
rules:
|
||||
- <<: *if-qa-test-tag
|
||||
when: never
|
||||
- <<: *if-protected-deploy
|
||||
- <<: *if-protected-no_label
|
||||
|
||||
.rules:master:push:
|
||||
.rules:protected-no_label-always:
|
||||
rules:
|
||||
- <<: *if-master-push
|
||||
- <<: *if-qa-test-tag
|
||||
when: never
|
||||
- <<: *if-protected-no_label
|
||||
when: always
|
||||
|
||||
.rules:tag:release:
|
||||
rules:
|
||||
- <<: *if-release-tag
|
||||
- <<: *if-tag-release
|
||||
|
||||
.rules:dev-push:
|
||||
rules:
|
||||
- <<: *if-dev-push
|
||||
|
||||
# Do not upload caches on dev branches by default
|
||||
.rules:upload-python-cache:
|
||||
rules:
|
||||
- <<: *if-release-tag
|
||||
- <<: *if-tag-release
|
||||
- <<: *if-schedule-nightly
|
||||
- <<: *if-protected-branch-push
|
||||
- <<: *if-protected-ref-push
|
||||
changes: *patterns-python-cache
|
||||
- <<: *if-label-upload_cache
|
||||
when: manual
|
||||
|
||||
.rules:upload-submodule-cache:
|
||||
rules:
|
||||
- <<: *if-release-tag
|
||||
- <<: *if-protected-branch-push
|
||||
# Needn't upload submodule cache in schedule pipeline
|
||||
- <<: *if-tag-release
|
||||
- <<: *if-protected-ref-push
|
||||
changes: *patterns-submodule
|
||||
- <<: *if-label-upload_cache
|
||||
when: manual
|
||||
@@ -253,10 +251,16 @@
|
||||
### Patterns ###
|
||||
.rules:patterns:clang_tidy:
|
||||
rules:
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-c-files
|
||||
|
||||
.rules:patterns:python-files:
|
||||
rules:
|
||||
- <<: *if-protected
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-python-files
|
||||
|
||||
#.rules:patterns:static-code-analysis-preview:
|
||||
# rules:
|
||||
# - <<: *if-dev-push
|
||||
@@ -268,7 +272,7 @@
|
||||
|
||||
.rules:patterns:idf-pytest-plugin:
|
||||
rules:
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-idf-pytest-plugin
|
||||
|
||||
@@ -312,7 +316,7 @@
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-build_components
|
||||
@@ -325,7 +329,7 @@
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-build_check
|
||||
@@ -340,7 +344,7 @@
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-label-docker
|
||||
- <<: *if-dev-push
|
||||
@@ -356,7 +360,7 @@
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-label-macos
|
||||
- <<: *if-label-macos_test
|
||||
@@ -371,7 +375,7 @@
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-build_components
|
||||
@@ -394,14 +398,12 @@
|
||||
when: never
|
||||
- <<: *if-schedule-test-build-system-windows
|
||||
- <<: *if-label-windows
|
||||
- <<: *if-dev-push
|
||||
changes: *patterns-build_system_win
|
||||
|
||||
.rules:test:host_test:
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-host_test
|
||||
@@ -412,7 +414,7 @@
|
||||
rules:
|
||||
- <<: *if-revert-branch
|
||||
when: never
|
||||
- <<: *if-protected-check
|
||||
- <<: *if-protected
|
||||
- <<: *if-label-build-only
|
||||
when: never
|
||||
- <<: *if-label-submodule
|
||||
|
||||
@@ -16,6 +16,28 @@ clang_tidy_check:
|
||||
--limit-file tools/ci/static-analysis-rules.yml
|
||||
--xtensa-include-dir
|
||||
|
||||
check_pylint:
|
||||
extends:
|
||||
- .pre_check_template
|
||||
- .rules:patterns:python-files
|
||||
needs:
|
||||
- pipeline_variables
|
||||
artifacts:
|
||||
reports:
|
||||
codequality: pylint.json
|
||||
paths:
|
||||
- pylint.json
|
||||
expire_in: 1 week
|
||||
when: always
|
||||
script:
|
||||
- |
|
||||
if [ -n "$CI_MERGE_REQUEST_IID" ]; then
|
||||
export files=$(echo "$GIT_DIFF_OUTPUT" | grep ".py$" | xargs);
|
||||
else
|
||||
export files=$(git ls-files "*.py" | xargs);
|
||||
fi
|
||||
- if [ -z "$files" ]; then echo "No python files found"; exit 0; fi
|
||||
- run_cmd pylint --exit-zero --load-plugins=pylint_gitlab --output-format=gitlab-codeclimate:pylint.json $files
|
||||
#
|
||||
## build stage
|
||||
## Sonarqube related jobs put here for this reason:
|
||||
@@ -85,7 +107,7 @@ clang_tidy_check:
|
||||
#code_quality_report:
|
||||
# extends:
|
||||
# - .sonar_scan_template
|
||||
# - .rules:protected:check
|
||||
# - .rules:protected
|
||||
# allow_failure: true # it's using exit code to indicate the code analysis result,
|
||||
# # we don't want to block ci when critical issues founded
|
||||
# script:
|
||||
|
||||
@@ -18,12 +18,9 @@
|
||||
after_script: []
|
||||
|
||||
test_cli_installer_win:
|
||||
rules:
|
||||
- when: never
|
||||
extends:
|
||||
- .host_test_win_template
|
||||
- .rules:labels:windows_pytest_build_system
|
||||
allow_failure: true
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
@@ -32,11 +29,9 @@ test_cli_installer_win:
|
||||
expire_in: 1 week
|
||||
variables:
|
||||
IDF_PATH: "$CI_PROJECT_DIR"
|
||||
timeout: 3h
|
||||
script:
|
||||
# Tools must be downloaded for testing
|
||||
# cmake@version that is supported
|
||||
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
|
||||
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
|
||||
- cd ${IDF_PATH}\tools\test_idf_tools
|
||||
- python -m pip install jsonschema
|
||||
- python .\test_idf_tools.py
|
||||
|
||||
@@ -27,6 +27,3 @@ Test Case Filters:
|
||||
# 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 -->
|
||||
|
||||
<!-- Don't remove the next line - assigns the MR author as the assignee -->
|
||||
/assign me
|
||||
|
||||
@@ -60,6 +60,3 @@ _If there are any breaking changes, please mention it here. Talking about (1) wh
|
||||
_Please strictly follow the breaking change restriction, which means, if there is a breaking change but you are merging to non-major versions, you have to separate the breaking part out to another MR for a major version. The breaking change subsection is only accepted in MRs merging to major versions._
|
||||
|
||||
* [VFS/UART] Now vfs_uart_set_rts_cts accept one more instance argument, to support configuration to different ports.
|
||||
|
||||
<!-- Don't remove the next line - assigns the MR author as the assignee -->
|
||||
/assign me
|
||||
|
||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -54,10 +54,8 @@
|
||||
sbom-supplier = Person: Dave Gamble
|
||||
sbom-url = https://github.com/DaveGamble/cJSON
|
||||
sbom-description = Ultralightweight JSON parser in ANSI C
|
||||
sbom-hash = 8f2beb57ddad1f94bed899790b00f46df893ccac
|
||||
sbom-hash = acc76239bee01d8e9c858ae2cab296704e52d916
|
||||
sbom-cve-exclude-list = CVE-2024-31755 Resolved in v1.7.18
|
||||
sbom-cve-exclude-list = CVE-2023-26819 Resolved in commit a328d65ad490b64da8c87523cbbfe16050ba5bf6
|
||||
sbom-cve-exclude-list = CVE-2023-53154 Resolved in v1.7.18
|
||||
|
||||
[submodule "components/mbedtls/mbedtls"]
|
||||
path = components/mbedtls/mbedtls
|
||||
|
||||
@@ -1,35 +1,9 @@
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
|
||||
default_stages: [pre-commit]
|
||||
default_stages: [commit]
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: "v0.9.7"
|
||||
hooks:
|
||||
- id: ruff-format
|
||||
- id: ruff
|
||||
args: [ "--fix" ]
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pytest-linter
|
||||
name: Pytest Linter Check
|
||||
entry: tools/ci/check_test_files.py
|
||||
language: python
|
||||
files: 'pytest_.*\.py$'
|
||||
require_serial: true
|
||||
additional_dependencies:
|
||||
- pytest-embedded-idf[serial]~=1.16
|
||||
- pytest-embedded-jtag~=1.16
|
||||
- pytest-embedded-qemu~=1.16
|
||||
- pytest-ignore-test-results~=0.3
|
||||
- pytest-rerunfailures
|
||||
- pytest-timeout
|
||||
- idf-build-apps~=2.8
|
||||
- python-gitlab
|
||||
- minio
|
||||
- click
|
||||
- esp-idf-monitor
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
@@ -40,7 +14,6 @@ repos:
|
||||
# 2 - any file matching *test*/*expected* (for host tests, if possible use this naming pattern always)
|
||||
# 3 - any directory named 'testdata'
|
||||
# 4 - protobuf auto-generated files
|
||||
# 5 - COPYING files
|
||||
exclude: &whitespace_excludes |
|
||||
(?x)^(
|
||||
.+\.(md|rst|map|bin)|
|
||||
@@ -50,9 +23,7 @@ repos:
|
||||
.*.pb-c.h|
|
||||
.*.pb-c.c|
|
||||
.*.yuv|
|
||||
.*.rgb|
|
||||
.*COPYING.*|
|
||||
docs/sphinx-known-warnings\.txt
|
||||
.*.rgb
|
||||
)$
|
||||
- id: end-of-file-fixer
|
||||
exclude: *whitespace_excludes
|
||||
@@ -66,6 +37,21 @@ repos:
|
||||
- id: no-commit-to-branch
|
||||
name: Do not use uppercase letters in the branch name
|
||||
args: ['--pattern', '^[^A-Z]*[A-Z]']
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 5.0.4
|
||||
hooks:
|
||||
- id: flake8
|
||||
args: ['--config=.flake8', '--tee', '--benchmark']
|
||||
- repo: https://github.com/asottile/reorder-python-imports
|
||||
rev: v3.12.0
|
||||
hooks:
|
||||
- id: reorder-python-imports
|
||||
name: Reorder Python imports
|
||||
args: [--py38-plus]
|
||||
exclude: >
|
||||
(?x)^(
|
||||
.*_pb2.py
|
||||
)$
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
@@ -84,6 +70,11 @@ repos:
|
||||
language: python
|
||||
pass_filenames: false
|
||||
always_run: true
|
||||
- id: check-deprecated-kconfigs-options
|
||||
name: Check if any Kconfig Options Deprecated
|
||||
entry: tools/ci/check_deprecated_kconfigs.py
|
||||
language: python
|
||||
files: 'sdkconfig\.ci$|sdkconfig\.rename$|sdkconfig.*$'
|
||||
- id: cmake-lint
|
||||
name: Check CMake Files Format
|
||||
entry: cmakelint --linelength=120 --spaces=4 --filter=-whitespace/indent
|
||||
@@ -163,7 +154,7 @@ repos:
|
||||
require_serial: true
|
||||
additional_dependencies:
|
||||
- PyYAML == 5.3.1
|
||||
- idf-build-apps>=2.8,<3
|
||||
- idf-build-apps~=2.5
|
||||
- id: sort-yaml-files
|
||||
name: sort yaml files
|
||||
entry: tools/ci/sort_yaml.py
|
||||
@@ -207,12 +198,12 @@ repos:
|
||||
- id: file-contents-sorter
|
||||
files: 'tools\/ci\/(executable-list\.txt|mypy_ignore_list\.txt|check_copyright_ignore\.txt)'
|
||||
- repo: https://github.com/espressif/check-copyright/
|
||||
rev: v1.1.1
|
||||
rev: v1.0.3
|
||||
hooks:
|
||||
- id: check-copyright
|
||||
args: ['--ignore', 'tools/ci/check_copyright_ignore.txt', '--config', 'tools/ci/check_copyright_config.yaml']
|
||||
- repo: https://github.com/espressif/conventional-precommit-linter
|
||||
rev: v1.10.0
|
||||
rev: v1.7.0
|
||||
hooks:
|
||||
- id: conventional-precommit-linter
|
||||
stages: [commit-msg]
|
||||
@@ -250,7 +241,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.5.0
|
||||
rev: v2.4.1
|
||||
hooks:
|
||||
- id: check-kconfig-files
|
||||
- id: check-deprecated-kconfig-options
|
||||
|
||||
641
.pylintrc
Normal file
641
.pylintrc
Normal file
@@ -0,0 +1,641 @@
|
||||
[MAIN]
|
||||
|
||||
# Analyse import fallback blocks. This can be used to support both Python 2 and
|
||||
# 3 compatible code, which means that the block might have code that exists
|
||||
# only in one or another interpreter, leading to false positives when analysed.
|
||||
analyse-fallback-blocks=no
|
||||
|
||||
# Clear in-memory caches upon conclusion of linting. Useful if running pylint
|
||||
# in a server-like mode.
|
||||
clear-cache-post-run=no
|
||||
|
||||
# Load and enable all available extensions. Use --list-extensions to see a list
|
||||
# all available extensions.
|
||||
#enable-all-extensions=
|
||||
|
||||
# In error mode, messages with a category besides ERROR or FATAL are
|
||||
# suppressed, and no reports are done by default. Error mode is compatible with
|
||||
# disabling specific errors.
|
||||
#errors-only=
|
||||
|
||||
# Always return a 0 (non-error) status code, even if lint errors are found.
|
||||
# This is primarily useful in continuous integration scripts.
|
||||
#exit-zero=
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code.
|
||||
extension-pkg-allow-list=
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
|
||||
# for backward compatibility.)
|
||||
extension-pkg-whitelist=
|
||||
|
||||
# Return non-zero exit code if any of these messages/categories are detected,
|
||||
# even if score is above --fail-under value. Syntax same as enable. Messages
|
||||
# specified are enabled, while categories only check already-enabled messages.
|
||||
fail-on=
|
||||
|
||||
# Specify a score threshold under which the program will exit with error.
|
||||
fail-under=10
|
||||
|
||||
# Interpret the stdin as a python script, whose filename needs to be passed as
|
||||
# the module_or_package argument.
|
||||
#from-stdin=
|
||||
|
||||
# Files or directories to be skipped. They should be base names, not paths.
|
||||
ignore=CVS
|
||||
|
||||
# Add files or directories matching the regular expressions patterns to the
|
||||
# ignore-list. The regex matches against paths and can be in Posix or Windows
|
||||
# format. Because '\\' represents the directory delimiter on Windows systems,
|
||||
# it can't be used as an escape character.
|
||||
ignore-paths=
|
||||
|
||||
# Files or directories matching the regular expression patterns are skipped.
|
||||
# The regex matches against base names, not paths. The default value ignores
|
||||
# Emacs file locks
|
||||
ignore-patterns=^\.#
|
||||
|
||||
# List of module names for which member attributes should not be checked
|
||||
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||
# and thus existing member attributes cannot be deduced by static analysis). It
|
||||
# supports qualified module names, as well as Unix pattern matching.
|
||||
ignored-modules=
|
||||
|
||||
# Python code to execute, usually for sys.path manipulation such as
|
||||
# pygtk.require().
|
||||
#init-hook=
|
||||
|
||||
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
|
||||
# number of processors available to use, and will cap the count on Windows to
|
||||
# avoid hangs.
|
||||
jobs=1
|
||||
|
||||
# Control the amount of potential inferred values when inferring a single
|
||||
# object. This can help the performance when dealing with large functions or
|
||||
# complex, nested conditions.
|
||||
limit-inference-results=100
|
||||
|
||||
# List of plugins (as comma separated values of python module names) to load,
|
||||
# usually to register additional checkers.
|
||||
load-plugins=
|
||||
|
||||
# Pickle collected data for later comparisons.
|
||||
persistent=yes
|
||||
|
||||
# Minimum Python version to use for version dependent checks. Will default to
|
||||
# the version used to run pylint.
|
||||
py-version=3.8
|
||||
|
||||
# Discover python modules and packages in the file system subtree.
|
||||
recursive=no
|
||||
|
||||
# Add paths to the list of the source roots. Supports globbing patterns. The
|
||||
# source root is an absolute path or a path relative to the current working
|
||||
# directory used to determine a package namespace for modules located under the
|
||||
# source root.
|
||||
source-roots=
|
||||
|
||||
# When enabled, pylint would attempt to guess common misconfiguration and emit
|
||||
# user-friendly hints instead of false-positive error messages.
|
||||
suggestion-mode=yes
|
||||
|
||||
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||
# active Python interpreter and may run arbitrary code.
|
||||
unsafe-load-any-extension=no
|
||||
|
||||
# In verbose mode, extra non-checker-related info will be displayed.
|
||||
#verbose=
|
||||
|
||||
|
||||
[BASIC]
|
||||
|
||||
# Naming style matching correct argument names.
|
||||
argument-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct argument names. Overrides argument-
|
||||
# naming-style. If left empty, argument names will be checked with the set
|
||||
# naming style.
|
||||
#argument-rgx=
|
||||
|
||||
# Naming style matching correct attribute names.
|
||||
attr-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct attribute names. Overrides attr-naming-
|
||||
# style. If left empty, attribute names will be checked with the set naming
|
||||
# style.
|
||||
#attr-rgx=
|
||||
|
||||
# Bad variable names which should always be refused, separated by a comma.
|
||||
bad-names=foo,
|
||||
bar,
|
||||
baz,
|
||||
toto,
|
||||
tutu,
|
||||
tata
|
||||
|
||||
# Bad variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be refused
|
||||
bad-names-rgxs=
|
||||
|
||||
# Naming style matching correct class attribute names.
|
||||
class-attribute-naming-style=any
|
||||
|
||||
# Regular expression matching correct class attribute names. Overrides class-
|
||||
# attribute-naming-style. If left empty, class attribute names will be checked
|
||||
# with the set naming style.
|
||||
#class-attribute-rgx=
|
||||
|
||||
# Naming style matching correct class constant names.
|
||||
class-const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct class constant names. Overrides class-
|
||||
# const-naming-style. If left empty, class constant names will be checked with
|
||||
# the set naming style.
|
||||
#class-const-rgx=
|
||||
|
||||
# Naming style matching correct class names.
|
||||
class-naming-style=PascalCase
|
||||
|
||||
# Regular expression matching correct class names. Overrides class-naming-
|
||||
# style. If left empty, class names will be checked with the set naming style.
|
||||
#class-rgx=
|
||||
|
||||
# Naming style matching correct constant names.
|
||||
const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct constant names. Overrides const-naming-
|
||||
# style. If left empty, constant names will be checked with the set naming
|
||||
# style.
|
||||
#const-rgx=
|
||||
|
||||
# Minimum line length for functions/classes that require docstrings, shorter
|
||||
# ones are exempt.
|
||||
docstring-min-length=-1
|
||||
|
||||
# Naming style matching correct function names.
|
||||
function-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct function names. Overrides function-
|
||||
# naming-style. If left empty, function names will be checked with the set
|
||||
# naming style.
|
||||
#function-rgx=
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma.
|
||||
good-names=i,
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
|
||||
# Good variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be accepted
|
||||
good-names-rgxs=
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name.
|
||||
include-naming-hint=no
|
||||
|
||||
# Naming style matching correct inline iteration names.
|
||||
inlinevar-naming-style=any
|
||||
|
||||
# Regular expression matching correct inline iteration names. Overrides
|
||||
# inlinevar-naming-style. If left empty, inline iteration names will be checked
|
||||
# with the set naming style.
|
||||
#inlinevar-rgx=
|
||||
|
||||
# Naming style matching correct method names.
|
||||
method-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct method names. Overrides method-naming-
|
||||
# style. If left empty, method names will be checked with the set naming style.
|
||||
#method-rgx=
|
||||
|
||||
# Naming style matching correct module names.
|
||||
module-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct module names. Overrides module-naming-
|
||||
# style. If left empty, module names will be checked with the set naming style.
|
||||
#module-rgx=
|
||||
|
||||
# Colon-delimited sets of names that determine each other's naming style when
|
||||
# the name regexes allow several styles.
|
||||
name-group=
|
||||
|
||||
# Regular expression which should only match function or class names that do
|
||||
# not require a docstring.
|
||||
no-docstring-rgx=^_
|
||||
|
||||
# List of decorators that produce properties, such as abc.abstractproperty. Add
|
||||
# to this list to register other decorators that produce valid properties.
|
||||
# These decorators are taken in consideration only for invalid-name.
|
||||
property-classes=abc.abstractproperty
|
||||
|
||||
# Regular expression matching correct type alias names. If left empty, type
|
||||
# alias names will be checked with the set naming style.
|
||||
#typealias-rgx=
|
||||
|
||||
# Regular expression matching correct type variable names. If left empty, type
|
||||
# variable names will be checked with the set naming style.
|
||||
#typevar-rgx=
|
||||
|
||||
# Naming style matching correct variable names.
|
||||
variable-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct variable names. Overrides variable-
|
||||
# naming-style. If left empty, variable names will be checked with the set
|
||||
# naming style.
|
||||
#variable-rgx=
|
||||
|
||||
|
||||
[CLASSES]
|
||||
|
||||
# Warn about protected attribute access inside special methods
|
||||
check-protected-access-in-special-methods=no
|
||||
|
||||
# List of method names used to declare (i.e. assign) instance attributes.
|
||||
defining-attr-methods=__init__,
|
||||
__new__,
|
||||
setUp,
|
||||
asyncSetUp,
|
||||
__post_init__
|
||||
|
||||
# List of member names, which should be excluded from the protected access
|
||||
# warning.
|
||||
exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit
|
||||
|
||||
# List of valid names for the first argument in a class method.
|
||||
valid-classmethod-first-arg=cls
|
||||
|
||||
# List of valid names for the first argument in a metaclass class method.
|
||||
valid-metaclass-classmethod-first-arg=mcs
|
||||
|
||||
|
||||
[DESIGN]
|
||||
|
||||
# List of regular expressions of class ancestor names to ignore when counting
|
||||
# public methods (see R0903)
|
||||
exclude-too-few-public-methods=
|
||||
|
||||
# List of qualified class names to ignore when counting class parents (see
|
||||
# R0901)
|
||||
ignored-parents=
|
||||
|
||||
# Maximum number of arguments for function / method.
|
||||
max-args=5
|
||||
|
||||
# Maximum number of attributes for a class (see R0902).
|
||||
max-attributes=7
|
||||
|
||||
# Maximum number of boolean expressions in an if statement (see R0916).
|
||||
max-bool-expr=5
|
||||
|
||||
# Maximum number of branch for function / method body.
|
||||
max-branches=12
|
||||
|
||||
# Maximum number of locals for function / method body.
|
||||
max-locals=15
|
||||
|
||||
# Maximum number of parents for a class (see R0901).
|
||||
max-parents=7
|
||||
|
||||
# Maximum number of public methods for a class (see R0904).
|
||||
max-public-methods=20
|
||||
|
||||
# Maximum number of return / yield for function / method body.
|
||||
max-returns=6
|
||||
|
||||
# Maximum number of statements in function / method body.
|
||||
max-statements=50
|
||||
|
||||
# Minimum number of public methods for a class (see R0903).
|
||||
min-public-methods=2
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when caught.
|
||||
overgeneral-exceptions=builtins.BaseException,builtins.Exception
|
||||
|
||||
|
||||
[FORMAT]
|
||||
|
||||
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
|
||||
expected-line-ending-format=
|
||||
|
||||
# Regexp for a line that is allowed to be longer than the limit.
|
||||
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
|
||||
|
||||
# Number of spaces of indent required inside a hanging or continued line.
|
||||
indent-after-paren=4
|
||||
|
||||
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
|
||||
# tab).
|
||||
indent-string=' '
|
||||
|
||||
# Maximum number of characters on a single line.
|
||||
max-line-length=160
|
||||
|
||||
# Maximum number of lines in a module.
|
||||
max-module-lines=1000
|
||||
|
||||
# Allow the body of a class to be on the same line as the declaration if body
|
||||
# contains single statement.
|
||||
single-line-class-stmt=no
|
||||
|
||||
# Allow the body of an if to be on the same line as the test if there is no
|
||||
# else.
|
||||
single-line-if-stmt=no
|
||||
|
||||
|
||||
[IMPORTS]
|
||||
|
||||
# List of modules that can be imported at any level, not just the top level
|
||||
# one.
|
||||
allow-any-import-level=
|
||||
|
||||
# Allow explicit reexports by alias from a package __init__.
|
||||
allow-reexport-from-package=no
|
||||
|
||||
# Allow wildcard imports from modules that define __all__.
|
||||
allow-wildcard-with-all=no
|
||||
|
||||
# Deprecated modules which should not be used, separated by a comma.
|
||||
deprecated-modules=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of external dependencies
|
||||
# to the given file (report RP0402 must not be disabled).
|
||||
ext-import-graph=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of all (i.e. internal and
|
||||
# external) dependencies to the given file (report RP0402 must not be
|
||||
# disabled).
|
||||
import-graph=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of internal dependencies
|
||||
# to the given file (report RP0402 must not be disabled).
|
||||
int-import-graph=
|
||||
|
||||
# Force import order to recognize a module as part of the standard
|
||||
# compatibility libraries.
|
||||
known-standard-library=
|
||||
|
||||
# Force import order to recognize a module as part of a third party library.
|
||||
known-third-party=enchant
|
||||
|
||||
# Couples of modules and preferred modules, separated by a comma.
|
||||
preferred-modules=
|
||||
|
||||
|
||||
[LOGGING]
|
||||
|
||||
# The type of string formatting that logging methods do. `old` means using %
|
||||
# formatting, `new` is for `{}` formatting.
|
||||
logging-format-style=old
|
||||
|
||||
# Logging modules to check that the string format arguments are in logging
|
||||
# function parameter format.
|
||||
logging-modules=logging
|
||||
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
|
||||
# UNDEFINED.
|
||||
confidence=HIGH,
|
||||
CONTROL_FLOW,
|
||||
INFERENCE,
|
||||
INFERENCE_FAILURE,
|
||||
UNDEFINED
|
||||
|
||||
# Disable the message, report, category or checker with the given id(s). You
|
||||
# can either give multiple identifiers separated by comma (,) or put this
|
||||
# option multiple times (only on the command line, not in the configuration
|
||||
# file where it should appear only once). You can also use "--disable=all" to
|
||||
# disable everything first and then re-enable specific checks. For example, if
|
||||
# you want to run only the similarities checker, you can use "--disable=all
|
||||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use "--disable=all --enable=classes
|
||||
# --disable=W".
|
||||
disable=raw-checker-failed,
|
||||
bad-inline-option,
|
||||
locally-disabled,
|
||||
file-ignored,
|
||||
suppressed-message,
|
||||
useless-suppression,
|
||||
deprecated-pragma,
|
||||
use-symbolic-message-instead,
|
||||
missing-function-docstring, # Modified since here, include this line
|
||||
missing-class-docstring,
|
||||
missing-module-docstring,
|
||||
wrong-import-order,
|
||||
invalid-name,
|
||||
too-few-public-methods,
|
||||
too-many-locals,
|
||||
ungrouped-imports, # since we have isort in pre-commit
|
||||
no-name-in-module, # since we have flake8 to check this
|
||||
too-many-instance-attributes,
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
# multiple time (only on the command line, not in the configuration file where
|
||||
# it should appear only once). See also the "--disable" option for examples.
|
||||
enable=c-extension-no-member
|
||||
|
||||
|
||||
[METHOD_ARGS]
|
||||
|
||||
# List of qualified names (i.e., library.method) which require a timeout
|
||||
# parameter e.g. 'requests.api.get,requests.api.post'
|
||||
timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request
|
||||
|
||||
|
||||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=FIXME,
|
||||
XXX,
|
||||
TODO
|
||||
|
||||
# Regular expression of note tags to take in consideration.
|
||||
notes-rgx=
|
||||
|
||||
|
||||
[REFACTORING]
|
||||
|
||||
# Maximum number of nested blocks for function / method body
|
||||
max-nested-blocks=5
|
||||
|
||||
# Complete name of functions that never returns. When checking for
|
||||
# inconsistent-return-statements if a never returning function is called then
|
||||
# it will be considered as an explicit return statement and no message will be
|
||||
# printed.
|
||||
never-returning-functions=sys.exit,argparse.parse_error
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
# Python expression which should return a score less than or equal to 10. You
|
||||
# have access to the variables 'fatal', 'error', 'warning', 'refactor',
|
||||
# 'convention', and 'info' which contain the number of messages in each
|
||||
# category, as well as 'statement' which is the total number of statements
|
||||
# analyzed. This score is used by the global evaluation report (RP0004).
|
||||
evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
|
||||
|
||||
# Template used to display messages. This is a python new-style format string
|
||||
# used to format the message information. See doc for all details.
|
||||
msg-template=
|
||||
|
||||
# Set the output format. Available formats are text, parseable, colorized, json
|
||||
# and msvs (visual studio). You can also give a reporter class, e.g.
|
||||
# mypackage.mymodule.MyReporterClass.
|
||||
#output-format=
|
||||
|
||||
# Tells whether to display a full report or only the messages.
|
||||
reports=no
|
||||
|
||||
# Activate the evaluation score.
|
||||
score=yes
|
||||
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
# Comments are removed from the similarity computation
|
||||
ignore-comments=yes
|
||||
|
||||
# Docstrings are removed from the similarity computation
|
||||
ignore-docstrings=yes
|
||||
|
||||
# Imports are removed from the similarity computation
|
||||
ignore-imports=yes
|
||||
|
||||
# Signatures are removed from the similarity computation
|
||||
ignore-signatures=yes
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
||||
|
||||
[SPELLING]
|
||||
|
||||
# Limits count of emitted suggestions for spelling mistakes.
|
||||
max-spelling-suggestions=4
|
||||
|
||||
# Spelling dictionary name. No available dictionaries : You need to install
|
||||
# both the python package and the system dependency for enchant to work..
|
||||
spelling-dict=
|
||||
|
||||
# List of comma separated words that should be considered directives if they
|
||||
# appear at the beginning of a comment and should not be checked.
|
||||
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
|
||||
|
||||
# List of comma separated words that should not be checked.
|
||||
spelling-ignore-words=
|
||||
|
||||
# A path to a file that contains the private dictionary; one word per line.
|
||||
spelling-private-dict-file=
|
||||
|
||||
# Tells whether to store unknown words to the private dictionary (see the
|
||||
# --spelling-private-dict-file option) instead of raising a message.
|
||||
spelling-store-unknown-words=no
|
||||
|
||||
|
||||
[STRING]
|
||||
|
||||
# This flag controls whether inconsistent-quotes generates a warning when the
|
||||
# character used as a quote delimiter is used inconsistently within a module.
|
||||
check-quote-consistency=no
|
||||
|
||||
# This flag controls whether the implicit-str-concat should generate a warning
|
||||
# on implicit string concatenation in sequences defined over several lines.
|
||||
check-str-concat-over-line-jumps=no
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# List of decorators that produce context managers, such as
|
||||
# contextlib.contextmanager. Add to this list to register other decorators that
|
||||
# produce valid context managers.
|
||||
contextmanager-decorators=contextlib.contextmanager
|
||||
|
||||
# List of members which are set dynamically and missed by pylint inference
|
||||
# system, and so shouldn't trigger E1101 when accessed. Python regular
|
||||
# expressions are accepted.
|
||||
generated-members=
|
||||
|
||||
# Tells whether to warn about missing members when the owner of the attribute
|
||||
# is inferred to be None.
|
||||
ignore-none=yes
|
||||
|
||||
# This flag controls whether pylint should warn about no-member and similar
|
||||
# checks whenever an opaque object is returned when inferring. The inference
|
||||
# can return multiple potential results while evaluating a Python object, but
|
||||
# some branches might not be evaluated, which results in partial inference. In
|
||||
# that case, it might be useful to still emit no-member and other checks for
|
||||
# the rest of the inferred objects.
|
||||
ignore-on-opaque-inference=yes
|
||||
|
||||
# List of symbolic message names to ignore for Mixin members.
|
||||
ignored-checks-for-mixins=no-member,
|
||||
not-async-context-manager,
|
||||
not-context-manager,
|
||||
attribute-defined-outside-init
|
||||
|
||||
# List of class names for which member attributes should not be checked (useful
|
||||
# for classes with dynamically set attributes). This supports the use of
|
||||
# qualified names.
|
||||
ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
|
||||
|
||||
# Show a hint with possible names when a member name was not found. The aspect
|
||||
# of finding the hint is based on edit distance.
|
||||
missing-member-hint=yes
|
||||
|
||||
# The minimum edit distance a name should have in order to be considered a
|
||||
# similar match for a missing member name.
|
||||
missing-member-hint-distance=1
|
||||
|
||||
# The total number of similar names that should be taken in consideration when
|
||||
# showing a hint for a missing member.
|
||||
missing-member-max-choices=1
|
||||
|
||||
# Regex pattern to define which classes are considered mixins.
|
||||
mixin-class-rgx=.*[Mm]ixin
|
||||
|
||||
# List of decorators that change the signature of a decorated function.
|
||||
signature-mutators=
|
||||
|
||||
|
||||
[VARIABLES]
|
||||
|
||||
# List of additional names supposed to be defined in builtins. Remember that
|
||||
# you should avoid defining new builtins when possible.
|
||||
additional-builtins=
|
||||
|
||||
# Tells whether unused global variables should be treated as a violation.
|
||||
allow-global-unused-variables=yes
|
||||
|
||||
# List of names allowed to shadow builtins
|
||||
allowed-redefined-builtins=
|
||||
|
||||
# List of strings which can identify a callback function by name. A callback
|
||||
# name must start or end with one of those strings.
|
||||
callbacks=cb_,
|
||||
_cb
|
||||
|
||||
# A regular expression matching the name of dummy variables (i.e. expected to
|
||||
# not be used).
|
||||
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
|
||||
|
||||
# Argument names that match this expression will be ignored.
|
||||
ignored-argument-names=_.*|^ignored_|^unused_
|
||||
|
||||
# Tells whether we should check for unused import in __init__ files.
|
||||
init-import=no
|
||||
|
||||
# List of qualified module names which can have objects that can redefine
|
||||
# builtins.
|
||||
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
|
||||
@@ -15,7 +15,7 @@ python:
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
|
||||
# We need to list all the submodules included in documentation build by Doxygen
|
||||
# We need to list all the submodules included in documenation build by Doxygen
|
||||
submodules:
|
||||
include:
|
||||
- components/mqtt/esp-mqtt
|
||||
|
||||
@@ -13,38 +13,7 @@ endif()
|
||||
# Add the following build specifications here, since these seem to be dependent
|
||||
# on config values on the root Kconfig.
|
||||
|
||||
if(BOOTLOADER_BUILD)
|
||||
|
||||
if(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
list(APPEND compile_options "-Oz")
|
||||
else()
|
||||
list(APPEND compile_options "-Os")
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||
list(APPEND compile_options "-freorder-blocks")
|
||||
endif()
|
||||
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG)
|
||||
list(APPEND compile_options "-Og")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CONFIG_IDF_TARGET_LINUX)
|
||||
list(APPEND compile_options "-fno-shrink-wrap") # Disable shrink-wrapping to reduce binary size
|
||||
endif()
|
||||
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE)
|
||||
list(APPEND compile_options "-O0")
|
||||
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF)
|
||||
list(APPEND compile_options "-O2")
|
||||
endif()
|
||||
|
||||
elseif(ESP_TEE_BUILD)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
list(APPEND compile_options "-Oz")
|
||||
else()
|
||||
list(APPEND compile_options "-Os")
|
||||
list(APPEND compile_options "-freorder-blocks")
|
||||
endif()
|
||||
|
||||
else()
|
||||
if(NOT BOOTLOADER_BUILD)
|
||||
|
||||
if(CONFIG_COMPILER_OPTIMIZATION_SIZE)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
@@ -66,6 +35,28 @@ else()
|
||||
list(APPEND compile_options "-O2")
|
||||
endif()
|
||||
|
||||
else() # BOOTLOADER_BUILD
|
||||
|
||||
if(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
list(APPEND compile_options "-Oz")
|
||||
else()
|
||||
list(APPEND compile_options "-Os")
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||
list(APPEND compile_options "-freorder-blocks")
|
||||
endif()
|
||||
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG)
|
||||
list(APPEND compile_options "-Og")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CONFIG_IDF_TARGET_LINUX)
|
||||
list(APPEND compile_options "-fno-shrink-wrap") # Disable shrink-wrapping to reduce binary size
|
||||
endif()
|
||||
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE)
|
||||
list(APPEND compile_options "-O0")
|
||||
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF)
|
||||
list(APPEND compile_options "-O2")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if(CONFIG_COMPILER_CXX_EXCEPTIONS)
|
||||
@@ -207,13 +198,6 @@ if(CONFIG_ESP_SYSTEM_USE_EH_FRAME)
|
||||
list(APPEND link_options "-Wl,--eh-frame-hdr")
|
||||
endif()
|
||||
|
||||
if(CONFIG_ESP_SYSTEM_USE_FRAME_POINTER)
|
||||
list(APPEND compile_options "-fno-omit-frame-pointer")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||
list(APPEND compile_options "-mno-omit-leaf-frame-pointer")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND link_options "-fno-lto")
|
||||
|
||||
if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
|
||||
|
||||
@@ -8,9 +8,9 @@ This document describes the compatibility between ESP-IDF releases and Espressif
|
||||
|
||||
NOTE: This document on release branches may be out-of-date. Check the [Compatibility file on master](https://github.com/espressif/esp-idf/blob/master/COMPATIBILITY.md) for the most accurate information.
|
||||
|
||||
See [Compatibility Advisory for Chip Revision Numbering Scheme](https://www.espressif.com/sites/default/files/advisory_downloads/AR2022-005%20Compatibility%20Advisory%20for%20Chip%20Revision%20Numbering%20%20Scheme.pdf) on the versioning of Espressif SoC revisions.
|
||||
See [Compatibility Advisory for Chip Revision Numbering Scheme](https://www.espressif.com.cn/sites/default/files/advisory_downloads/AR2022-005%20Compatibility%20Advisory%20for%20Chip%20Revision%20Numbering%20%20Scheme.pdf) on the versioning of Espressif SoC revisions.
|
||||
|
||||
You can run `esptool chip_id` to detect the series and revision of an SoC. See [SoC Errata](https://www.espressif.com/en/support/documents/technical-documents?keys=errata) for more on how to distinguish between chip revisions, and the improvements provided by chip revisions. And run `idf.py --version` to know the version of current ESP-IDF.
|
||||
You can run `esptool chip_id` to detect the series and revision of an SoC. See [SoC Errata](https://www.espressif.com.cn/en/support/documents/technical-documents?keys=errata) for more on how to distinguish between chip revisions, and the improvements provided by chip revisions. And run `idf.py --version` to know the version of current ESP-IDF.
|
||||
|
||||
## ESP-IDF Support for Different Chip Revisions
|
||||
|
||||
@@ -97,49 +97,18 @@ Supported since ESP-IDF v5.0.
|
||||
| release/v5.2 | v5.2.2+ | v5.2 |
|
||||
| release/v5.3 and above | v5.3+ | v5.3 |
|
||||
|
||||
#### v2.0
|
||||
|
||||
| Release branch | Recommended | Required |
|
||||
|------------------------|-------------|----------|
|
||||
| release/v5.0 | v5.0.8+ | v5.0.8 |
|
||||
| release/v5.1 | v5.1.5+ | v5.1.5* |
|
||||
| release/v5.2 | v5.2.4+ | v5.2.4 |
|
||||
| release/v5.3 | v5.3.2+ | v5.3.2* |
|
||||
| release/v5.4 and above | v5.4+ | v5.4 |
|
||||
|
||||
Note: IDF v5.1.5 and v5.3.2 are compatible with C2 v2.0. However the chip revision check hasn't been updated on these releases. Enable `ESP32C2_REV2_DEVELOPMENT` config to bypass the outdated check.
|
||||
|
||||
### ESP32-C6
|
||||
|
||||
#### v0.0, v0.1
|
||||
|
||||
Supported since ESP-IDF v5.1.
|
||||
|
||||
#### v0.2
|
||||
|
||||
| Release branch | Recommended | Required |
|
||||
|------------------------|-------------|----------|
|
||||
| release/v5.1 | v5.1.5+ | v5.1 |
|
||||
| release/v5.2 | v5.2.4+ | v5.2 |
|
||||
| release/v5.3 | v5.3.2+ | v5.3 |
|
||||
| release/v5.4 and above | v5.4+ | v5.4 |
|
||||
|
||||
### ESP32-H2
|
||||
|
||||
#### v0.1, v0.2
|
||||
|
||||
Supported since ESP-IDF v5.1.
|
||||
|
||||
#### v1.2
|
||||
|
||||
| Release branch | Recommended | Required |
|
||||
|------------------------|-------------|----------|
|
||||
| release/v5.1 | v5.1.6+ | v5.1.6 |
|
||||
| release/v5.2 | v5.2.5+ | v5.2.5 |
|
||||
| release/v5.3 | v5.3.3+ | v5.3.3 |
|
||||
| release/v5.4 | v5.4.1+ | v5.4.1 |
|
||||
| release/v5.5 and above | v5.5+ | v5.5 |
|
||||
|
||||
## What If the ESP-IDF Version Is Lower than the `Required` Version?
|
||||
|
||||
Latest ESP-IDF versions can prevent from downloading to, or even execute binaries on unsupported chips. ESP-IDF of versions v4.4.5+, v5.0.1+, v5.1 and above have both esptool download check and bootloader loading check against the chip revision. While ESP-IDF v4.3.5 has only esptool downloading check.
|
||||
|
||||
@@ -97,49 +97,18 @@
|
||||
| release/v5.2 | v5.2.2+ | v5.1 |
|
||||
| release/v5.3 及以上 | v5.3+ | v5.3 |
|
||||
|
||||
#### v2.0
|
||||
|
||||
| 发布分支 | 推荐版本 | 需求版本 |
|
||||
|------------------------|-------------|----------|
|
||||
| release/v5.0 | v5.0.8+ | v5.0.8 |
|
||||
| release/v5.1 | v5.1.5+ | v5.1.5* |
|
||||
| release/v5.2 | v5.2.4+ | v5.2.4 |
|
||||
| release/v5.3 | v5.3.2+ | v5.3.2* |
|
||||
| release/v5.4 及以上 | v5.4+ | v5.4 |
|
||||
|
||||
提示: IDF v5.1.5 及 v5.3.2 与 C2 v2.0 兼容,但芯片版本检查尚未在这些发布版本更新。使能 `ESP32C2_REV2_DEVELOPMENT` 选项来跳过这些过时的检查。
|
||||
|
||||
### ESP32-C6
|
||||
|
||||
#### v0.0, v0.1
|
||||
|
||||
从 ESP-IDF v5.1 开始支持。
|
||||
|
||||
#### v0.2
|
||||
|
||||
| 发布分支 | 推荐版本 | 需求版本 |
|
||||
|------------------------|-------------|----------|
|
||||
| release/v5.1 | v5.1.5+ | v5.1 |
|
||||
| release/v5.2 | v5.2.4+ | v5.2 |
|
||||
| release/v5.3 | v5.3.2+ | v5.3 |
|
||||
| release/v5.4 及以上 | v5.4+ | v5.4 |
|
||||
|
||||
### ESP32-H2
|
||||
|
||||
#### v0.1, v0.2
|
||||
|
||||
从 ESP-IDF v5.1 开始支持。
|
||||
|
||||
#### v1.2
|
||||
|
||||
| 发布分支 | 推荐版本 | 需求版本 |
|
||||
|------------------------|-------------|----------|
|
||||
| release/v5.1 | v5.1.6+ | v5.1.6 |
|
||||
| release/v5.2 | v5.2.5+ | v5.2.5 |
|
||||
| release/v5.3 | v5.3.3+ | v5.3.3 |
|
||||
| release/v5.4 | v5.4.1+ | v5.4.1 |
|
||||
| release/v5.5 及以上 | v5.5+ | v5.5 |
|
||||
|
||||
|
||||
## 如果 ESP-IDF 版本低于 `需求版本` 会出现什么情况?
|
||||
|
||||
|
||||
33
Kconfig
33
Kconfig
@@ -136,20 +136,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
select FREERTOS_UNICORE
|
||||
select IDF_TARGET_ARCH_RISCV
|
||||
|
||||
config IDF_TARGET_ESP32H21
|
||||
bool
|
||||
default "y" if IDF_TARGET="esp32h21"
|
||||
select FREERTOS_UNICORE
|
||||
select IDF_TARGET_ARCH_RISCV
|
||||
select IDF_ENV_BRINGUP
|
||||
|
||||
config IDF_TARGET_ESP32H4
|
||||
bool
|
||||
default "y" if IDF_TARGET="esp32h4"
|
||||
select IDF_TARGET_ARCH_RISCV
|
||||
select IDF_ENV_FPGA
|
||||
select IDF_ENV_BRINGUP
|
||||
|
||||
config IDF_TARGET_LINUX
|
||||
bool
|
||||
default "y" if IDF_TARGET="linux"
|
||||
@@ -166,8 +152,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
default 0x0012 if IDF_TARGET_ESP32P4
|
||||
default 0x0017 if IDF_TARGET_ESP32C5
|
||||
default 0x0014 if IDF_TARGET_ESP32C61
|
||||
default 0x0019 if IDF_TARGET_ESP32H21
|
||||
default 0x001C if IDF_TARGET_ESP32H4
|
||||
default 0xFFFF
|
||||
|
||||
|
||||
@@ -646,7 +630,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
|
||||
choice COMPILER_ORPHAN_SECTIONS
|
||||
prompt "Orphan sections handling"
|
||||
default COMPILER_ORPHAN_SECTIONS_ERROR
|
||||
default COMPILER_ORPHAN_SECTIONS_WARNING
|
||||
depends on !IDF_TARGET_LINUX
|
||||
help
|
||||
If the linker finds orphan sections, it attempts to place orphan sections after sections of the same
|
||||
@@ -654,11 +638,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
That means that orphan sections could placed between sections defined in IDF linker scripts.
|
||||
This could lead to corruption of the binary image. Configure the linker action here.
|
||||
|
||||
config COMPILER_ORPHAN_SECTIONS_ERROR
|
||||
bool "Fail if orphan sections found"
|
||||
help
|
||||
Fails the link step with an error if orphan sections are detected.
|
||||
|
||||
config COMPILER_ORPHAN_SECTIONS_WARNING
|
||||
bool "Place with warning"
|
||||
help
|
||||
@@ -680,13 +659,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
endmenu # Compiler Options
|
||||
|
||||
menu "Component config"
|
||||
comment "!!! MINIMAL_BUILD is enabled !!!"
|
||||
depends on "${IDF_MINIMAL_BUILD}"
|
||||
comment "Only common components and those transitively required by the main component are listed"
|
||||
depends on "${IDF_MINIMAL_BUILD}"
|
||||
comment "If a component configuration is missing, please add it to the main component's requirements"
|
||||
depends on "${IDF_MINIMAL_BUILD}"
|
||||
|
||||
source "$COMPONENT_KCONFIGS_SOURCE_FILE"
|
||||
endmenu
|
||||
|
||||
@@ -706,6 +678,5 @@ mainmenu "Espressif IoT Development Framework Configuration"
|
||||
- CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
|
||||
- CONFIG_ESP_WIFI_EAP_TLS1_3
|
||||
- CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
|
||||
- CONFIG_USB_HOST_EXT_PORT_SUPPORT_LS
|
||||
- CONFIG_USB_HOST_EXT_PORT_RESET_ATTEMPTS
|
||||
- CONFIG_LIBC_PICOLIBC
|
||||
- CONFIG_GDMA_ENABLE_WEIGHTED_ARBITRATION
|
||||
|
||||
145
ROADMAP.md
145
ROADMAP.md
@@ -1,6 +1,4 @@
|
||||
# ESP-IDF Project Roadmap 2025
|
||||
|
||||
* [中文版](./ROADMAP_CN.md)
|
||||
# ESP-IDF Project Roadmap 2024
|
||||
|
||||
This document outlines the goals of ESP-IDF project and is shared for the convenience of our customers. It is important to clarify that this document is not a binding commitment to our customers. Instead, its primary purpose is to offer a clear roadmap and direction for the project's development. By openly sharing this information, we aim to enhance our customers' understanding, promote transparency and ensure alignment with the overarching objectives of the ESP-IDF project.
|
||||
|
||||
@@ -12,28 +10,32 @@ In both minor and major releases, we integrate new chip support to enhance our p
|
||||
|
||||
Furthermore, we prioritize bugfix releases for active branches, focusing on improving the stability and performance of products already in production. By addressing bugs promptly, we aim to enhance the overall user experience and provide tangible benefits to customers relying on our solutions. This proactive maintenance strategy reflects our commitment to delivering reliable, high-quality products to our valued customer base.
|
||||
|
||||
Below are the main objectives that ESP-IDF project/teams would like to implement in 2025.
|
||||
Below are the main objectives that ESP-IDF project/teams would like to implement in 2024.
|
||||
|
||||
- New Chip Support
|
||||
|
||||
- Add support for ESP32-P4
|
||||
- Add support for ESP32-C5
|
||||
- Add support for ESP32-C61
|
||||
|
||||
- More Minor/Major Releases
|
||||
- More Minor Releases
|
||||
|
||||
- Release IDF v5.5 in the middle of 2025
|
||||
- Release IDF v6.0 at the end of 2025
|
||||
- Release IDF v5.3 in 2024
|
||||
- Release IDF v5.4 at the start of 2025
|
||||
|
||||
- More Bugfix Releases
|
||||
|
||||
- Release v5.0.8 and v5.0.9 before ESP-IDF v5.0 goes End of Life in May 2025
|
||||
- Release v5.1.6 and v5.1.7 before ESP-IDF v5.1 goes End of Life in December 2025
|
||||
- Do more bugfix releases for IDF v5.2 and IDF v5.3 before release/5.2 and release/5.3 enter maintenance period
|
||||
- Do more bug fixes releases for release/5.4 and release/5.5, and push the two releases to be more stable and production-ready
|
||||
- Release v4.4.8 for IDF v4.4 before ESP-IDF v4.4 goes End of Life in July 2024
|
||||
- Do more bugfix releases for IDF v5.1 before release/5.1 enters maintenance period in June 2024
|
||||
- Do more bug fixes releases for release/5.2 and release/5.3, and push the two releases to be more stable and production-ready
|
||||
|
||||
- Major Changes
|
||||
- Updates of Libraries
|
||||
|
||||
- We plan to upgrade MbedTLS to v4.x series in IDF v6.0. In addition, we will also be migrating to newer PSA crypto API as part of this upgrade. Please note that this may involve some breaking changes on the application side for the crypto API usage.
|
||||
- Update GDB to 14.2
|
||||
- Update LLVM to 18.1.2
|
||||
- Update MbedTLS to 3.6 (LTS)
|
||||
- Update LWIP to 2.2.0
|
||||
- Change minimal Python requirement to 3.9
|
||||
|
||||
Please note that support status of previous silicones could be found on [ESP-IDF Release and SoC Compatibility](https://github.com/espressif/esp-idf#esp-idf-release-and-soc-compatibility).
|
||||
|
||||
@@ -47,84 +49,75 @@ Below are the main roadmap details for functional areas inside ESP-IDF.
|
||||
|
||||
- New Chip Support
|
||||
|
||||
- Add the initial support for the mass production version of ESP32-C5 in ESP-IDF v5.5, refer to [ESP32-C5 Support Status](https://github.com/espressif/esp-idf/issues/14021)
|
||||
- Add the initial support for the mass production version of ESP32-C61 in ESP-IDF v5.5, refer to [ESP32-C61 Support Status](https://developer.espressif.com/pages/chip-support-status/esp32c61/#esp-idf)
|
||||
- Add full support for ESP32-P4 in ESP-IDF v5.3, refer to [ESP32-P4 Support Status](https://github.com/espressif/esp-idf/issues/12996)
|
||||
- Add preview support for ESP32-C5 in ESP-IDF v5.3 and full support for ESP32-C5 in ESP-IDF v5.4, refer to [ESP32-C5 Support Status](https://github.com/espressif/esp-idf/issues/14021)
|
||||
- Add preview support for the early samples of ESP32-C61 in ESP-IDF v5.4 and full support for mass production version in ESP-IDF v5.4.x. Refer to [ESP32-C61 Support Status](https://developer.espressif.com/pages/chip-support-status/esp32c61/#esp-idf)
|
||||
|
||||
- Bugfix releases
|
||||
|
||||
- Do bugfix releases v5.0.8 and v5.0.9 and stop maintaining ESP-IDF v5.0 in May 2025
|
||||
- Do bugfix releases v5.1.6 and v5.1.7 and stop maintaining ESP-IDF v5.1 in December 2025
|
||||
- Release bugfix IDF v5.2.4, IDF v5.2.5 and IDF v5.2.6 in 2025, and push release/5.2 to maintenance period from February 2025
|
||||
- Release bugfix IDF v5.3.3 and IDF v5.3.4 in 2025, and push release/5.3 to maintenance period from July 2025
|
||||
- Do more bug fixes releases for release/5.4 (IDF v5.4.1, IDF v5.4.2, IDF v5.4.3) and release/5.5 (IDF v5.5.1, IDF v5.5.2), and push releases to be more stable and more production-ready
|
||||
- Do bugfix release IDF v4.4.8 and stop maintaining ESP-IDF v4.4 in July 2024
|
||||
- Release bugfix IDF v5.0.6 and IDF v5.0.7 in 2024 (maintenance period)
|
||||
- Release bugfix IDF v5.1.3 and IDF v5.1.4 in H1 of 2024, and release IDF v5.1.5 in H2 of 2024
|
||||
- Push release/5.1 to maintenance period from June 2024
|
||||
- Do more bug fixes releases for release/5.2 (IDF v5.2.1, IDF v5.2.2, IDF v5.2.3) and release/5.3 (IDF v5.3.1, IDF v5.3.2), and push releases to be more stable and more production-ready
|
||||
|
||||
## ESP-IDF Planning information
|
||||
|
||||
For the full list of ESP-IDF releases, please visit https://github.com/espressif/esp-idf/releases
|
||||
|
||||
All the information provided here is subject to change without notice, due to business reasons and other factors.
|
||||
|
||||
### ESP-IDF Major Releases
|
||||
|
||||
```mermaid
|
||||
timeline
|
||||
No Major Releases planned
|
||||
|
||||
title ESP-IDF Major Releases
|
||||
section 2025 Q1 <br> Major Release Planning
|
||||
No version planned : N/A
|
||||
section 2025 Q2 <br> Major Release Planning
|
||||
No version planned : N/A
|
||||
section 2025 Q3 <br> Major Release Planning
|
||||
No version planned : N/A
|
||||
section 2025 Q4 <br> Major Release Planning
|
||||
v6.0-beta1 : 2025/11/13
|
||||
v6.0-beta2 : 2025/12/05
|
||||
v6.0-RC1 : 2026/01/14
|
||||
v6.0-RC2 : 2026/02/06
|
||||
v6.0 : 2026/02/13
|
||||
```
|
||||
|
||||
### ESP-IDF Minor Releases
|
||||
|
||||
```mermaid
|
||||
timeline
|
||||
#### Quarter One
|
||||
|
||||
title ESP-IDF Minor Releases
|
||||
section 2025 Q1 <br> Minor Release Planning
|
||||
No version planned : N/A
|
||||
section 2025 Q2 <br> Minor Release Planning
|
||||
v5.5-beta1 : 2025/05/14
|
||||
v5.5-beta2 : 2025/06/04
|
||||
section 2025 Q3 <br> Minor Release Planning
|
||||
v5.5-RC1 : 2025/07/07
|
||||
v5.5-RC2 : 2025/07/28
|
||||
v5.5 : 2025/08/04
|
||||
section 2025 Q4 <br> Minor Release Planning
|
||||
No version planned : N/A
|
||||
```
|
||||
- v5.2-RC1, estimate release date: 2024/02/02
|
||||
- v5.2 final release, estimate release date: 2024/02/08
|
||||
|
||||
#### Quarter Two
|
||||
|
||||
- v5.3-beta1, estimate release date:: 2024/05/13
|
||||
- v5.3-beta2, estimate release date:: 2024/05/31
|
||||
- v5.3-RC1, estimate release date:: 2024/07/08
|
||||
|
||||
#### Quarter Three
|
||||
|
||||
- v5.3-RC2, estimate release date:: 2024/07/26
|
||||
- v5.3 final release, estimate release date:: 2024/08/02
|
||||
|
||||
#### Quarter Four
|
||||
|
||||
- v5.4-beta1, estimate release date:: 2024/11/08
|
||||
- v5.4-beta2, estimate release date:: 2024/11/29
|
||||
- v5.4-RC1, estimate release date:: 2025/01/09
|
||||
- v5.4-RC2, estimate release date:: 2025/01/29
|
||||
- v5.4 final release, estimate release date: 2025/02/05
|
||||
|
||||
### ESP-IDF Bugfix Releases
|
||||
|
||||
```mermaid
|
||||
timeline
|
||||
#### Quarter One
|
||||
|
||||
title ESP-IDF Bugfix Releases
|
||||
section 2025 Q1 <br> Bugfix Release Planning
|
||||
v5.0.8 : 2025/01/14
|
||||
v5.1.6 : 2025/02/18
|
||||
v5.2.4 : 2025/02/23
|
||||
v5.2.5 : 2025/02/28
|
||||
v5.4.1 : 2025/03/27
|
||||
v5.3.3 : 2025/04/04
|
||||
section 2025 Q2 <br> Bugfix Release Planning
|
||||
v5.0.9 : 2025/05/16
|
||||
v5.4.2 : 2025/06/30
|
||||
section 2025 Q3 <br> Bugfix Release Planning
|
||||
v5.3.4 : 2025/08/03
|
||||
v5.2.6 : 2025/09/04
|
||||
v5.5.1 : 2025/09/11
|
||||
v5.4.3 : 2025/10/08
|
||||
section 2025 Q4 <br> Bugfix Release Planning
|
||||
v5.5.2 : 2025/11/12
|
||||
v5.1.7 : 2026/01/06
|
||||
```
|
||||
- v5.1.3, estimate release date: 2024/02/08
|
||||
- v5.0.6, estimate release date: 2024/02/18
|
||||
- v4.4.7, estimate release date:: 2024/03/19
|
||||
- v5.2.1, estimate release date:: 2024/03/31
|
||||
|
||||
#### Quarter Two
|
||||
|
||||
- v5.1.4, estimate release date:: 2024/05/06
|
||||
- v5.2.2, estimate release date:: 2024/06/17
|
||||
- v4.4.8, estimate release date:: 2024/07/19
|
||||
|
||||
#### Quarter Three
|
||||
|
||||
- v5.0.7, estimate release date: 2024/08/22
|
||||
- v5.3.1, estimate release date: 2024/09/16
|
||||
- v5.2.3, estimate release date: 2024/10/10
|
||||
|
||||
#### Quarter Four
|
||||
|
||||
- v5.1.5, estimate release date: 2024/11/04 (Maintenance period since June 2024)
|
||||
- v5.3.2, estimate release date: 2024/12/31
|
||||
- v5.2.4, estimate release date: 2025/02/20 (Service period ends Feb. 2025)
|
||||
|
||||
147
ROADMAP_CN.md
147
ROADMAP_CN.md
@@ -1,6 +1,4 @@
|
||||
# ESP-IDF 项目路线图 2025
|
||||
|
||||
* [English Version](./ROADMAP.md)
|
||||
# ESP-IDF 项目路线图 2024 (v1.0)
|
||||
|
||||
本文档概述了 ESP-IDF 项目的年度计划,方便客户据此规划自己的项目周期。需要说明的是该文档并不是我们对客户的约束性承诺。相反,其主要目的是为客户提供 ESP-IDF 项目开发的路线图和方向。通过公开这些信息,我们希望增进客户对 ESP-IDF 项目的理解,提高透明度,并确保与 ESP-IDF 项目的总体目标保持一致。
|
||||
|
||||
@@ -12,28 +10,32 @@
|
||||
|
||||
此外,ESP-IDF 各活跃分支的 Bugfix 版本发布也是我们项目的重中之重,着力提升已量产产品的稳定性和性能。通过及时解决问题,我们期待提升用户的整体体验,切实惠及使用乐鑫解决方案的客户。通过积极维护 ESP-IDF 的各活跃分支,我们践行了对宝贵的客户群提供可靠、高质量产品的承诺。
|
||||
|
||||
以下是 ESP-IDF 项目在 2025 年计划实现的主要目标。
|
||||
以下是 ESP-IDF 项目在 2024 年计划实现的主要目标。
|
||||
|
||||
* 新芯片支持
|
||||
|
||||
* 增加对 ESP32-P4 芯片的支持
|
||||
* 增加对 ESP32-C5 芯片的支持
|
||||
* 增加对 ESP32-C61 芯片的支持
|
||||
|
||||
* 发布更多的次要和主要版本
|
||||
* 发布更多的次要版本
|
||||
|
||||
* 在 2025 年中发布 IDF v5.5
|
||||
* 在 2025 年底发布 IDF v6.0
|
||||
* 在 2024 年发布 IDF v5.3
|
||||
* 在 2025 年初发布 IDF v5.4
|
||||
|
||||
* 发布更多 bugfix 版本
|
||||
* 发布更多 Bugfix 版本
|
||||
|
||||
* 在 2025 年 5 月底 IDF v5.0 停止维护之前,发布 IDF v5.0.8 和 IDF v5.0.9
|
||||
* 在 2025 年 12 月底 IDF v5.1 停止维护之前,发布 IDF v5.1.6 和 IDF v5.1.7
|
||||
* 在 release/5.2 分支和 release/5.3 分支进入维护周期之前,发布更多 bugfix 版本
|
||||
* release/5.4 分支和 release/5.5 分支发布更多 bugfix 版本,使这两个分支更加稳定和产品化
|
||||
* 在 2024 年 7 月底 IDF v4.4 停止维护之前,发布 IDF v4.4.8
|
||||
* 在 2024 年 6 月底,release/5.1 分支进入维护周期之前,发布更多 Bugfix 版本
|
||||
* release/5.2 分支和 release/5.3 分支发布更多 Bugfix 版本,使这两个分支更加稳定和产品化
|
||||
|
||||
* 重大变更
|
||||
* 上游库与工具链的更新
|
||||
|
||||
* 我们计划在 IDF v6.0 中将 MbedTLS 版本升级到 v4.x。另外,我们还会在升级中迁移到更新版的 PSA 加密 API,但请注意,这可能会导致应用程序端在使用加密 API 时出现一些非兼容性更新。
|
||||
* 将 GDB 升级至 14.2
|
||||
* 将 LLVM 升级至 18.1.2
|
||||
* 更新 MbedTLS 至 3.6(LTS)
|
||||
* 更新 LWIP 至 2.2.0
|
||||
* 将最低 Python 要求更改为 3.9
|
||||
|
||||
请注意,获取之前芯片的支持状态,请参阅 [ESP-IDF 发布和 SoC 兼容性](https://github.com/espressif/esp-idf/blob/master/README_CN.md#esp-idf-与乐鑫芯片)。
|
||||
|
||||
@@ -47,84 +49,75 @@ ESP-IDF 项目重视持续维护和更新,确保我们的客户始终处于技
|
||||
|
||||
* 新芯片支持
|
||||
|
||||
* 在 ESP-IDF v5.4 中为 ESP32-C5 提供预览支持,并在 ESP-IDF v5.5 中为 ESP32-C5 提供完整支持,参考 [ESP32-C5 支持状态](https://github.com/espressif/esp-idf/issues/14021)
|
||||
* 在 ESP-IDF v5.4 中增加对 ESP32-C61 早期样品的预览支持,并在 IDF v5.5 中增加对 ESP32-C61 量产版本的完整支持,参考 [ESP32-C61 支持状态](https://developer.espressif.com/pages/chip-support-status/esp32c61/#esp-idf)
|
||||
* 在 ESP-IDF v5.3 中为 ESP32-P4 提供完整支持,参考 [ESP32-P4 支持状态](https://github.com/espressif/esp-idf/issues/12996)
|
||||
* 在 ESP-IDF v5.3 中为 ESP32-C5 提供预览支持,并在 ESP-IDF v5.4 中为 ESP32-C5 提供完整支持,参考 [ESP32-C5 支持状态](https://github.com/espressif/esp-idf/issues/14021)
|
||||
* 在 ESP-IDF v5.4 中增加对 ESP32-C61 早期样品的预览支持,并在 IDF v5.4.x 中增加对 ESP32-C61 量产版本的完整支持,参考 [ESP32-C61 支持状态](https://developer.espressif.com/pages/chip-support-status/esp32c61/#esp-idf)
|
||||
|
||||
* Bugfix 版本发布
|
||||
|
||||
* 发布 Bugfix 版本 IDF v5.0.8 和 IDF v5.0.9,并在 2025 年 5 月底停止维护 ESP-IDF v5.0
|
||||
* 发布 Bugfix 版本 IDF v5.1.6 和 IDF v5.1.7,并在 2025 年 12 月底停止维护 ESP-IDF v5.1
|
||||
* 发布 Bugfix 版本 IDF v5.2.4,IDF v5.2.5 和 IDF v5.2.6,release/5.2 分支自 2025 年 2 月进入维护周期
|
||||
* 发布 Bugfix 版本 IDF v5.3.3 和 IDF v5.3.4,release/5.3 分支自 2025 年 7 月进入维护周期
|
||||
* release/5.4 分支发布更多 bugfix 版本,包括 IDF v5.4.1、IDF v5.4.2、IDF v5.4.3;release/5.5 分支发布更多 bugfix 版本,包括 IDF v5.5.1、IDF v5.5.2。通过发布这些 Bugfix 版本,使 release/5.4 分支和 release/5.5 分支更加稳定和产品化。
|
||||
* 发布 Bugfix 版本 IDF v4.4.8,并在 2024 年 7 月底停止维护 ESP-IDF v4.4
|
||||
* 2024 年,release/5.0 分支已处于维护周期,发布 IDF v5.0.6 和 IDF v5.0.7
|
||||
* 2024 年上半年发布 Bugfix 版本 IDF v5.1.3 和 IDF v5.1.4,并在 2024 年下半年发布 IDF v5.1.5
|
||||
* 自 2024 年 6 月起,release/5.1 分支进入到维护周期
|
||||
* release/5.2 分支发布更多 Bugfix 版本,包括 IDF v5.2.1、IDF v5.2.2、IDF v5.2.3;release/5.3 分支发布更多 Bugfix 版本,包括 IDF v5.3.1、IDF v5.3.2。通过发布这些 Bugfix 版本,使 release/5.2 分支和 release/5.3 分支更加稳定和产品化。
|
||||
|
||||
## ESP-IDF 发布计划
|
||||
|
||||
获取 ESP-IDF 的完整发布列表,请访问 https://github.com/espressif/esp-idf/releases
|
||||
|
||||
此处提供的所有信息均可因业务原因及其他因素而在没有通知的情况下进行更改。
|
||||
|
||||
### ESP-IDF 主要版本发布
|
||||
|
||||
```mermaid
|
||||
timeline
|
||||
2024 年,无主要版本发布计划
|
||||
|
||||
title ESP-IDF Major Releases
|
||||
section 2025 Q1 <br> Major Release Planning
|
||||
No version planned : N/A
|
||||
section 2025 Q2 <br> Major Release Planning
|
||||
No version planned : N/A
|
||||
section 2025 Q3 <br> Major Release Planning
|
||||
No version planned : N/A
|
||||
section 2025 Q4 <br> Major Release Planning
|
||||
v6.0-beta1 : 2025/11/13
|
||||
v6.0-beta2 : 2025/12/05
|
||||
v6.0-RC1 : 2026/01/14
|
||||
v6.0-RC2 : 2026/02/06
|
||||
v6.0 : 2026/02/13
|
||||
```
|
||||
|
||||
### ESP-IDF 次要版本发布
|
||||
|
||||
```mermaid
|
||||
timeline
|
||||
#### 第一季度
|
||||
|
||||
title ESP-IDF Minor Releases
|
||||
section 2025 Q1 <br> Minor Release Planning
|
||||
No version planned : N/A
|
||||
section 2025 Q2 <br> Minor Release Planning
|
||||
v5.5-beta1 : 2025/05/14
|
||||
v5.5-beta2 : 2025/06/04
|
||||
section 2025 Q3 <br> Minor Release Planning
|
||||
v5.5-RC1 : 2025/07/07
|
||||
v5.5-RC2 : 2025/07/28
|
||||
v5.5 : 2025/08/04
|
||||
section 2025 Q4 <br> Minor Release Planning
|
||||
No version planned : N/A
|
||||
```
|
||||
* v5.2-RC1,预计发布日期:2024/02/02
|
||||
* v5.2 正式发布,预计发布日期:2024/02/08
|
||||
|
||||
#### 第二季度
|
||||
|
||||
* v5.3-beta1,预计发布日期:2024/05/13
|
||||
* v5.3-beta2,预计发布日期:2024/05/31
|
||||
* v5.3-RC1,预计发布日期:2024/07/08
|
||||
|
||||
#### 第三季度
|
||||
|
||||
* v5.3-RC2,预计发布日期:2024/07/26
|
||||
* v5.3 正式发布,预计发布日期:2024/08/02
|
||||
|
||||
#### 第四季度
|
||||
|
||||
* v5.4-beta1,预计发布日期:2024/11/08
|
||||
* v5.4-beta2,预计发布日期:2024/11/29
|
||||
* v5.4-RC1,预计发布日期:2025/01/09
|
||||
* v5.4-RC2,预计发布日期:2025/01/29
|
||||
* v5.4 正式发布,预计发布日期:2025/02/05
|
||||
|
||||
### ESP-IDF Bugfix 版本发布
|
||||
|
||||
```mermaid
|
||||
timeline
|
||||
#### 第一季度
|
||||
|
||||
title ESP-IDF Bugfix Releases
|
||||
section 2025 Q1 <br> Bugfix Release Planning
|
||||
v5.0.8 : 2025/01/14
|
||||
v5.1.6 : 2025/02/18
|
||||
v5.2.4 : 2025/02/23
|
||||
v5.2.5 : 2025/02/28
|
||||
v5.4.1 : 2025/03/27
|
||||
v5.3.3 : 2025/04/04
|
||||
section 2025 Q2 <br> Bugfix Release Planning
|
||||
v5.0.9 : 2025/05/16
|
||||
v5.4.2 : 2025/06/30
|
||||
section 2025 Q3 <br> Bugfix Release Planning
|
||||
v5.3.4 : 2025/08/03
|
||||
v5.2.6 : 2025/09/04
|
||||
v5.5.1 : 2025/09/11
|
||||
v5.4.3 : 2025/10/08
|
||||
section 2025 Q4 <br> Bugfix Release Planning
|
||||
v5.5.2 : 2025/11/12
|
||||
v5.1.7 : 2026/01/06
|
||||
```
|
||||
* v5.1.3,预计发布日期:2024/02/08
|
||||
* v5.0.6,预计发布日期:2024/02/18
|
||||
* v4.4.7,预计发布日期:2024/03/19
|
||||
* v5.2.1,预计发布日期:2024/03/31
|
||||
|
||||
#### 第二季度
|
||||
|
||||
* v5.1.4,预计发布日期:2024/05/06
|
||||
* v5.2.2,预计发布日期:2024/06/17
|
||||
* v4.4.8,预计发布日期:2024/07/19
|
||||
|
||||
#### 第三季度
|
||||
|
||||
* v5.0.7,预计发布日期:2024/08/22
|
||||
* v5.3.1,预计发布日期:2024/09/16
|
||||
* v5.2.3,预计发布日期:2024/10/10
|
||||
|
||||
#### 第四季度
|
||||
|
||||
* v5.1.5,预计发布日期:2024/11/04(自 2024 年 6 月进入维护周期)
|
||||
* v5.3.2,预计发布日期:2024/12/31
|
||||
* v5.2.4,预计发布日期:2025/02/20(服务周期截止至 2025 年 2 月)
|
||||
@@ -60,9 +60,9 @@ endif()
|
||||
|
||||
if(CONFIG_HEAP_TRACING_TOHOST)
|
||||
list(APPEND srcs "heap_trace_tohost.c")
|
||||
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
|
||||
set_source_files_properties(heap_trace_tohost.c PROPERTIES COMPILE_FLAGS -Wno-frame-address)
|
||||
endif()
|
||||
set_source_files_properties(heap_trace_tohost.c
|
||||
PROPERTIES COMPILE_FLAGS
|
||||
-Wno-frame-address)
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
@@ -121,3 +121,16 @@ if(CONFIG_APPTRACE_GCOV_ENABLE)
|
||||
else()
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${app_trace}> c)
|
||||
endif()
|
||||
|
||||
# This function adds a dependency on the given component if the component is included into the build.
|
||||
function(maybe_add_component component_name)
|
||||
idf_build_get_property(components BUILD_COMPONENTS)
|
||||
if(${component_name} IN_LIST components)
|
||||
idf_component_get_property(lib_name ${component_name} COMPONENT_LIB)
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC ${lib_name})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if(CONFIG_APPTRACE_DEST_UART0 OR CONFIG_APPTRACE_DEST_UART1 OR CONFIG_APPTRACE_DEST_UART2)
|
||||
maybe_add_component(driver)
|
||||
endif()
|
||||
|
||||
@@ -207,7 +207,7 @@ menu "Application Level Tracing"
|
||||
depends on APPTRACE_ENABLE
|
||||
default n
|
||||
help
|
||||
Enables support for SEGGER SystemView tracing functionality.
|
||||
Enables supporrt for SEGGER SystemView tracing functionality.
|
||||
|
||||
choice APPTRACE_SV_DEST
|
||||
prompt "SystemView destination"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
@@ -92,7 +92,7 @@ static esp_err_t esp_apptrace_membufs_swap(esp_apptrace_membufs_proto_data_t *pr
|
||||
// switch to new block
|
||||
proto->state.in_block++;
|
||||
|
||||
proto->hw->swap(new_block_num, proto->state.markers[prev_block_num]);
|
||||
proto->hw->swap(new_block_num);
|
||||
|
||||
// handle data from host
|
||||
esp_hostdata_hdr_t *hdr = (esp_hostdata_hdr_t *)proto->blocks[new_block_num].start;
|
||||
@@ -148,18 +148,6 @@ static esp_err_t esp_apptrace_membufs_swap_waitus(esp_apptrace_membufs_proto_dat
|
||||
if (res != ESP_OK) {
|
||||
break;
|
||||
}
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
/*
|
||||
* ESP32S3 has a serious data corruption issue with the transferred data to host.
|
||||
* This delay helps reduce the failure rate by temporarily reducing heavy memory writes
|
||||
* from RTOS-level tracing and giving OpenOCD more time to read trace memory before
|
||||
* the current thread continues execution. While this doesn't completely prevent
|
||||
* memory access from other threads/cores/ISRs, it has shown to significantly improve
|
||||
* reliability when combined with CRC checks in OpenOCD. In practice, this reduces the
|
||||
* number of retries needed to read an entire block without corruption.
|
||||
*/
|
||||
esp_rom_delay_us(100);
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -351,7 +339,7 @@ uint8_t *esp_apptrace_membufs_up_buffer_get(esp_apptrace_membufs_proto_data_t *p
|
||||
esp_err_t esp_apptrace_membufs_up_buffer_put(esp_apptrace_membufs_proto_data_t *proto, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
|
||||
{
|
||||
esp_apptrace_membufs_pkt_end(ptr);
|
||||
// TODO: mark block as busy in order not to reuse it for other tracing calls until it is completely written
|
||||
// TODO: mark block as busy in order not to re-use it for other tracing calls until it is completely written
|
||||
// TODO: avoid potential situation when all memory is consumed by low prio tasks which can not complete writing due to
|
||||
// higher prio tasks and the latter can not allocate buffers at all
|
||||
// this is abnormal situation can be detected on host which will receive only uncompleted buffers
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#include <sdkconfig.h>
|
||||
|
||||
#define HEAP_TRACE_SRCFILE /* don't warn on inclusion here */
|
||||
#include "esp_heap_trace.h"
|
||||
#undef HEAP_TRACE_SRCFILE
|
||||
#include "esp_heap_caps.h"
|
||||
#if CONFIG_APPTRACE_SV_ENABLE
|
||||
#include "esp_app_trace.h"
|
||||
@@ -14,7 +16,7 @@
|
||||
|
||||
#define STACK_DEPTH CONFIG_HEAP_TRACING_STACK_DEPTH
|
||||
|
||||
#if CONFIG_HEAP_TRACING_TOHOST
|
||||
#ifdef CONFIG_HEAP_TRACING_TOHOST
|
||||
|
||||
#if !CONFIG_APPTRACE_SV_ENABLE
|
||||
#error None of the heap tracing backends is enabled! You must enable SystemView compatible tracing to use this feature.
|
||||
|
||||
@@ -18,6 +18,6 @@ entries:
|
||||
archive: libesp_driver_gptimer.a
|
||||
entries:
|
||||
if APPTRACE_SV_TS_SOURCE_GPTIMER = y:
|
||||
gptimer: gptimer_get_raw_count (noflash)
|
||||
gptimer (noflash)
|
||||
else:
|
||||
* (default)
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -218,13 +218,6 @@ static esp_err_t esp_apptrace_uart_init(esp_apptrace_uart_data_t *hw_data)
|
||||
hw_data->message_buff_overflow = false;
|
||||
hw_data->circular_buff_overflow = false;
|
||||
|
||||
assert((hw_data->port_num <= SOC_UART_NUM) && "Not possible to configure UART. Please check selected UART port");
|
||||
|
||||
int source_clk = UART_SCLK_DEFAULT;
|
||||
#if SOC_UART_LP_NUM > 0
|
||||
if (hw_data->port_num >= SOC_UART_HP_NUM)
|
||||
source_clk = LP_UART_SCLK_DEFAULT;
|
||||
#endif
|
||||
|
||||
const uart_config_t uart_config = {
|
||||
.baud_rate = CONFIG_APPTRACE_UART_BAUDRATE,
|
||||
@@ -232,7 +225,7 @@ static esp_err_t esp_apptrace_uart_init(esp_apptrace_uart_data_t *hw_data)
|
||||
.parity = UART_PARITY_DISABLE,
|
||||
.stop_bits = UART_STOP_BITS_1,
|
||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
||||
.source_clk = source_clk,
|
||||
.source_clk = UART_SCLK_DEFAULT,
|
||||
};
|
||||
ESP_LOGI(TAG, "UART baud rate: %i", CONFIG_APPTRACE_UART_BAUDRATE);
|
||||
// We won't use a buffer for sending data.
|
||||
|
||||
@@ -50,7 +50,7 @@ static uint8_t *esp_apptrace_riscv_down_buffer_get(esp_apptrace_riscv_data_t *hw
|
||||
static esp_err_t esp_apptrace_riscv_down_buffer_put(esp_apptrace_riscv_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
|
||||
static bool esp_apptrace_riscv_host_is_connected(esp_apptrace_riscv_data_t *hw_data);
|
||||
static esp_err_t esp_apptrace_riscv_buffer_swap_start(uint32_t curr_block_id);
|
||||
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len);
|
||||
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id);
|
||||
static esp_err_t esp_apptrace_riscv_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len);
|
||||
static bool esp_apptrace_riscv_host_data_pending(void);
|
||||
|
||||
@@ -353,7 +353,7 @@ static esp_err_t esp_apptrace_riscv_buffer_swap_end(uint32_t new_block_id, uint3
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len)
|
||||
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id)
|
||||
{
|
||||
/* do nothing */
|
||||
return ESP_OK;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*/
|
||||
@@ -12,7 +12,7 @@
|
||||
// ======================
|
||||
|
||||
// Xtensa has useful feature: TRAX debug module. It allows recording program execution flow at run-time without disturbing CPU.
|
||||
// Execution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
|
||||
// Exectution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
|
||||
// trace memory via its registers by means of JTAG, APB or ERI transactions.
|
||||
// ESP32 has two Xtensa cores with separate TRAX modules on them and provides two special memory regions to be used as trace memory.
|
||||
// Chip allows muxing access to those trace memory blocks in such a way that while one block is accessed by CPUs another one can be accessed by host
|
||||
@@ -47,7 +47,7 @@
|
||||
// 2. TRAX Registers layout
|
||||
// ========================
|
||||
|
||||
// This module uses two TRAX HW registers and one Performance Monitor register to communicate with host SW (OpenOCD).
|
||||
// This module uses two TRAX HW registers to communicate with host SW (OpenOCD).
|
||||
// - Control register uses TRAX_DELAYCNT as storage. Only lower 24 bits of TRAX_DELAYCNT are writable. Control register has the following bitfields:
|
||||
// | 31..XXXXXX..24 | 23 .(host_connect). 23| 22..(block_id)..15 | 14..(block_len)..0 |
|
||||
// 14..0 bits - actual length of user data in trace memory block. Target updates it every time it fills memory block and exposes it to host.
|
||||
@@ -55,15 +55,9 @@
|
||||
// 21..15 bits - trace memory block transfer ID. Block counter. It can overflow. Updated by target, host should not modify it. Actually can be 2 bits;
|
||||
// 22 bit - 'host data present' flag. If set to one there is data from host, otherwise - no host data;
|
||||
// 23 bit - 'host connected' flag. If zero then host is not connected and tracing module works in post-mortem mode, otherwise in streaming mode;
|
||||
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
|
||||
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
|
||||
// See 'Targets Connection' section for details.
|
||||
// - CRC16 register uses ERI_PERFMON_PM1 as storage. This register is used to store CRC16 checksum of the exposed trace memory block.
|
||||
// The register has the following format:
|
||||
// | 31..16 (CRC indicator) | 15..0 (CRC16 value) |
|
||||
// CRC indicator (0xA55A) is used to distinguish valid CRC values from other data that might be in the register.
|
||||
// CRC16 is calculated over the entire exposed block and is updated every time a block is exposed to the host.
|
||||
// This allows the host to verify data integrity of the received trace data.
|
||||
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
|
||||
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
|
||||
// See 'Targets Connection' setion for details.
|
||||
|
||||
// 3. Modes of operation
|
||||
// =====================
|
||||
@@ -133,7 +127,7 @@
|
||||
|
||||
// Access to internal module's data is synchronized with custom mutex. Mutex is a wrapper for portMUX_TYPE and uses almost the same sync mechanism as in
|
||||
// vPortCPUAcquireMutex/vPortCPUReleaseMutex. The mechanism uses S32C1I Xtensa instruction to implement exclusive access to module's data from tasks and
|
||||
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlying mutex in cycle until
|
||||
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlaying mutex in cycle until
|
||||
// it gets its ownership or timeout expires. The differences of application tracing module's mutex implementation from vPortCPUAcquireMutex/vPortCPUReleaseMutex are:
|
||||
// - Support for timeouts.
|
||||
// - Local IRQs for CPU which owns the mutex are disabled till the call to unlocking routine. This is made to avoid possible task's prio inversion.
|
||||
@@ -148,9 +142,9 @@
|
||||
|
||||
// Timeout mechanism is based on xthal_get_ccount() routine and supports timeout values in microseconds.
|
||||
// There are two situations when task/ISR can be delayed by tracing API call. Timeout mechanism takes into account both conditions:
|
||||
// - Trace data are locked by another task/ISR. When waiting on trace data lock.
|
||||
// - Trace data are locked by another task/ISR. When wating on trace data lock.
|
||||
// - Current TRAX memory input block is full when working in streaming mode (host is connected). When waiting for host to complete previous block reading.
|
||||
// When waiting for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
|
||||
// When wating for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
|
||||
// time exceeds specified timeout value operation is canceled and ESP_ERR_TIMEOUT code is returned.
|
||||
#include "sdkconfig.h"
|
||||
#include "soc/soc.h"
|
||||
@@ -165,15 +159,11 @@
|
||||
#include "esp_log.h"
|
||||
#include "esp_app_trace_membufs_proto.h"
|
||||
#include "esp_app_trace_port.h"
|
||||
#include "esp_rom_crc.h"
|
||||
|
||||
// TRAX is disabled, so we use its registers for our own purposes
|
||||
// | 31..XXXXXX..24 | 23 .(host_connect). 23 | 22 .(host_data). 22| 21..(block_id)..15 | 14..(block_len)..0 |
|
||||
#define ESP_APPTRACE_TRAX_CTRL_REG ERI_TRAX_DELAYCNT
|
||||
#define ESP_APPTRACE_TRAX_STAT_REG ERI_TRAX_TRIGGERPC
|
||||
#define ESP_APPTRACE_TRAX_CRC16_REG ERI_PERFMON_PM1
|
||||
|
||||
#define ESP_APPTRACE_CRC_INDICATOR (0xA55AU << 16)
|
||||
|
||||
#define ESP_APPTRACE_TRAX_BLOCK_LEN_MSK 0x7FFFUL
|
||||
#define ESP_APPTRACE_TRAX_BLOCK_LEN(_l_) ((_l_) & ESP_APPTRACE_TRAX_BLOCK_LEN_MSK)
|
||||
@@ -208,7 +198,7 @@ static uint8_t *esp_apptrace_trax_down_buffer_get(esp_apptrace_trax_data_t *hw_d
|
||||
static esp_err_t esp_apptrace_trax_down_buffer_put(esp_apptrace_trax_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
|
||||
static bool esp_apptrace_trax_host_is_connected(esp_apptrace_trax_data_t *hw_data);
|
||||
static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id);
|
||||
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len);
|
||||
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id);
|
||||
static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len);
|
||||
static bool esp_apptrace_trax_host_data_pending(void);
|
||||
|
||||
@@ -508,8 +498,7 @@ static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id)
|
||||
uint32_t acked_block = ESP_APPTRACE_TRAX_BLOCK_ID_GET(ctrl_reg);
|
||||
uint32_t host_to_read = ESP_APPTRACE_TRAX_BLOCK_LEN_GET(ctrl_reg);
|
||||
if (host_to_read != 0 || acked_block != (curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK)) {
|
||||
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32,
|
||||
esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
|
||||
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32, esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
|
||||
curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK, curr_block_id);
|
||||
res = ESP_ERR_NO_MEM;
|
||||
goto _on_err;
|
||||
@@ -525,22 +514,14 @@ static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32
|
||||
{
|
||||
uint32_t ctrl_reg = eri_read(ESP_APPTRACE_TRAX_CTRL_REG);
|
||||
uint32_t host_connected = ESP_APPTRACE_TRAX_HOST_CONNECT & ctrl_reg;
|
||||
|
||||
eri_write(ESP_APPTRACE_TRAX_CTRL_REG, ESP_APPTRACE_TRAX_BLOCK_ID(new_block_id) |
|
||||
host_connected | ESP_APPTRACE_TRAX_BLOCK_LEN(prev_block_len));
|
||||
esp_apptrace_trax_buffer_swap_unlock();
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len)
|
||||
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id)
|
||||
{
|
||||
/* Before switching to the new block, calculate CRC16 of the current block */
|
||||
if (prev_block_len > 0) {
|
||||
const uint8_t *prev_block_start = s_trax_blocks[!((new_block_id % 2))];
|
||||
uint16_t crc16 = esp_rom_crc16_le(0, prev_block_start, prev_block_len);
|
||||
eri_write(ESP_APPTRACE_TRAX_CRC16_REG, crc16 | ESP_APPTRACE_CRC_INDICATOR);
|
||||
ESP_APPTRACE_LOGD("CRC16:%x %d @%x", crc16, prev_block_len, prev_block_start);
|
||||
}
|
||||
esp_apptrace_trax_select_memory_block(new_block_id);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
esp_err_t (*swap_start)(uint32_t curr_block_id);
|
||||
esp_err_t (*swap)(uint32_t new_block_id, uint32_t prev_block_len);
|
||||
esp_err_t (*swap)(uint32_t new_block_id);
|
||||
esp_err_t (*swap_end)(uint32_t new_block_id, uint32_t prev_block_len);
|
||||
bool (*host_data_pending)(void);
|
||||
} esp_apptrace_membufs_proto_hw_t;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -49,7 +49,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.56 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
----------------------------------------------------------------------
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -47,7 +47,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.56 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
---------------------------END-OF-HEADER------------------------------
|
||||
@@ -100,10 +100,6 @@ Revision: $Rev: 25842 $
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif (defined(__ARM_ARCH_8_1M_MAIN__)) // Cortex-M85
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#else
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 0
|
||||
#endif
|
||||
@@ -134,10 +130,6 @@ Revision: $Rev: 25842 $
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif (defined __ARM_ARCH_8_1M_MAIN__) // Cortex-M85
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
@@ -164,10 +156,6 @@ Revision: $Rev: 25842 $
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif (defined __ARM_ARCH_8_1M_MAIN__) // Cortex-M85
|
||||
#define _CORE_HAS_RTT_ASM_SUPPORT 1
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
|
||||
#define _CORE_NEEDS_DMB 1
|
||||
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
|
||||
@@ -283,7 +271,6 @@ Revision: $Rev: 25842 $
|
||||
#ifndef SEGGER_RTT_ASM // defined when SEGGER_RTT.h is included from assembly file
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
@@ -425,7 +412,7 @@ unsigned SEGGER_RTT_ReadUpBufferNoLock (unsigned BufferIndex, void* pDa
|
||||
unsigned SEGGER_RTT_WriteDownBuffer (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
|
||||
unsigned SEGGER_RTT_WriteDownBufferNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
|
||||
|
||||
#define SEGGER_RTT_HASDATA_UP(n) (((SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->WrOff - ((SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->RdOff) // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
|
||||
#define SEGGER_RTT_HASDATA_UP(n) (((SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->WrOff - ((SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->RdOff) // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-1-Clause
|
||||
*
|
||||
* SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -49,14 +49,14 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.56 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
||||
File : SEGGER_SYSVIEW.c
|
||||
Purpose : System visualization API implementation.
|
||||
Revision: $Rev: 29105 $
|
||||
Revision: $Rev: 28341 $
|
||||
|
||||
Additional information:
|
||||
Packet format:
|
||||
@@ -66,10 +66,10 @@ Additional information:
|
||||
|
||||
Packets with IDs 24..31 are standard packets with extendible
|
||||
structure and contain a length field.
|
||||
<ID><Length><Data><TimeStampDelta>
|
||||
<ID><Lenght><Data><TimeStampDelta>
|
||||
|
||||
Packet ID 31 is used for SystemView extended events.
|
||||
<ID><Length><ID_EX><Data><TimeStampDelta>
|
||||
<ID><Lenght><ID_EX><Data><TimeStampDelta>
|
||||
|
||||
Packets with IDs >= 32 always contain a length field.
|
||||
<ID><Length><Data><TimeStampDelta>
|
||||
@@ -150,7 +150,6 @@ Additional information:
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
#include "SEGGER_SYSVIEW_Int.h"
|
||||
#include "SEGGER_RTT.h"
|
||||
|
||||
@@ -189,7 +188,7 @@ Additional information:
|
||||
// Timestamps may be less than full 32-bits, in which case we need to zero
|
||||
// the unused bits to properly handle overflows.
|
||||
// Note that this is a quite common scenario, as a 32-bit time such as
|
||||
// SysTick might be scaled down to reduce bandwidth
|
||||
// SysTick might be scaled down to reduce bandwith
|
||||
// or a 16-bit hardware time might be used.
|
||||
#if SEGGER_SYSVIEW_TIMESTAMP_BITS < 32 // Eliminate unused bits in case hardware timestamps are less than 32 bits
|
||||
#define MAKE_DELTA_32BIT(Delta) Delta <<= 32 - SEGGER_SYSVIEW_TIMESTAMP_BITS; \
|
||||
@@ -389,6 +388,8 @@ static U8 _NumModules;
|
||||
pDest = pSysviewPointer; \
|
||||
};
|
||||
|
||||
|
||||
|
||||
#if (SEGGER_SYSVIEW_USE_STATIC_BUFFER == 1)
|
||||
static U8 _aPacket[SEGGER_SYSVIEW_MAX_PACKET_SIZE];
|
||||
|
||||
@@ -431,9 +432,6 @@ static U8 _aPacket[SEGGER_SYSVIEW_MAX_PACKET_SIZE];
|
||||
static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
||||
unsigned int n;
|
||||
const U8* p;
|
||||
|
||||
// Espressif doesn't support larger packages yet. Encode data length must be less than 255.
|
||||
assert(NumBytes < 255);
|
||||
//
|
||||
n = 0;
|
||||
p = (const U8*)pSrc;
|
||||
@@ -444,8 +442,8 @@ static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
||||
*pPayload++ = (U8)NumBytes;
|
||||
} else {
|
||||
*pPayload++ = 255;
|
||||
*pPayload++ = ((NumBytes >> 8) & 255);
|
||||
*pPayload++ = (NumBytes & 255);
|
||||
*pPayload++ = ((NumBytes >> 8) & 255);
|
||||
}
|
||||
while (n < NumBytes) {
|
||||
*pPayload++ = *p++;
|
||||
@@ -454,38 +452,6 @@ static U8* _EncodeData(U8* pPayload, const char* pSrc, unsigned int NumBytes) {
|
||||
return pPayload;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* _EncodeFloat()
|
||||
*
|
||||
* Function description
|
||||
* Encode a float value in variable-length format.
|
||||
*
|
||||
* Parameters
|
||||
* pPayload - Pointer to where value will be encoded.
|
||||
* Value - Value to be encoded.
|
||||
*
|
||||
* Return value
|
||||
* Pointer to the byte following the value, i.e. the first free
|
||||
* byte in the payload and the next position to store payload
|
||||
* content.
|
||||
*/
|
||||
static U8* _EncodeFloat(U8* pPayload, float Value) {
|
||||
float Val = Value;
|
||||
U8* pSysviewPointer;
|
||||
U32* SysViewData;
|
||||
pSysviewPointer = pPayload;
|
||||
SysViewData = (U32*)&Val;
|
||||
while((*SysViewData) > 0x7F) {
|
||||
*pSysviewPointer++ = (U8)((*SysViewData) | 0x80);
|
||||
(*SysViewData) >>= 7;
|
||||
};
|
||||
*pSysviewPointer++ = (U8)(*SysViewData);
|
||||
pPayload = pSysviewPointer;
|
||||
|
||||
return pPayload;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* _EncodeStr()
|
||||
@@ -509,42 +475,38 @@ static U8* _EncodeFloat(U8* pPayload, float Value) {
|
||||
* No more than 1 + Limit bytes will be encoded to the payload.
|
||||
*/
|
||||
static U8 *_EncodeStr(U8 *pPayload, const char *pText, unsigned int Limit) {
|
||||
U8* pLen;
|
||||
const char* sStart;
|
||||
|
||||
if (pText == NULL) {
|
||||
*pPayload++ = (U8)0;
|
||||
} else {
|
||||
sStart = pText; // Remember start of string.
|
||||
//
|
||||
// Save space to store count byte(s).
|
||||
//
|
||||
pLen = pPayload++;
|
||||
#if (SEGGER_SYSVIEW_MAX_STRING_LEN >= 255) // Length always encodes in 3 bytes
|
||||
pPayload += 2;
|
||||
#endif
|
||||
//
|
||||
// Limit string to maximum length and copy into payload buffer.
|
||||
//
|
||||
if (Limit > SEGGER_SYSVIEW_MAX_STRING_LEN) {
|
||||
Limit = SEGGER_SYSVIEW_MAX_STRING_LEN;
|
||||
unsigned int n;
|
||||
unsigned int Len;
|
||||
//
|
||||
// Compute string len
|
||||
//
|
||||
Len = 0;
|
||||
if (pText != NULL) {
|
||||
while(*(pText + Len) != 0) {
|
||||
Len++;
|
||||
}
|
||||
while ((Limit-- > 0) && (*pText != '\0')) {
|
||||
*pPayload++ = *pText++;
|
||||
if (Len > Limit) {
|
||||
Len = Limit;
|
||||
}
|
||||
//
|
||||
// Save string length to buffer.
|
||||
//
|
||||
#if (SEGGER_SYSVIEW_MAX_STRING_LEN >= 255) // Length always encodes in 3 bytes
|
||||
Limit = (unsigned int)(pText - sStart);
|
||||
*pLen++ = (U8)255;
|
||||
*pLen++ = (U8)((Limit >> 8) & 255);
|
||||
*pLen++ = (U8)(Limit & 255);
|
||||
#else // Length always encodes in 1 byte
|
||||
*pLen = (U8)(pText - sStart);
|
||||
#endif
|
||||
}
|
||||
//
|
||||
// Write Len
|
||||
//
|
||||
if (Len < 255) {
|
||||
*pPayload++ = (U8)Len;
|
||||
} else {
|
||||
*pPayload++ = 255;
|
||||
*pPayload++ = (Len & 255);
|
||||
*pPayload++ = ((Len >> 8) & 255);
|
||||
}
|
||||
//
|
||||
// copy string
|
||||
//
|
||||
n = 0;
|
||||
while (n < Len) {
|
||||
*pPayload++ = *pText++;
|
||||
n++;
|
||||
}
|
||||
return pPayload;
|
||||
}
|
||||
|
||||
@@ -731,6 +693,7 @@ static void _SendSyncInfo(void) {
|
||||
for (n = 0; n < _NumModules; n++) {
|
||||
SEGGER_SYSVIEW_SendModule(n);
|
||||
}
|
||||
SEGGER_SYSVIEW_SendModuleDescription();
|
||||
}
|
||||
}
|
||||
#endif // (SEGGER_SYSVIEW_POST_MORTEM_MODE == 1)
|
||||
@@ -1255,7 +1218,6 @@ static void _VPrintTarget(const char* sFormat, U32 Options, va_list* pParamList)
|
||||
unsigned int FormatFlags;
|
||||
unsigned int FieldWidth;
|
||||
U8* pPayloadStart;
|
||||
const char* s;
|
||||
#if SEGGER_SYSVIEW_USE_STATIC_BUFFER == 0
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + SEGGER_SYSVIEW_MAX_STRING_LEN + 1 + 2 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
SEGGER_SYSVIEW_LOCK();
|
||||
@@ -1360,20 +1322,6 @@ static void _VPrintTarget(const char* sFormat, U32 Options, va_list* pParamList)
|
||||
v = va_arg(*pParamList, int);
|
||||
_PrintUnsigned(&BufferDesc, (unsigned int)v, 16u, NumDigits, FieldWidth, FormatFlags);
|
||||
break;
|
||||
case 's':
|
||||
s = va_arg(*pParamList, const char*);
|
||||
if (s == NULL) {
|
||||
s = "(null)";
|
||||
}
|
||||
do {
|
||||
c = *s;
|
||||
s++;
|
||||
if (c == '\0') {
|
||||
break;
|
||||
}
|
||||
_StoreChar(&BufferDesc, c);
|
||||
} while (BufferDesc.Cnt < SEGGER_SYSVIEW_MAX_STRING_LEN);
|
||||
break;
|
||||
case 'p':
|
||||
v = va_arg(*pParamList, int);
|
||||
_PrintUnsigned(&BufferDesc, (unsigned int)v, 16u, 8u, 8u, 0u);
|
||||
@@ -2006,61 +1954,11 @@ void SEGGER_SYSVIEW_SendTaskInfo(const SEGGER_SYSVIEW_TASKINFO *pInfo) {
|
||||
ENCODE_U32(pPayload, SHRINK_ID(pInfo->TaskID));
|
||||
ENCODE_U32(pPayload, pInfo->StackBase);
|
||||
ENCODE_U32(pPayload, pInfo->StackSize);
|
||||
ENCODE_U32(pPayload, pInfo->StackUsage);
|
||||
ENCODE_U32(pPayload, 0); // Stack End, future use
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_STACK_INFO);
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_SendStackInfo()
|
||||
*
|
||||
* Function description
|
||||
* Send a Stack Info Packet, containing TaskId for identification,
|
||||
* stack base, stack size and stack usage.
|
||||
*
|
||||
*
|
||||
* Parameters
|
||||
* pInfo - Pointer to stack information to send.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_SendStackInfo(const SEGGER_SYSVIEW_STACKINFO *pInfo) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 4 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, SHRINK_ID(pInfo->TaskID));
|
||||
ENCODE_U32(pPayload, pInfo->StackBase);
|
||||
ENCODE_U32(pPayload, pInfo->StackSize);
|
||||
ENCODE_U32(pPayload, pInfo->StackUsage);
|
||||
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_SampleData()
|
||||
*
|
||||
* Function description
|
||||
* Send a Data Sample Packet, containing the data Id and the value.
|
||||
*
|
||||
*
|
||||
* Parameters
|
||||
* pInfo - Pointer to data sample struct to send.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_SampleData(const SEGGER_SYSVIEW_DATA_SAMPLE *pInfo) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 2 * SEGGER_SYSVIEW_QUANTA_U32);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, pInfo->ID);
|
||||
pPayload = _EncodeFloat(pPayload, *(pInfo->pFloat_Value));
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_DATA_SAMPLE);
|
||||
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_SendTaskList()
|
||||
@@ -2550,63 +2448,6 @@ void SEGGER_SYSVIEW_NameResource(U32 ResourceId, const char* sName) {
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_RegisterData()
|
||||
*
|
||||
* Function description
|
||||
* Register data to sample the values via SystemView.
|
||||
*
|
||||
* Register functions are usually set in the system description
|
||||
* callback, to ensure it is only sent when the SystemView Application
|
||||
* is connected.
|
||||
*
|
||||
* Parameters
|
||||
* pInfo - Struct containing all possible properties that can be sent via this registration event.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_RegisterData(SEGGER_SYSVIEW_DATA_REGISTER* pInfo) {
|
||||
U8* pPayload;
|
||||
U8* pPayloadStart;
|
||||
RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + 8 * SEGGER_SYSVIEW_QUANTA_U32 + 1 + SEGGER_SYSVIEW_MAX_STRING_LEN);
|
||||
//
|
||||
pPayload = pPayloadStart;
|
||||
ENCODE_U32(pPayload, SYSVIEW_EVTID_EX_REGISTER_DATA);
|
||||
ENCODE_U32(pPayload, pInfo->ID);
|
||||
pPayload = _EncodeStr(pPayload, pInfo->sName, SEGGER_SYSVIEW_MAX_STRING_LEN);
|
||||
|
||||
if (pInfo->sName != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMin);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMax);
|
||||
pPayload = _EncodeFloat(pPayload, pInfo->ScalingFactor);
|
||||
pPayload = _EncodeStr(pPayload, pInfo->sUnit, SEGGER_SYSVIEW_MAX_STRING_LEN);
|
||||
} else if (pInfo->ScalingFactor != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMin);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMax);
|
||||
pPayload = _EncodeFloat(pPayload, pInfo->ScalingFactor);
|
||||
} else if (pInfo->RangeMax != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMin);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMax);
|
||||
} else if (pInfo->RangeMin != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
ENCODE_U32(pPayload, pInfo->RangeMin);
|
||||
} else if (pInfo->Offset != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
ENCODE_U32(pPayload, pInfo->Offset);
|
||||
} else if (pInfo->DataType != 0) {
|
||||
ENCODE_U32(pPayload, pInfo->DataType);
|
||||
}
|
||||
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_EX);
|
||||
RECORD_END();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_HeapDefine()
|
||||
@@ -2979,6 +2820,9 @@ void SEGGER_SYSVIEW_RegisterModule(SEGGER_SYSVIEW_MODULE* pModule) {
|
||||
_NumModules++;
|
||||
}
|
||||
SEGGER_SYSVIEW_SendModule(0);
|
||||
if (pModule->pfSendModuleDesc) {
|
||||
pModule->pfSendModuleDesc();
|
||||
}
|
||||
SEGGER_SYSVIEW_UNLOCK();
|
||||
}
|
||||
|
||||
@@ -3062,9 +2906,6 @@ void SEGGER_SYSVIEW_SendModule(U8 ModuleId) {
|
||||
_SendPacket(pPayloadStart, pPayload, SYSVIEW_EVTID_MODULEDESC);
|
||||
RECORD_END();
|
||||
}
|
||||
if (pModule && pModule->pfSendModuleDesc) {
|
||||
pModule->pfSendModuleDesc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3145,39 +2986,6 @@ void SEGGER_SYSVIEW_PrintfHostEx(const char* s, U32 Options, ...) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VPrintfHostEx()
|
||||
*
|
||||
* Function description
|
||||
* Print a string which is formatted on the host by the SystemView Application
|
||||
* with Additional information.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* Options - Options for the string. i.e. Log level.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*
|
||||
* Additional information
|
||||
* All format arguments are treated as 32-bit scalar values.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VPrintfHostEx(const char* s, U32 Options, va_list *pParamList) {
|
||||
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
|
||||
int r;
|
||||
va_list ParamListCopy;
|
||||
va_copy(ParamListCopy, *pParamList);
|
||||
|
||||
r = _VPrintHost(s, Options, pParamList);
|
||||
|
||||
if (r == -1) {
|
||||
_VPrintTarget(s, Options, &ParamListCopy);
|
||||
}
|
||||
va_end(ParamListCopy);
|
||||
#else
|
||||
_VPrintHost(s, Options, pParamList);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_PrintfHost()
|
||||
@@ -3212,37 +3020,6 @@ void SEGGER_SYSVIEW_PrintfHost(const char* s, ...) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VPrintfHost()
|
||||
*
|
||||
* Function description
|
||||
* Print a string which is formatted on the host by the SystemView Application.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*
|
||||
* Additional information
|
||||
* All format arguments are treated as 32-bit scalar values.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VPrintfHost(const char* s, va_list *pParamList) {
|
||||
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
|
||||
int r;
|
||||
va_list ParamListCopy;
|
||||
va_copy(ParamListCopy, *pParamList);
|
||||
|
||||
r = _VPrintHost(s, SEGGER_SYSVIEW_LOG, pParamList);
|
||||
|
||||
if (r == -1) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_LOG, &ParamListCopy);
|
||||
}
|
||||
va_end(ParamListCopy);
|
||||
#else
|
||||
_VPrintHost(s, SEGGER_SYSVIEW_LOG, pParamList);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_WarnfHost()
|
||||
@@ -3278,38 +3055,6 @@ void SEGGER_SYSVIEW_WarnfHost(const char* s, ...) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VWarnfHost()
|
||||
*
|
||||
* Function description
|
||||
* Print a warning string which is formatted on the host by
|
||||
* the SystemView Application.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*
|
||||
* Additional information
|
||||
* All format arguments are treated as 32-bit scalar values.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VWarnfHost(const char* s, va_list *pParamList) {
|
||||
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
|
||||
int r;
|
||||
va_list ParamListCopy;
|
||||
va_copy(ParamListCopy, *pParamList);
|
||||
|
||||
r = _VPrintHost(s, SEGGER_SYSVIEW_WARNING, pParamList);
|
||||
|
||||
if (r == -1) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_WARNING, &ParamListCopy);
|
||||
}
|
||||
va_end(ParamListCopy);
|
||||
#else
|
||||
_VPrintHost(s, SEGGER_SYSVIEW_WARNING, pParamList);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_ErrorfHost()
|
||||
@@ -3345,38 +3090,6 @@ void SEGGER_SYSVIEW_ErrorfHost(const char* s, ...) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VErrorfHost()
|
||||
*
|
||||
* Function description
|
||||
* Print a warning string which is formatted on the host by
|
||||
* the SystemView Application.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*
|
||||
* Additional information
|
||||
* All format arguments are treated as 32-bit scalar values.
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VErrorfHost(const char* s, va_list *pParamList) {
|
||||
#if SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
|
||||
int r;
|
||||
va_list ParamListCopy;
|
||||
va_copy(ParamListCopy, *pParamList);
|
||||
|
||||
r = _VPrintHost(s, SEGGER_SYSVIEW_ERROR, pParamList);
|
||||
|
||||
if (r == -1) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_ERROR, &ParamListCopy);
|
||||
}
|
||||
va_end(ParamListCopy);
|
||||
#else
|
||||
_VPrintHost(s, SEGGER_SYSVIEW_ERROR, pParamList);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_PrintfTargetEx()
|
||||
@@ -3397,23 +3110,6 @@ void SEGGER_SYSVIEW_PrintfTargetEx(const char* s, U32 Options, ...) {
|
||||
va_end(ParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VPrintfTargetEx()
|
||||
*
|
||||
* Function description
|
||||
* Print a string which is formatted on the target before sent to
|
||||
* the host with Additional information.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* Options - Options for the string. i.e. Log level.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VPrintfTargetEx(const char* s, U32 Options, va_list *pParamList) {
|
||||
_VPrintTarget(s, Options, pParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_PrintfTarget()
|
||||
@@ -3433,22 +3129,6 @@ void SEGGER_SYSVIEW_PrintfTarget(const char* s, ...) {
|
||||
va_end(ParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VPrintfTarget()
|
||||
*
|
||||
* Function description
|
||||
* Print a string which is formatted on the target before sent to
|
||||
* the host.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VPrintfTarget(const char* s, va_list* pParamList) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_LOG, pParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_WarnfTarget()
|
||||
@@ -3468,22 +3148,6 @@ void SEGGER_SYSVIEW_WarnfTarget(const char* s, ...) {
|
||||
va_end(ParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VWarnfTarget()
|
||||
*
|
||||
* Function description
|
||||
* Print a warning string which is formatted on the target before
|
||||
* sent to the host.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VWarnfTarget(const char* s, va_list* pParamList) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_WARNING, pParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_ErrorfTarget()
|
||||
@@ -3502,22 +3166,6 @@ void SEGGER_SYSVIEW_ErrorfTarget(const char* s, ...) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_ERROR, &ParamList);
|
||||
va_end(ParamList);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_SYSVIEW_VErrorfTarget()
|
||||
*
|
||||
* Function description
|
||||
* Print an error string which is formatted on the target before
|
||||
* sent to the host.
|
||||
*
|
||||
* Parameters
|
||||
* s - String to be formatted.
|
||||
* pParamList - Pointer to the list of arguments for the format string
|
||||
*/
|
||||
void SEGGER_SYSVIEW_VErrorfTarget(const char* s, va_list* pParamList) {
|
||||
_VPrintTarget(s, SEGGER_SYSVIEW_ERROR, pParamList);
|
||||
}
|
||||
#endif // SEGGER_SYSVIEW_EXCLUDE_PRINTF
|
||||
|
||||
/*********************************************************************
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-1-Clause
|
||||
*
|
||||
* SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -49,13 +49,13 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.56 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
File : SEGGER_SYSVIEW.h
|
||||
Purpose : System visualization API.
|
||||
Revision: $Rev: 28768 $
|
||||
Revision: $Rev: 28237 $
|
||||
*/
|
||||
|
||||
#ifndef SEGGER_SYSVIEW_H
|
||||
@@ -123,7 +123,7 @@ extern "C" {
|
||||
#define SYSVIEW_EVTID_TIMER_EXIT 20
|
||||
#define SYSVIEW_EVTID_STACK_INFO 21
|
||||
#define SYSVIEW_EVTID_MODULEDESC 22
|
||||
#define SYSVIEW_EVTID_DATA_SAMPLE 23
|
||||
|
||||
#define SYSVIEW_EVTID_INIT 24
|
||||
#define SYSVIEW_EVTID_NAME_RESOURCE 25
|
||||
#define SYSVIEW_EVTID_PRINT_FORMATTED 26
|
||||
@@ -135,13 +135,12 @@ extern "C" {
|
||||
//
|
||||
// SystemView extended events. Sent with ID 31.
|
||||
//
|
||||
#define SYSVIEW_EVTID_EX_MARK 0
|
||||
#define SYSVIEW_EVTID_EX_NAME_MARKER 1
|
||||
#define SYSVIEW_EVTID_EX_HEAP_DEFINE 2
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC 3
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC_EX 4
|
||||
#define SYSVIEW_EVTID_EX_HEAP_FREE 5
|
||||
#define SYSVIEW_EVTID_EX_REGISTER_DATA 6
|
||||
#define SYSVIEW_EVTID_EX_MARK 0
|
||||
#define SYSVIEW_EVTID_EX_NAME_MARKER 1
|
||||
#define SYSVIEW_EVTID_EX_HEAP_DEFINE 2
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC 3
|
||||
#define SYSVIEW_EVTID_EX_HEAP_ALLOC_EX 4
|
||||
#define SYSVIEW_EVTID_EX_HEAP_FREE 5
|
||||
//
|
||||
// Event masks to disable/enable events
|
||||
//
|
||||
@@ -168,7 +167,7 @@ extern "C" {
|
||||
#define SYSVIEW_EVTMASK_TIMER_EXIT (1 << SYSVIEW_EVTID_TIMER_EXIT)
|
||||
#define SYSVIEW_EVTMASK_STACK_INFO (1 << SYSVIEW_EVTID_STACK_INFO)
|
||||
#define SYSVIEW_EVTMASK_MODULEDESC (1 << SYSVIEW_EVTID_MODULEDESC)
|
||||
#define SYSVIEW_EVTMASK_DATA_SAMPLE (1 << SYSVIEW_EVTID_DATA_SAMPLE)
|
||||
|
||||
#define SYSVIEW_EVTMASK_INIT (1 << SYSVIEW_EVTID_INIT)
|
||||
#define SYSVIEW_EVTMASK_NAME_RESOURCE (1 << SYSVIEW_EVTID_NAME_RESOURCE)
|
||||
#define SYSVIEW_EVTMASK_PRINT_FORMATTED (1 << SYSVIEW_EVTID_PRINT_FORMATTED)
|
||||
@@ -203,42 +202,8 @@ typedef struct {
|
||||
U32 Prio;
|
||||
U32 StackBase;
|
||||
U32 StackSize;
|
||||
U32 StackUsage;
|
||||
} SEGGER_SYSVIEW_TASKINFO;
|
||||
|
||||
typedef struct {
|
||||
U32 TaskID;
|
||||
U32 StackBase;
|
||||
U32 StackSize;
|
||||
U32 StackUsage;
|
||||
} SEGGER_SYSVIEW_STACKINFO;
|
||||
|
||||
typedef struct {
|
||||
U32 ID;
|
||||
union {
|
||||
U32* pU32_Value;
|
||||
I32* pI32_Value;
|
||||
float* pFloat_Value;
|
||||
};
|
||||
} SEGGER_SYSVIEW_DATA_SAMPLE;
|
||||
|
||||
typedef enum {
|
||||
SEGGER_SYSVIEW_TYPE_U32 = 0,
|
||||
SEGGER_SYSVIEW_TYPE_I32 = 1,
|
||||
SEGGER_SYSVIEW_TYPE_FLOAT = 2
|
||||
} SEGGER_SYSVIEW_DATA_TYPE;
|
||||
|
||||
typedef struct {
|
||||
U32 ID;
|
||||
SEGGER_SYSVIEW_DATA_TYPE DataType;
|
||||
I32 Offset;
|
||||
I32 RangeMin;
|
||||
I32 RangeMax;
|
||||
float ScalingFactor;
|
||||
const char* sName;
|
||||
const char* sUnit;
|
||||
} SEGGER_SYSVIEW_DATA_REGISTER;
|
||||
|
||||
typedef struct SEGGER_SYSVIEW_MODULE_STRUCT SEGGER_SYSVIEW_MODULE;
|
||||
|
||||
struct SEGGER_SYSVIEW_MODULE_STRUCT {
|
||||
@@ -282,8 +247,8 @@ EXTERN unsigned int SEGGER_SYSVIEW_InterruptId;
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
U64 (*pfGetTime) (void);
|
||||
void (*pfSendTaskList) (void);
|
||||
U64 (*pfGetTime) (void);
|
||||
void (*pfSendTaskList) (void);
|
||||
} SEGGER_SYSVIEW_OS_API;
|
||||
|
||||
/*********************************************************************
|
||||
@@ -297,13 +262,9 @@ void SEGGER_SYSVIEW_Stop (void);
|
||||
void SEGGER_SYSVIEW_GetSysDesc (void);
|
||||
void SEGGER_SYSVIEW_SendTaskList (void);
|
||||
void SEGGER_SYSVIEW_SendTaskInfo (const SEGGER_SYSVIEW_TASKINFO* pInfo);
|
||||
void SEGGER_SYSVIEW_SendStackInfo (const SEGGER_SYSVIEW_STACKINFO* pInfo);
|
||||
void SEGGER_SYSVIEW_SendSysDesc (const char* sSysDesc);
|
||||
int SEGGER_SYSVIEW_IsStarted (void);
|
||||
int SEGGER_SYSVIEW_GetChannelID (void);
|
||||
|
||||
void SEGGER_SYSVIEW_SampleData (const SEGGER_SYSVIEW_DATA_SAMPLE *pInfo);
|
||||
|
||||
// Checks whether tracing has been started
|
||||
U8 SEGGER_SYSVIEW_Started(void);
|
||||
|
||||
@@ -350,7 +311,6 @@ void SEGGER_SYSVIEW_HeapAllocEx (void* pHeap, void* pUserData,
|
||||
void SEGGER_SYSVIEW_HeapFree (void* pHeap, void* pUserData);
|
||||
|
||||
void SEGGER_SYSVIEW_NameResource (U32 ResourceId, const char* sName);
|
||||
void SEGGER_SYSVIEW_RegisterData ( SEGGER_SYSVIEW_DATA_REGISTER* pInfo);
|
||||
|
||||
int SEGGER_SYSVIEW_SendPacket (U8* pPacket, U8* pPayloadEnd, unsigned int EventId);
|
||||
|
||||
@@ -381,21 +341,13 @@ void SEGGER_SYSVIEW_SendNumModules (void);
|
||||
*/
|
||||
#ifndef SEGGER_SYSVIEW_EXCLUDE_PRINTF // Define in project to avoid warnings about variable parameter list
|
||||
void SEGGER_SYSVIEW_PrintfHostEx (const char* s, U32 Options, ...);
|
||||
void SEGGER_SYSVIEW_VPrintfHostEx (const char* s, U32 Options, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_PrintfTargetEx (const char* s, U32 Options, ...);
|
||||
void SEGGER_SYSVIEW_VPrintfTargetEx (const char* s, U32 Options, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_PrintfHost (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VPrintfHost (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_PrintfTarget (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VPrintfTarget (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_WarnfHost (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VWarnfHost (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_WarnfTarget (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VWarnfTarget (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_ErrorfHost (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VErrorfHost (const char* s, va_list* pParamList);
|
||||
void SEGGER_SYSVIEW_ErrorfTarget (const char* s, ...);
|
||||
void SEGGER_SYSVIEW_VErrorfTarget (const char* s, va_list* pParamList);
|
||||
#endif
|
||||
|
||||
void SEGGER_SYSVIEW_Print (const char* s);
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-1-Clause
|
||||
*
|
||||
* SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -49,7 +49,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.56 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
@@ -72,8 +72,6 @@ Revision: $Rev: 26230 $
|
||||
#include "SEGGER_SYSVIEW_Conf.h"
|
||||
#include "SEGGER_RTT_Conf.h"
|
||||
|
||||
#include "esp_assert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -372,14 +370,12 @@ extern "C" {
|
||||
#define SEGGER_SYSVIEW_MAX_STRING_LEN 128
|
||||
#endif
|
||||
|
||||
ESP_STATIC_ASSERT(SEGGER_SYSVIEW_MAX_STRING_LEN < 255, "SEGGER Sysview string length must be less than 255.");
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_ID
|
||||
*
|
||||
* Description
|
||||
* It set, support encoding Evend Ids longer than 14 bit.
|
||||
* It set, support enconding Evend Ids longer than 14 bit.
|
||||
* Default
|
||||
* 1
|
||||
*/
|
||||
@@ -392,7 +388,7 @@ ESP_STATIC_ASSERT(SEGGER_SYSVIEW_MAX_STRING_LEN < 255, "SEGGER Sysview string le
|
||||
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_DATA
|
||||
*
|
||||
* Description
|
||||
* It set, support encoding event data longer than 14 bit.
|
||||
* It set, support enconding event data longer than 14 bit.
|
||||
* Default
|
||||
* 0
|
||||
*/
|
||||
@@ -521,7 +517,7 @@ ESP_STATIC_ASSERT(SEGGER_SYSVIEW_MAX_STRING_LEN < 255, "SEGGER Sysview string le
|
||||
* Define: SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
|
||||
*
|
||||
* Description
|
||||
* Configure how frequently synchronization is sent in post-mortem
|
||||
* Configure how frequently syncronization is sent in post-mortem
|
||||
* mode.
|
||||
* Default
|
||||
* 8: (1 << 8) = Every 256 Events.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
|
||||
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
@@ -47,7 +47,7 @@
|
||||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* SystemView version: 3.56 *
|
||||
* SystemView version: 3.42 *
|
||||
* *
|
||||
**********************************************************************
|
||||
-------------------------- END-OF-HEADER -----------------------------
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: 'SystemView'
|
||||
version: '3.56'
|
||||
version: '3.42'
|
||||
cpe: cpe:2.3:a:segger:systemview:{}:*:*:*:*:*:*:*
|
||||
supplier: 'Organization: Espressif Systems (Shanghai) CO LTD'
|
||||
originator: 'Organization: SEGGER Microcontroller GmbH'
|
||||
|
||||
@@ -108,7 +108,7 @@ static void _cbSendTaskList(void) {
|
||||
* Called from SystemView when asked by the host, returns the
|
||||
* current system time in micro seconds.
|
||||
*/
|
||||
__attribute__((unused)) static U64 _cbGetTime(void) {
|
||||
static U64 _cbGetTime(void) {
|
||||
U64 Time;
|
||||
|
||||
Time = xTaskGetTickCountFromISR();
|
||||
@@ -260,10 +260,7 @@ void SYSVIEW_SendTaskInfo(U32 TaskID, const char* sName, unsigned Prio, U32 Stac
|
||||
*/
|
||||
// Callbacks provided to SYSTEMVIEW by FreeRTOS
|
||||
const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI = {
|
||||
/* Callback _cbGetTime locks xKernelLock inside xTaskGetTickCountFromISR, this can cause deadlock on multi-core.
|
||||
To prevent deadlock, always lock xKernelLock before s_sys_view_lock. Omitting the callback here results in sending
|
||||
SYSVIEW_EVTID_SYSTIME_CYCLES events instead of SYSVIEW_EVTID_SYSTIME_US */
|
||||
NULL,
|
||||
_cbGetTime,
|
||||
_cbSendTaskList,
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@ components/app_trace/test_apps:
|
||||
- driver
|
||||
- esp_hw_support
|
||||
disable:
|
||||
- if: IDF_TARGET in ["esp32c5", "esp32c61", "esp32h21", "esp32h4"]
|
||||
- if: IDF_TARGET in ["esp32c5", "esp32c61"]
|
||||
temporary: true
|
||||
reason: not support yet # TODO: [ESP32C5] IDF-8705, [ESP32C61] IDF-9306, [ESP32H21] IDF-11539 [ESP32H4] IDF-12325
|
||||
reason: not support yet # TODO: [ESP32C5] IDF-8705, [ESP32C61] IDF-9306
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -31,23 +31,16 @@
|
||||
#include "esp_attr.h"
|
||||
#include "esp_bootloader_desc.h"
|
||||
#include "esp_flash.h"
|
||||
#include "esp_flash_internal.h"
|
||||
|
||||
#define OTA_SLOT(i) (i & 0x0F)
|
||||
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
|
||||
#define SUB_TYPE_ID(i) (i & 0x0F)
|
||||
|
||||
/* Partial_data is word aligned so no reallocation is necessary for encrypted flash write */
|
||||
typedef struct ota_ops_entry_ {
|
||||
uint32_t handle;
|
||||
struct {
|
||||
const esp_partition_t *staging; /*!< New image will be downloaded in this staging partition. */
|
||||
const esp_partition_t *final; /*!< Final destination partition which is intended to be updated. Its type/subtype shall be used for verification. */
|
||||
bool finalize_with_copy; /*!< Flag to copy the image from staging partition to the final partition at the end of OTA update */
|
||||
} partition;
|
||||
const esp_partition_t *part;
|
||||
bool need_erase;
|
||||
uint32_t wrote_size;
|
||||
uint8_t partial_bytes;
|
||||
bool ota_resumption;
|
||||
WORD_ALIGNED_ATTR uint8_t partial_data[16];
|
||||
LIST_ENTRY(ota_ops_entry_) entries;
|
||||
} ota_ops_entry_t;
|
||||
@@ -59,8 +52,6 @@ static uint32_t s_ota_ops_last_handle = 0;
|
||||
|
||||
const static char *TAG = "esp_ota_ops";
|
||||
|
||||
static ota_ops_entry_t *get_ota_ops_entry(esp_ota_handle_t handle);
|
||||
|
||||
/* Return true if this is an OTA app partition */
|
||||
static bool is_ota_partition(const esp_partition_t *p)
|
||||
{
|
||||
@@ -120,27 +111,11 @@ static esp_ota_img_states_t set_new_state_otadata(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static ota_ops_entry_t* esp_ota_init_entry(const esp_partition_t *partition)
|
||||
{
|
||||
ota_ops_entry_t *new_entry = (ota_ops_entry_t *) calloc(1, sizeof(ota_ops_entry_t));
|
||||
if (new_entry == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LIST_INSERT_HEAD(&s_ota_ops_entries_head, new_entry, entries);
|
||||
|
||||
new_entry->partition.staging = partition;
|
||||
new_entry->partition.final = partition;
|
||||
new_entry->partition.finalize_with_copy = false;
|
||||
new_entry->handle = ++s_ota_ops_last_handle;
|
||||
|
||||
return new_entry;
|
||||
}
|
||||
|
||||
|
||||
esp_err_t esp_ota_begin(const esp_partition_t *partition, size_t image_size, esp_ota_handle_t *out_handle)
|
||||
{
|
||||
ota_ops_entry_t *new_entry;
|
||||
esp_err_t ret = ESP_OK;
|
||||
|
||||
if ((partition == NULL) || (out_handle == NULL)) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
@@ -150,148 +125,52 @@ esp_err_t esp_ota_begin(const esp_partition_t *partition, size_t image_size, esp
|
||||
return ESP_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (partition->type == ESP_PARTITION_TYPE_APP) {
|
||||
// The staging partition cannot be of type Factory, but the final partition can be.
|
||||
if (!is_ota_partition(partition)) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const esp_partition_t* running_partition = esp_ota_get_running_partition();
|
||||
if (partition == running_partition) {
|
||||
return ESP_ERR_OTA_PARTITION_CONFLICT;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
esp_ota_img_states_t ota_state_running_part;
|
||||
if (esp_ota_get_state_partition(running_partition, &ota_state_running_part) == ESP_OK) {
|
||||
if (ota_state_running_part == ESP_OTA_IMG_PENDING_VERIFY) {
|
||||
ESP_LOGE(TAG, "Running app has not confirmed state (ESP_OTA_IMG_PENDING_VERIFY)");
|
||||
return ESP_ERR_OTA_ROLLBACK_INVALID_STATE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
new_entry = esp_ota_init_entry(partition);
|
||||
if (new_entry == NULL) {
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
new_entry->need_erase = (image_size == OTA_WITH_SEQUENTIAL_WRITES);
|
||||
*out_handle = new_entry->handle;
|
||||
|
||||
if (partition->type == ESP_PARTITION_TYPE_BOOTLOADER) {
|
||||
esp_image_bootloader_offset_set(partition->address);
|
||||
}
|
||||
if (partition->type == ESP_PARTITION_TYPE_BOOTLOADER || partition->type == ESP_PARTITION_TYPE_PARTITION_TABLE) {
|
||||
esp_flash_set_dangerous_write_protection(esp_flash_default_chip, false);
|
||||
}
|
||||
|
||||
if (image_size != OTA_WITH_SEQUENTIAL_WRITES) {
|
||||
// If input image size is 0 or OTA_SIZE_UNKNOWN, erase entire partition
|
||||
size_t erase_size;
|
||||
if ((image_size == 0) || (image_size == OTA_SIZE_UNKNOWN)) {
|
||||
erase_size = partition->size;
|
||||
} else {
|
||||
erase_size = ALIGN_UP(image_size, partition->erase_size);
|
||||
}
|
||||
esp_err_t err = esp_partition_erase_range(partition, 0, erase_size);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
if (is_ota_partition(partition)) {
|
||||
esp_ota_invalidate_inactive_ota_data_slot();
|
||||
}
|
||||
#endif
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_ota_resume(const esp_partition_t *partition, const size_t erase_size, const size_t image_offset, esp_ota_handle_t *out_handle)
|
||||
{
|
||||
ota_ops_entry_t *new_entry;
|
||||
|
||||
if ((partition == NULL) || (out_handle == NULL)) {
|
||||
if (!is_ota_partition(partition)) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (image_offset > partition->size) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
partition = esp_partition_verify(partition);
|
||||
if (partition == NULL) {
|
||||
return ESP_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (partition->type == ESP_PARTITION_TYPE_APP) {
|
||||
// The staging partition cannot be of type Factory, but the final partition can be.
|
||||
if (!is_ota_partition(partition)) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
|
||||
const esp_partition_t* running_partition = esp_ota_get_running_partition();
|
||||
if (partition == running_partition) {
|
||||
return ESP_ERR_OTA_PARTITION_CONFLICT;
|
||||
}
|
||||
|
||||
new_entry = esp_ota_init_entry(partition);
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
esp_ota_img_states_t ota_state_running_part;
|
||||
if (esp_ota_get_state_partition(running_partition, &ota_state_running_part) == ESP_OK) {
|
||||
if (ota_state_running_part == ESP_OTA_IMG_PENDING_VERIFY) {
|
||||
ESP_LOGE(TAG, "Running app has not confirmed state (ESP_OTA_IMG_PENDING_VERIFY)");
|
||||
return ESP_ERR_OTA_ROLLBACK_INVALID_STATE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (image_size != OTA_WITH_SEQUENTIAL_WRITES) {
|
||||
// If input image size is 0 or OTA_SIZE_UNKNOWN, erase entire partition
|
||||
if ((image_size == 0) || (image_size == OTA_SIZE_UNKNOWN)) {
|
||||
ret = esp_partition_erase_range(partition, 0, partition->size);
|
||||
} else {
|
||||
const int aligned_erase_size = (image_size + partition->erase_size - 1) & ~(partition->erase_size - 1);
|
||||
ret = esp_partition_erase_range(partition, 0, aligned_erase_size);
|
||||
}
|
||||
if (ret != ESP_OK) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
new_entry = (ota_ops_entry_t *) calloc(1, sizeof(ota_ops_entry_t));
|
||||
if (new_entry == NULL) {
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
|
||||
if (partition->type == ESP_PARTITION_TYPE_BOOTLOADER) {
|
||||
esp_image_bootloader_offset_set(partition->address);
|
||||
}
|
||||
if (partition->type == ESP_PARTITION_TYPE_BOOTLOADER || partition->type == ESP_PARTITION_TYPE_PARTITION_TABLE) {
|
||||
esp_flash_set_dangerous_write_protection(esp_flash_default_chip, false);
|
||||
}
|
||||
LIST_INSERT_HEAD(&s_ota_ops_entries_head, new_entry, entries);
|
||||
|
||||
new_entry->ota_resumption = true;
|
||||
new_entry->wrote_size = image_offset;
|
||||
new_entry->need_erase = (erase_size == OTA_WITH_SEQUENTIAL_WRITES);
|
||||
new_entry->part = partition;
|
||||
new_entry->handle = ++s_ota_ops_last_handle;
|
||||
new_entry->need_erase = (image_size == OTA_WITH_SEQUENTIAL_WRITES);
|
||||
*out_handle = new_entry->handle;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_ota_set_final_partition(esp_ota_handle_t handle, const esp_partition_t *final, bool finalize_with_copy)
|
||||
{
|
||||
ota_ops_entry_t *it = get_ota_ops_entry(handle);
|
||||
if (final == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
if (it == NULL) {
|
||||
return ESP_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
// If OTA resumption is enabled, it->wrote_size may already contain the size of previously written data.
|
||||
// Ensure that wrote_size is zero only when OTA resumption is disabled, as any non-zero value in this case
|
||||
// indicates an invalid state.
|
||||
if (!it->ota_resumption && it->wrote_size != 0) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (it->partition.staging != final) {
|
||||
const esp_partition_t* final_partition = esp_partition_verify(final);
|
||||
if (final_partition == NULL) {
|
||||
return ESP_ERR_NOT_FOUND;
|
||||
}
|
||||
ESP_LOGI(TAG,"Staging partition - <%s>. Final partition - <%s>.", it->partition.staging->label, final_partition->label);
|
||||
it->partition.final = final_partition;
|
||||
it->partition.finalize_with_copy = finalize_with_copy;
|
||||
if (final_partition->type == ESP_PARTITION_TYPE_BOOTLOADER) {
|
||||
esp_image_bootloader_offset_set(it->partition.staging->address);
|
||||
}
|
||||
if (final_partition->type == ESP_PARTITION_TYPE_BOOTLOADER || final_partition->type == ESP_PARTITION_TYPE_PARTITION_TABLE) {
|
||||
esp_flash_set_dangerous_write_protection(esp_flash_default_chip, false);
|
||||
}
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
|
||||
{
|
||||
const uint8_t *data_bytes = (const uint8_t *)data;
|
||||
@@ -313,33 +192,23 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
|
||||
if (it->handle == handle) {
|
||||
if (it->need_erase) {
|
||||
// must erase the partition before writing to it
|
||||
uint32_t first_sector = it->wrote_size / it->partition.staging->erase_size; // first affected sector
|
||||
uint32_t last_sector = (it->wrote_size + size - 1) / it->partition.staging->erase_size; // last affected sector
|
||||
uint32_t first_sector = it->wrote_size / it->part->erase_size; // first affected sector
|
||||
uint32_t last_sector = (it->wrote_size + size - 1) / it->part->erase_size; // last affected sector
|
||||
|
||||
ret = ESP_OK;
|
||||
if ((it->wrote_size % it->partition.staging->erase_size) == 0) {
|
||||
ret = esp_partition_erase_range(it->partition.staging, it->wrote_size, ((last_sector - first_sector) + 1) * it->partition.staging->erase_size);
|
||||
if ((it->wrote_size % it->part->erase_size) == 0) {
|
||||
ret = esp_partition_erase_range(it->part, it->wrote_size, ((last_sector - first_sector) + 1) * it->part->erase_size);
|
||||
} else if (first_sector != last_sector) {
|
||||
ret = esp_partition_erase_range(it->partition.staging, (first_sector + 1) * it->partition.staging->erase_size, (last_sector - first_sector) * it->partition.staging->erase_size);
|
||||
ret = esp_partition_erase_range(it->part, (first_sector + 1) * it->part->erase_size, (last_sector - first_sector) * it->part->erase_size);
|
||||
}
|
||||
if (ret != ESP_OK) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (it->wrote_size == 0 && it->partial_bytes == 0 && size > 0) {
|
||||
if (it->partition.final->type == ESP_PARTITION_TYPE_APP || it->partition.final->type == ESP_PARTITION_TYPE_BOOTLOADER) {
|
||||
if (data_bytes[0] != ESP_IMAGE_HEADER_MAGIC) {
|
||||
ESP_LOGE(TAG, "OTA image has invalid magic byte (expected 0xE9, saw 0x%02x)", data_bytes[0]);
|
||||
return ESP_ERR_OTA_VALIDATE_FAILED;
|
||||
}
|
||||
|
||||
} else if (it->partition.final->type == ESP_PARTITION_TYPE_PARTITION_TABLE) {
|
||||
if (*(uint16_t*)data_bytes != (uint16_t)ESP_PARTITION_MAGIC) {
|
||||
ESP_LOGE(TAG, "Partition table image has invalid magic word (expected 0x50AA, saw 0x%04x)", *(uint16_t*)data_bytes);
|
||||
return ESP_ERR_OTA_VALIDATE_FAILED;
|
||||
}
|
||||
}
|
||||
if (it->wrote_size == 0 && it->partial_bytes == 0 && size > 0 && data_bytes[0] != ESP_IMAGE_HEADER_MAGIC) {
|
||||
ESP_LOGE(TAG, "OTA image has invalid magic byte (expected 0xE9, saw 0x%02x)", data_bytes[0]);
|
||||
return ESP_ERR_OTA_VALIDATE_FAILED;
|
||||
}
|
||||
|
||||
if (esp_flash_encryption_enabled()) {
|
||||
@@ -355,7 +224,7 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
|
||||
return ESP_OK; /* nothing to write yet, just filling buffer */
|
||||
}
|
||||
/* write 16 byte to partition */
|
||||
ret = esp_partition_write(it->partition.staging, it->wrote_size, it->partial_data, 16);
|
||||
ret = esp_partition_write(it->part, it->wrote_size, it->partial_data, 16);
|
||||
if (ret != ESP_OK) {
|
||||
return ret;
|
||||
}
|
||||
@@ -374,7 +243,7 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size)
|
||||
}
|
||||
}
|
||||
|
||||
ret = esp_partition_write(it->partition.staging, it->wrote_size, data_bytes, size);
|
||||
ret = esp_partition_write(it->part, it->wrote_size, data_bytes, size);
|
||||
if(ret == ESP_OK){
|
||||
it->wrote_size += size;
|
||||
}
|
||||
@@ -411,7 +280,7 @@ esp_err_t esp_ota_write_with_offset(esp_ota_handle_t handle, const void *data, s
|
||||
ESP_LOGE(TAG, "Size should be 16byte aligned for flash encryption case");
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
ret = esp_partition_write(it->partition.staging, offset, data_bytes, size);
|
||||
ret = esp_partition_write(it->part, offset, data_bytes, size);
|
||||
if (ret == ESP_OK) {
|
||||
it->wrote_size += size;
|
||||
}
|
||||
@@ -447,34 +316,6 @@ esp_err_t esp_ota_abort(esp_ota_handle_t handle)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t ota_verify_partition(ota_ops_entry_t *ota_ops)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
if (ota_ops->partition.final->type == ESP_PARTITION_TYPE_APP || ota_ops->partition.final->type == ESP_PARTITION_TYPE_BOOTLOADER) {
|
||||
esp_image_metadata_t data;
|
||||
const esp_partition_pos_t part_pos = {
|
||||
.offset = ota_ops->partition.staging->address,
|
||||
.size = ota_ops->partition.staging->size,
|
||||
};
|
||||
if (esp_image_verify(ESP_IMAGE_VERIFY, &part_pos, &data) != ESP_OK) {
|
||||
return ESP_ERR_OTA_VALIDATE_FAILED;
|
||||
}
|
||||
} else if (ota_ops->partition.final->type == ESP_PARTITION_TYPE_PARTITION_TABLE) {
|
||||
const esp_partition_info_t *partition_table = NULL;
|
||||
esp_partition_mmap_handle_t partition_table_map;
|
||||
ret = esp_partition_mmap(ota_ops->partition.staging, 0, ESP_PARTITION_TABLE_MAX_LEN, ESP_PARTITION_MMAP_DATA, (const void**)&partition_table, &partition_table_map);
|
||||
if (ret == ESP_OK) {
|
||||
int num_partitions;
|
||||
if (esp_partition_table_verify(partition_table, true, &num_partitions) != ESP_OK) {
|
||||
esp_partition_munmap(partition_table_map);
|
||||
return ESP_ERR_OTA_VALIDATE_FAILED;
|
||||
}
|
||||
esp_partition_munmap(partition_table_map);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t esp_ota_end(esp_ota_handle_t handle)
|
||||
{
|
||||
ota_ops_entry_t *it = get_ota_ops_entry(handle);
|
||||
@@ -494,7 +335,7 @@ esp_err_t esp_ota_end(esp_ota_handle_t handle)
|
||||
|
||||
if (it->partial_bytes > 0) {
|
||||
/* Write out last 16 bytes, if necessary */
|
||||
ret = esp_partition_write(it->partition.staging, it->wrote_size, it->partial_data, 16);
|
||||
ret = esp_partition_write(it->part, it->wrote_size, it->partial_data, 16);
|
||||
if (ret != ESP_OK) {
|
||||
ret = ESP_ERR_INVALID_STATE;
|
||||
goto cleanup;
|
||||
@@ -503,21 +344,18 @@ esp_err_t esp_ota_end(esp_ota_handle_t handle)
|
||||
it->partial_bytes = 0;
|
||||
}
|
||||
|
||||
ret = ota_verify_partition(it);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "New image failed verification");
|
||||
} else {
|
||||
if (it->partition.finalize_with_copy) {
|
||||
ESP_LOGI(TAG, "Copy from <%s> staging partition to <%s>...", it->partition.staging->label, it->partition.final->label);
|
||||
ret = esp_partition_copy(it->partition.final, 0, it->partition.staging, 0, it->partition.final->size);
|
||||
}
|
||||
esp_image_metadata_t data;
|
||||
const esp_partition_pos_t part_pos = {
|
||||
.offset = it->part->address,
|
||||
.size = it->part->size,
|
||||
};
|
||||
|
||||
if (esp_image_verify(ESP_IMAGE_VERIFY, &part_pos, &data) != ESP_OK) {
|
||||
ret = ESP_ERR_OTA_VALIDATE_FAILED;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (it->partition.final->type == ESP_PARTITION_TYPE_BOOTLOADER) {
|
||||
// In esp_ota_begin, bootloader offset was updated, here we return it to default.
|
||||
esp_image_bootloader_offset_set(ESP_PRIMARY_BOOTLOADER_OFFSET);
|
||||
}
|
||||
LIST_REMOVE(it, entries);
|
||||
free(it);
|
||||
return ret;
|
||||
@@ -539,69 +377,6 @@ static esp_err_t rewrite_ota_seq(esp_ota_select_entry_t *two_otadata, uint32_t s
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Calculate the next OTA sequence number that will boot the given OTA slot.
|
||||
*
|
||||
* Based on the ESP-IDF OTA boot scheme, the system selects the OTA slot to boot by:
|
||||
* boot_slot = (seq - 1) % ota_app_count
|
||||
*
|
||||
* This function determines the required seq value that would cause the given ota_slot_idx
|
||||
* to be selected on next boot.
|
||||
*
|
||||
* @param current_seq Current active OTA sequence number
|
||||
* @param ota_slot_idx Target OTA slot index (0-based)
|
||||
* @param ota_app_count Total number of OTA slots
|
||||
*
|
||||
* @return New sequence number that will result in booting ota_slot_idx
|
||||
*/
|
||||
static uint32_t compute_ota_seq_for_target_slot(uint32_t current_seq, uint32_t ota_slot_idx, uint8_t ota_app_count)
|
||||
{
|
||||
if (ota_app_count == 0) {
|
||||
return 0;
|
||||
}
|
||||
/* ESP-IDF stores OTA boot information in the OTA data partition, which consists of two sectors.
|
||||
* Each sector holds an esp_ota_select_entry_t structure: otadata[0] and otadata[1].
|
||||
* These structures record the OTA sequence number (ota_seq) used to determine the current boot partition.
|
||||
*
|
||||
* Boot selection logic:
|
||||
* - If both otadata[0].ota_seq and otadata[1].ota_seq are 0xFFFFFFFF (invalid), it is the initial state:
|
||||
* → Boot the factory app, if it exists.
|
||||
* → Otherwise, fall back to booting ota[0].
|
||||
*
|
||||
* - If both otadata entries have valid sequence numbers and CRCs:
|
||||
* → Choose the higher sequence number (max_seq).
|
||||
* → Determine the OTA partition for boot (or running partition) using:
|
||||
* running_ota_slot = (max_seq - 1) % ota_app_count
|
||||
* where ota_app_count is the total number of OTA app partitions.
|
||||
*
|
||||
* Example:
|
||||
* otadata[0].ota_seq = 4
|
||||
* otadata[1].ota_seq = 5
|
||||
* ota_app_count = 8 (available OTA slots: ota_0 to ota_7)
|
||||
* → max_seq = 5
|
||||
* → running slot = (5 - 1) % 8 = 4
|
||||
* → So ota_4 is currently running
|
||||
*
|
||||
* If you want to switch to boot a different OTA slot (e.g., ota_7):
|
||||
* → You need to compute a new sequence number such that:
|
||||
* (new_seq - 1) % ota_app_count == 7
|
||||
* while ensuring new_seq > current_seq.
|
||||
*
|
||||
* General formula:
|
||||
* x = current OTA slot ID
|
||||
* ota_slot_idx = desired OTA slot ID
|
||||
* seq = current ota_seq
|
||||
*
|
||||
* To find the next ota_seq that will boot ota_y, use:
|
||||
* new_seq = ((ota_slot_idx + 1) % ota_app_count) + ota_app_count * i;
|
||||
* // where i is the smallest non-negative integer such that new_seq > seq
|
||||
*/
|
||||
uint32_t i = 0;
|
||||
uint32_t base = (ota_slot_idx + 1) % ota_app_count;
|
||||
while (current_seq > (base + i * ota_app_count)) { i++; };
|
||||
return base + i * ota_app_count;
|
||||
}
|
||||
|
||||
uint8_t esp_ota_get_app_partition_count(void)
|
||||
{
|
||||
uint16_t ota_app_count = 0;
|
||||
@@ -612,30 +387,6 @@ uint8_t esp_ota_get_app_partition_count(void)
|
||||
return ota_app_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update the OTA data partition to set the given OTA app subtype as the next boot target.
|
||||
*
|
||||
* ESP-IDF uses the OTA data partition to track which OTA app should boot.
|
||||
* This partition contains two entries (otadata[0] and otadata[1]), each storing an esp_ota_select_entry_t struct,
|
||||
* which includes the OTA sequence number (ota_seq).
|
||||
*
|
||||
* On boot, the chip determines the current running OTA slot using:
|
||||
* current_slot = (max(ota_seq) - 1) % ota_app_count
|
||||
*
|
||||
* This function updates the OTA data to switch the next boot to the partition with the given subtype.
|
||||
*
|
||||
* Behavior:
|
||||
* - If the currently selected OTA slot already matches the requested subtype,
|
||||
* only the state field is updated (e.g., to mark the app as newly downloaded).
|
||||
* - Otherwise, it calculates the next valid ota_seq that will cause the bootloader to select
|
||||
* the requested OTA slot on reboot, and writes it to the inactive OTA data sector.
|
||||
*
|
||||
* @param subtype The OTA partition subtype (e.g., ESP_PARTITION_SUBTYPE_APP_OTA_0, ..._OTA_1, ...)
|
||||
* @return
|
||||
* - ESP_OK if update was successful
|
||||
* - ESP_ERR_NOT_FOUND if OTA data partition not found
|
||||
* - ESP_ERR_INVALID_ARG if subtype is out of range
|
||||
*/
|
||||
static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
|
||||
{
|
||||
esp_ota_select_entry_t otadata[2];
|
||||
@@ -645,31 +396,42 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
|
||||
}
|
||||
|
||||
uint8_t ota_app_count = esp_ota_get_app_partition_count();
|
||||
if (OTA_SLOT(subtype) >= ota_app_count) {
|
||||
if (SUB_TYPE_ID(subtype) >= ota_app_count) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//esp32_idf use two sector for store information about which partition is running
|
||||
//it defined the two sector as ota data partition,two structure esp_ota_select_entry_t is saved in the two sector
|
||||
//named data in first sector as otadata[0], second sector data as otadata[1]
|
||||
//e.g.
|
||||
//if otadata[0].ota_seq == otadata[1].ota_seq == 0xFFFFFFFF,means ota info partition is in init status
|
||||
//so it will boot factory application(if there is),if there's no factory application,it will boot ota[0] application
|
||||
//if otadata[0].ota_seq != 0 and otadata[1].ota_seq != 0,it will choose a max seq ,and get value of max_seq%max_ota_app_number
|
||||
//and boot a subtype (mask 0x0F) value is (max_seq - 1)%max_ota_app_number,so if want switch to run ota[x],can use next formulas.
|
||||
//for example, if otadata[0].ota_seq = 4, otadata[1].ota_seq = 5, and there are 8 ota application,
|
||||
//current running is (5-1)%8 = 4,running ota[4],so if we want to switch to run ota[7],
|
||||
//we should add otadata[0].ota_seq (is 4) to 4 ,(8-1)%8=7,then it will boot ota[7]
|
||||
//if A=(B - C)%D
|
||||
//then B=(A + C)%D + D*n ,n= (0,1,2...)
|
||||
//so current ota app sub type id is x , dest bin subtype is y,total ota app count is n
|
||||
//seq will add (x + n*1 + 1 - seq)%n
|
||||
|
||||
int active_otadata = bootloader_common_get_active_otadata(otadata);
|
||||
int next_otadata;
|
||||
uint32_t new_seq;
|
||||
if (active_otadata != -1) {
|
||||
uint32_t ota_slot = (otadata[active_otadata].ota_seq - 1) % ota_app_count;
|
||||
if (ota_slot == OTA_SLOT(subtype)) {
|
||||
// ota_data is already valid and points to the correct OTA slot.
|
||||
// So after reboot the requested partition will be selected for boot.
|
||||
// Only update the ota_state of the requested partition.
|
||||
next_otadata = active_otadata;
|
||||
new_seq = otadata[active_otadata].ota_seq;
|
||||
} else {
|
||||
next_otadata = (~active_otadata) & 1; // if 0 -> will be next 1. and if 1 -> will be next 0.
|
||||
new_seq = compute_ota_seq_for_target_slot(otadata[active_otadata].ota_seq, OTA_SLOT(subtype), ota_app_count);
|
||||
uint32_t seq = otadata[active_otadata].ota_seq;
|
||||
uint32_t i = 0;
|
||||
while (seq > (SUB_TYPE_ID(subtype) + 1) % ota_app_count + i * ota_app_count) {
|
||||
i++;
|
||||
}
|
||||
int next_otadata = (~active_otadata)&1; // if 0 -> will be next 1. and if 1 -> will be next 0.
|
||||
otadata[next_otadata].ota_state = set_new_state_otadata();
|
||||
return rewrite_ota_seq(otadata, (SUB_TYPE_ID(subtype) + 1) % ota_app_count + i * ota_app_count, next_otadata, otadata_partition);
|
||||
} else {
|
||||
/* Both OTA slots are invalid, probably because unformatted... */
|
||||
next_otadata = 0;
|
||||
new_seq = OTA_SLOT(subtype) + 1;
|
||||
int next_otadata = 0;
|
||||
otadata[next_otadata].ota_state = set_new_state_otadata();
|
||||
return rewrite_ota_seq(otadata, SUB_TYPE_ID(subtype) + 1, next_otadata, otadata_partition);
|
||||
}
|
||||
otadata[next_otadata].ota_state = set_new_state_otadata();
|
||||
return rewrite_ota_seq(otadata, new_seq, next_otadata, otadata_partition);
|
||||
}
|
||||
|
||||
esp_err_t esp_ota_set_boot_partition(const esp_partition_t *partition)
|
||||
@@ -1008,7 +770,8 @@ static esp_err_t esp_ota_current_ota_is_workable(bool valid)
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
ESP_LOGI(TAG, "Rollback to previously worked partition.");
|
||||
ESP_LOGI(TAG, "Rollback to previously worked partition. Restart.");
|
||||
esp_restart();
|
||||
}
|
||||
} else {
|
||||
ESP_LOGE(TAG, "Running firmware is factory");
|
||||
@@ -1022,18 +785,9 @@ esp_err_t esp_ota_mark_app_valid_cancel_rollback(void)
|
||||
return esp_ota_current_ota_is_workable(true);
|
||||
}
|
||||
|
||||
esp_err_t esp_ota_mark_app_invalid_rollback(void)
|
||||
{
|
||||
return esp_ota_current_ota_is_workable(false);
|
||||
}
|
||||
|
||||
esp_err_t esp_ota_mark_app_invalid_rollback_and_reboot(void)
|
||||
{
|
||||
esp_err_t ret = esp_ota_mark_app_invalid_rollback();
|
||||
if (ret == ESP_OK) {
|
||||
esp_restart();
|
||||
}
|
||||
return ret;
|
||||
return esp_ota_current_ota_is_workable(false);
|
||||
}
|
||||
|
||||
static bool check_invalid_otadata (const esp_ota_select_entry_t *s) {
|
||||
@@ -1114,7 +868,7 @@ esp_err_t esp_ota_get_state_partition(const esp_partition_t *partition, esp_ota_
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t erase_last_boot_app_partition(bool skip_app_part_erase)
|
||||
esp_err_t esp_ota_erase_last_boot_app_partition(void)
|
||||
{
|
||||
esp_ota_select_entry_t otadata[2];
|
||||
const esp_partition_t* ota_data_partition = read_otadata(otadata);
|
||||
@@ -1146,15 +900,13 @@ static esp_err_t erase_last_boot_app_partition(bool skip_app_part_erase)
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
if (!skip_app_part_erase) {
|
||||
esp_err_t err = esp_partition_erase_range(last_boot_app_partition_from_otadata, 0, last_boot_app_partition_from_otadata->size);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
esp_err_t err = esp_partition_erase_range(last_boot_app_partition_from_otadata, 0, last_boot_app_partition_from_otadata->size);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
int sec_id = inactive_otadata;
|
||||
esp_err_t err = esp_partition_erase_range(ota_data_partition, sec_id * ota_data_partition->erase_size, ota_data_partition->erase_size);
|
||||
err = esp_partition_erase_range(ota_data_partition, sec_id * ota_data_partition->erase_size, ota_data_partition->erase_size);
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
@@ -1162,16 +914,6 @@ static esp_err_t erase_last_boot_app_partition(bool skip_app_part_erase)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_ota_erase_last_boot_app_partition(void)
|
||||
{
|
||||
return erase_last_boot_app_partition(false);
|
||||
}
|
||||
|
||||
esp_err_t esp_ota_invalidate_inactive_ota_data_slot(void)
|
||||
{
|
||||
return erase_last_boot_app_partition(true);
|
||||
}
|
||||
|
||||
#if SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY && CONFIG_SECURE_BOOT_V2_ENABLED
|
||||
|
||||
// Validates the image at "app_pos" with the secure boot digests other than "revoked_key_index"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -82,12 +82,7 @@ int esp_ota_get_app_elf_sha256(char* dst, size_t size) __attribute__((deprecated
|
||||
* it will lead to the ESP_ERR_OTA_ROLLBACK_INVALID_STATE error. Confirm the running app before to run download a new app,
|
||||
* use esp_ota_mark_app_valid_cancel_rollback() function for it (this should be done as early as possible when you first download a new application).
|
||||
*
|
||||
* Note: Rollback is applicable only for app type partitions.
|
||||
* Note: For Rollback - The OTA data slot corresponding to the last boot application partition will be invalidated.
|
||||
*
|
||||
* @param partition Pointer to info for partition which will receive the OTA update. Required.
|
||||
* This is considered as the staging partition (where OTA is downloaded), be default this also considered as the final partition which supposed to be updated.
|
||||
* The final partition can be overwritten using esp_ota_set_final_partition() after calling esp_ota_begin() to relocate contents to the final destination partition.
|
||||
* @param partition Pointer to info for partition which will receive the OTA update. Required.
|
||||
* @param image_size Size of new OTA app image. Partition will be erased in order to receive this size of image. If 0 or OTA_SIZE_UNKNOWN, the entire partition is erased.
|
||||
* @param out_handle On success, returns a handle which should be used for subsequent esp_ota_write() and esp_ota_end() calls.
|
||||
|
||||
@@ -104,57 +99,6 @@ int esp_ota_get_app_elf_sha256(char* dst, size_t size) __attribute__((deprecated
|
||||
*/
|
||||
esp_err_t esp_ota_begin(const esp_partition_t* partition, size_t image_size, esp_ota_handle_t* out_handle);
|
||||
|
||||
/**
|
||||
* @brief Resume an interrupted OTA update by continuing to write to the specified partition.
|
||||
*
|
||||
* This function is used when an OTA update was previously started and needs to be resumed after an interruption.
|
||||
* It continues the OTA process from the specified offset within the partition.
|
||||
*
|
||||
* Unlike esp_ota_begin(), this function does not erase the partition which receives the OTA update, but rather expects that part of the image
|
||||
* has already been written correctly, and it resumes writing from the given offset.
|
||||
*
|
||||
* @param partition Pointer to info for the partition which is receiving the OTA update. Required.
|
||||
* @param erase_size Specifies how much flash memory to erase before resuming OTA, depending on whether a sequential write or a bulk erase is being used.
|
||||
* @param image_offset Offset from where to resume the OTA process. Should be set to the number of bytes already written.
|
||||
* @param out_handle On success, returns a handle that should be used for subsequent esp_ota_write() and esp_ota_end() calls.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: OTA operation resumed successfully.
|
||||
* - ESP_ERR_INVALID_ARG: partition, out_handle were NULL or image_offset arguments is negative, or partition doesn't point to an OTA app partition.
|
||||
* - ESP_ERR_NO_MEM: Cannot allocate memory for OTA operation.
|
||||
* - ESP_ERR_OTA_PARTITION_CONFLICT: Partition holds the currently running firmware, cannot update in place.
|
||||
* - ESP_ERR_NOT_FOUND: Partition argument not found in partition table.
|
||||
* - ESP_ERR_OTA_SELECT_INFO_INVALID: The OTA data partition contains invalid data.
|
||||
* - ESP_ERR_INVALID_SIZE: Partition doesn't fit in configured flash size.
|
||||
* - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed.
|
||||
*/
|
||||
esp_err_t esp_ota_resume(const esp_partition_t *partition, const size_t erase_size, const size_t image_offset, esp_ota_handle_t *out_handle);
|
||||
|
||||
/**
|
||||
* @brief Set the final destination partition for OTA update
|
||||
*
|
||||
* This function configures the specified final partition as the destination for the OTA update.
|
||||
* It also allows setting a flag to indicate if the image should be copied from the staging
|
||||
* partition to the final partition after the OTA update completes. Otherwise, copying will need
|
||||
* to be handled by custom code using esp_partition_copy().
|
||||
*
|
||||
* @note This can be called after esp_ota_begin() and before the OTA update has started (before esp_ota_write()).
|
||||
*
|
||||
* @param handle OTA update handle obtained from esp_ota_begin().
|
||||
* @param final Pointer to the final destination partition where the new image will be verified and potentially finalized.
|
||||
* This partition must not be NULL.
|
||||
* @param finalize_with_copy Boolean flag indicating if the downloaded image should be copied
|
||||
* from the staging partition to the final partition upon completion.
|
||||
* Set to False if you intend to perform the final copy process manually later.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: final destination partition set successfully.
|
||||
* - ESP_ERR_INVALID_STATE: Once the OTA update has started, changing the final destination partition is prohibited.
|
||||
* - ESP_ERR_INVALID_ARG: Invalid arguments were passed (e.g., final partition is NULL).
|
||||
* - ESP_ERR_NOT_FOUND: OTA handle not found or final partition verification failed.
|
||||
*/
|
||||
esp_err_t esp_ota_set_final_partition(esp_ota_handle_t handle, const esp_partition_t *final, bool finalize_with_copy);
|
||||
|
||||
/**
|
||||
* @brief Write OTA update data to partition
|
||||
*
|
||||
@@ -169,8 +113,9 @@ esp_err_t esp_ota_set_final_partition(esp_ota_handle_t handle, const esp_partiti
|
||||
* @return
|
||||
* - ESP_OK: Data was written to flash successfully, or size = 0
|
||||
* - ESP_ERR_INVALID_ARG: handle is invalid.
|
||||
* - ESP_ERR_OTA_VALIDATE_FAILED: First byte of image contains invalid image magic byte.
|
||||
* - 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.
|
||||
*/
|
||||
@@ -193,7 +138,9 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void* data, size_t size);
|
||||
* @return
|
||||
* - ESP_OK: Data was written to flash successfully.
|
||||
* - ESP_ERR_INVALID_ARG: handle is invalid.
|
||||
* - 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_t esp_ota_write_with_offset(esp_ota_handle_t handle, const void *data, size_t size, uint32_t offset);
|
||||
|
||||
@@ -203,11 +150,6 @@ esp_err_t esp_ota_write_with_offset(esp_ota_handle_t handle, const void *data, s
|
||||
* @param handle Handle obtained from esp_ota_begin().
|
||||
*
|
||||
* @note After calling esp_ota_end(), the handle is no longer valid and any memory associated with it is freed (regardless of result).
|
||||
* @note If either the final or staging partitions were for the bootloader, then at the end of this function,
|
||||
* the bootloader is reset to its default offset: esp_image_bootloader_offset_set(ESP_PRIMARY_BOOTLOADER_OFFSET)
|
||||
*
|
||||
* If the finalize_with_copy option is set, the staging partition will be copied to the final partition at the end of this function.
|
||||
* Otherwise, copying will need to be handled by custom code using esp_partition_copy().
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Newly written OTA app image is valid.
|
||||
@@ -316,7 +258,7 @@ esp_err_t esp_ota_get_partition_description(const esp_partition_t *partition, es
|
||||
* @brief Returns the description structure of the bootloader.
|
||||
*
|
||||
* @param[in] bootloader_partition Pointer to bootloader partition.
|
||||
* If NULL, then the PRIMARY bootloader is used (the default location).
|
||||
* If NULL, then the current bootloader is used (the default location).
|
||||
* offset = CONFIG_BOOTLOADER_OFFSET_IN_FLASH,
|
||||
* size = CONFIG_PARTITION_TABLE_OFFSET - CONFIG_BOOTLOADER_OFFSET_IN_FLASH,
|
||||
* @param[out] desc Structure of info about bootloader.
|
||||
@@ -329,20 +271,6 @@ esp_err_t esp_ota_get_partition_description(const esp_partition_t *partition, es
|
||||
*/
|
||||
esp_err_t esp_ota_get_bootloader_description(const esp_partition_t *bootloader_partition, esp_bootloader_desc_t *desc);
|
||||
|
||||
/**
|
||||
* @brief Invalidate the OTA data slot associated with the last boot application partition.
|
||||
*
|
||||
* This function erases the OTA data slot corresponding to the last boot application partition,
|
||||
* making the partition invalid for booting in future. The application partition itself
|
||||
* is not erased, preserving its contents.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Successfully invalidated the OTA data slot.
|
||||
* - ESP_FAIL: Failed to invalidate the OTA data slot (e.g., invalid parameters, no OTA data partition, or other errors).
|
||||
* - Other error codes from `esp_partition_erase_range`.
|
||||
*/
|
||||
esp_err_t esp_ota_invalidate_inactive_ota_data_slot(void);
|
||||
|
||||
/**
|
||||
* @brief Returns number of ota partitions provided in partition table.
|
||||
*
|
||||
@@ -359,24 +287,12 @@ uint8_t esp_ota_get_app_partition_count(void);
|
||||
*/
|
||||
esp_err_t esp_ota_mark_app_valid_cancel_rollback(void);
|
||||
|
||||
/**
|
||||
* @brief This function is called to roll back to the previously workable app without reboot.
|
||||
*
|
||||
* Checks applications on a flash drive that can be booted in case of rollback.
|
||||
* If the flash does not have at least one app (except the running app) then rollback is not possible.
|
||||
* @return
|
||||
* - ESP_OK: if successful.
|
||||
* - ESP_FAIL: if not successful.
|
||||
* - ESP_ERR_OTA_ROLLBACK_FAILED: The rollback is not possible because the available OTA partitions
|
||||
* on the flash do not contain a valid application.
|
||||
*/
|
||||
esp_err_t esp_ota_mark_app_invalid_rollback(void);
|
||||
|
||||
/**
|
||||
* @brief This function is called to roll back to the previously workable app with reboot.
|
||||
*
|
||||
* Equivalent to calling esp_ota_mark_app_invalid_rollback(), and, if successful, followed by esp_restart().
|
||||
*
|
||||
* If rollback is successful then device will reset else API will return with error code.
|
||||
* Checks applications on a flash drive that can be booted in case of rollback.
|
||||
* If the flash does not have at least one app (except the running app) then rollback is not possible.
|
||||
* @return
|
||||
* - ESP_FAIL: if not successful.
|
||||
* - ESP_ERR_OTA_ROLLBACK_FAILED: The rollback is not possible due to flash does not have any apps.
|
||||
|
||||
@@ -2,20 +2,11 @@
|
||||
|
||||
components/app_update/test_apps:
|
||||
enable:
|
||||
- if: CONFIG_NAME == "defaults" and IDF_TARGET in ["esp32", "esp32c2", "esp32c3", "esp32c5", "esp32c6", "esp32c61", "esp32h2", "esp32p4", "esp32s2", "esp32s3"]
|
||||
- if: CONFIG_NAME == "rollback" and IDF_TARGET in ["esp32", "esp32c3", "esp32s3", "esp32p4"]
|
||||
- if: CONFIG_NAME == "xip_psram" and SOC_SPIRAM_XIP_SUPPORTED == 1
|
||||
- if: CONFIG_NAME == "defaults" and IDF_TARGET != "linux"
|
||||
- if: CONFIG_NAME == "xip_psram" and IDF_TARGET in ["esp32s2", "esp32s3", "esp32p4"]
|
||||
# S2 doesn't have ROM for flash
|
||||
- if: CONFIG_NAME == "xip_psram_with_rom_impl" and (SOC_SPIRAM_XIP_SUPPORTED == 1 and IDF_TARGET != "esp32s2")
|
||||
- if: CONFIG_NAME == "recovery_bootloader" and SOC_RECOVERY_BOOTLOADER_SUPPORTED == 1
|
||||
- if: CONFIG_NAME == "xip_psram_with_rom_impl" and IDF_TARGET in ["esp32s3", "esp32p4"]
|
||||
disable:
|
||||
- if: IDF_TARGET in ["esp32h21", "esp32h4"]
|
||||
- if: IDF_TARGET in ["esp32c61"]
|
||||
temporary: true
|
||||
reason: not supported yet # TODO: [ESP32H21] IDF-11515, [ESP32H4] IDF-12279
|
||||
- if: IDF_TARGET == "esp32c61" and CONFIG_NAME == "xip_psram_with_rom_impl"
|
||||
temporary: true
|
||||
reason: not supported yet # TODO: [ESP32C61] IDF-12784
|
||||
disable_test:
|
||||
- if: CONFIG_NAME == "recovery_bootloader" and SOC_RECOVERY_BOOTLOADER_SUPPORTED == 1 and IDF_TARGET == "esp32c61"
|
||||
temporary: true
|
||||
reason: lack of runners # TODO: [ESP32C61] IDF-13165
|
||||
reason: target esp32c61 is not supported yet # TODO: [ESP32C61] IDF-9245
|
||||
|
||||
@@ -1,15 +1,4 @@
|
||||
idf_component_register(
|
||||
SRC_DIRS "."
|
||||
PRIV_INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES
|
||||
cmock
|
||||
test_utils
|
||||
app_update
|
||||
bootloader_support
|
||||
nvs_flash
|
||||
driver
|
||||
spi_flash
|
||||
esp_psram
|
||||
efuse
|
||||
WHOLE_ARCHIVE
|
||||
)
|
||||
idf_component_register(SRC_DIRS "."
|
||||
PRIV_INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash esp_psram
|
||||
WHOLE_ARCHIVE)
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/*
|
||||
* Tests bootloader update.
|
||||
*/
|
||||
|
||||
#include "unity.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_efuse.h"
|
||||
#include "esp_flash_internal.h"
|
||||
#include "esp_rom_sys.h"
|
||||
#include "utils_update.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#define BOOT_COUNT_NAMESPACE "boot_count"
|
||||
|
||||
static __attribute__((unused)) const char *TAG = "btldr_update";
|
||||
|
||||
#if CONFIG_BOOTLOADER_RECOVERY_ENABLE
|
||||
|
||||
/* @brief Checks and prepares the partition so that the factory app is launched after that.
|
||||
*/
|
||||
static void start_test(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "boot count 1 - reset");
|
||||
set_boot_count_in_nvs(1);
|
||||
erase_ota_data();
|
||||
ESP_LOGI(TAG, "ota_data erased");
|
||||
ESP_LOGI(TAG, "Bootloader offset: 0x%x", esp_rom_get_bootloader_offset());
|
||||
reboot_as_deep_sleep();
|
||||
}
|
||||
|
||||
static void test_flow1(void)
|
||||
{
|
||||
uint8_t boot_count = get_boot_count_from_nvs();
|
||||
boot_count++;
|
||||
set_boot_count_in_nvs(boot_count);
|
||||
ESP_LOGI(TAG, "boot count %d", boot_count);
|
||||
|
||||
ESP_LOGI(TAG, "Bootloader offset: 0x%x", esp_rom_get_bootloader_offset());
|
||||
|
||||
const esp_partition_t *primary_bootloader;
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, ESP_PRIMARY_BOOTLOADER_OFFSET, ESP_BOOTLOADER_SIZE, "PrimaryBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_PRIMARY, &primary_bootloader));
|
||||
const esp_partition_t *recovery_bootloader;
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, CONFIG_BOOTLOADER_RECOVERY_OFFSET, ESP_BOOTLOADER_SIZE, "RecoveryBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_RECOVERY, &recovery_bootloader));
|
||||
ESP_LOGI(TAG, "Bootloaders are registered");
|
||||
|
||||
// Remove write protection for the bootloader
|
||||
esp_flash_set_dangerous_write_protection(esp_flash_default_chip, false);
|
||||
switch (boot_count) {
|
||||
case 2:
|
||||
TEST_ASSERT_EQUAL_HEX32(ESP_PRIMARY_BOOTLOADER_OFFSET, esp_rom_get_bootloader_offset());
|
||||
|
||||
TEST_ESP_OK(esp_partition_erase_range(recovery_bootloader, 0, recovery_bootloader->size));
|
||||
ESP_LOGI(TAG, "Erase recovery bootloader");
|
||||
|
||||
TEST_ESP_OK(esp_efuse_set_recovery_bootloader_offset(CONFIG_BOOTLOADER_RECOVERY_OFFSET));
|
||||
|
||||
ESP_LOGI(TAG, "Backup, copy <%s> -> <%s>", primary_bootloader->label, recovery_bootloader->label);
|
||||
TEST_ESP_OK(esp_partition_copy(recovery_bootloader, 0, primary_bootloader, 0, primary_bootloader->size));
|
||||
|
||||
TEST_ESP_OK(esp_partition_erase_range(primary_bootloader, 0, primary_bootloader->size));
|
||||
ESP_LOGI(TAG, "Erase primary bootloader");
|
||||
reboot_as_deep_sleep();
|
||||
break;
|
||||
case 3:
|
||||
TEST_ASSERT_EQUAL_HEX32(CONFIG_BOOTLOADER_RECOVERY_OFFSET, esp_rom_get_bootloader_offset());
|
||||
|
||||
ESP_LOGI(TAG, "Return to primary bootloader...");
|
||||
ESP_LOGI(TAG, "Copy <%s> -> <%s>", recovery_bootloader->label, primary_bootloader->label);
|
||||
TEST_ESP_OK(esp_partition_copy(primary_bootloader, 0, recovery_bootloader, 0, primary_bootloader->size));
|
||||
|
||||
TEST_ESP_OK(esp_partition_erase_range(recovery_bootloader, 0, recovery_bootloader->size));
|
||||
ESP_LOGI(TAG, "Erase recovery bootloader");
|
||||
break;
|
||||
default:
|
||||
TEST_FAIL_MESSAGE("Unexpected stage");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_MULTIPLE_STAGES("Recovery bootloader feature", "[recovery_bootloader][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET]", start_test, test_flow1, test_flow1);
|
||||
|
||||
#endif // CONFIG_BOOTLOADER_RECOVERY_ENABLE
|
||||
@@ -1,256 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "esp_ota_ops.h"
|
||||
#include "esp_partition.h"
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "esp_flash_internal.h"
|
||||
#include "spi_flash_mmap.h"
|
||||
#include "esp_image_format.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_log.h"
|
||||
#include "unity.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
static const char *TAG = "test";
|
||||
|
||||
static uint8_t buffer[SPI_FLASH_SEC_SIZE];
|
||||
|
||||
// Find the unused offset after the last partition, checking that it is of the required size
|
||||
static uint32_t find_unused_space(size_t required_size)
|
||||
{
|
||||
esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL);
|
||||
TEST_ASSERT_NOT_NULL(it);
|
||||
const esp_partition_t* latest_partition = esp_partition_get(it);
|
||||
for (; it != NULL; it = esp_partition_next(it)) {
|
||||
const esp_partition_t *p = esp_partition_get(it);
|
||||
if (p->address > latest_partition->address) {
|
||||
latest_partition = p;
|
||||
}
|
||||
}
|
||||
esp_partition_iterator_release(it);
|
||||
TEST_ASSERT_NOT_NULL(latest_partition);
|
||||
|
||||
#if CONFIG_IDF_TARGET_LINUX
|
||||
uint32_t flash_chip_size;
|
||||
esp_flash_get_size(NULL, &flash_chip_size);
|
||||
#else
|
||||
uint32_t flash_chip_size = esp_flash_default_chip->size;
|
||||
#endif // CONFIG_IDF_TARGET_LINUX
|
||||
uint32_t unused_offset = latest_partition->address + latest_partition->size;
|
||||
TEST_ASSERT_GREATER_OR_EQUAL_UINT32(required_size, flash_chip_size - unused_offset);
|
||||
return unused_offset;
|
||||
}
|
||||
|
||||
static void check_after_reboot(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "App runs");
|
||||
}
|
||||
|
||||
static void download_new_image_from_partition(esp_ota_handle_t update_handle, const esp_partition_t *copy_from_part)
|
||||
{
|
||||
uint32_t offset = 0;
|
||||
ESP_LOGI(TAG, "Downloading image...");
|
||||
do {
|
||||
TEST_ESP_OK(esp_partition_read(copy_from_part, offset, buffer, sizeof(buffer)));
|
||||
TEST_ESP_OK(esp_ota_write(update_handle, buffer, sizeof(buffer)));
|
||||
offset += sizeof(buffer);
|
||||
} while (offset < copy_from_part->size);
|
||||
}
|
||||
|
||||
static void start_bootloader_ota_update_via_ota_bootloader_part(void)
|
||||
{
|
||||
const esp_partition_t *primary_bootloader;
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, ESP_PRIMARY_BOOTLOADER_OFFSET, ESP_BOOTLOADER_SIZE, "PrimaryBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_PRIMARY, &primary_bootloader));
|
||||
|
||||
const esp_partition_t *ota_bootloader;
|
||||
const uint32_t ota_bootloader_offset = find_unused_space(ESP_BOOTLOADER_SIZE);
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, ota_bootloader_offset, ESP_BOOTLOADER_SIZE, "OtaBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_OTA, &ota_bootloader));
|
||||
|
||||
esp_ota_handle_t update_handle;
|
||||
TEST_ESP_OK(esp_ota_begin(ota_bootloader, OTA_WITH_SEQUENTIAL_WRITES, &update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_final_partition(update_handle, primary_bootloader, true));
|
||||
download_new_image_from_partition(update_handle, primary_bootloader);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
|
||||
TEST_ESP_OK(esp_partition_deregister_external(primary_bootloader));
|
||||
TEST_ESP_OK(esp_partition_deregister_external(ota_bootloader));
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
TEST_CASE_MULTIPLE_STAGES("OTA update of bootloader via temp partition", "[bootloader_ota][reset=SW_CPU_RESET]", start_bootloader_ota_update_via_ota_bootloader_part, check_after_reboot);
|
||||
|
||||
static void start_bootloader_ota_update_via_primary_bootloader_part(void)
|
||||
{
|
||||
const esp_partition_t *primary_bootloader;
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, ESP_PRIMARY_BOOTLOADER_OFFSET, ESP_BOOTLOADER_SIZE, "PrimaryBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_PRIMARY, &primary_bootloader));
|
||||
|
||||
esp_ota_handle_t update_handle;
|
||||
TEST_ESP_OK(esp_ota_begin(primary_bootloader, OTA_WITH_SEQUENTIAL_WRITES, &update_handle));
|
||||
download_new_image_from_partition(update_handle, primary_bootloader);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
|
||||
TEST_ESP_OK(esp_partition_deregister_external(primary_bootloader));
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
TEST_CASE_MULTIPLE_STAGES("OTA update of bootloader via primary partition", "[bootloader_ota][reset=SW_CPU_RESET]", start_bootloader_ota_update_via_primary_bootloader_part, check_after_reboot);
|
||||
|
||||
static void start_partition_table_ota_update_via_ota_part_table(void)
|
||||
{
|
||||
const esp_partition_t *primary_partition_table;
|
||||
const esp_partition_t *ota_partition_table;
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, ESP_PRIMARY_PARTITION_TABLE_OFFSET, ESP_PARTITION_TABLE_SIZE, "PrimaryPrtTable", ESP_PARTITION_TYPE_PARTITION_TABLE, ESP_PARTITION_SUBTYPE_PARTITION_TABLE_PRIMARY, &primary_partition_table));
|
||||
|
||||
uint32_t ota_partition_table_offset = find_unused_space(ESP_PARTITION_TABLE_SIZE);
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, ota_partition_table_offset, ESP_PARTITION_TABLE_SIZE, "OtaPrtTable", ESP_PARTITION_TYPE_PARTITION_TABLE, ESP_PARTITION_SUBTYPE_PARTITION_TABLE_OTA, &ota_partition_table));
|
||||
|
||||
esp_ota_handle_t update_handle;
|
||||
TEST_ESP_OK(esp_ota_begin(ota_partition_table, OTA_WITH_SEQUENTIAL_WRITES, &update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_final_partition(update_handle, primary_partition_table, true));
|
||||
download_new_image_from_partition(update_handle, primary_partition_table);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
|
||||
TEST_ESP_OK(esp_partition_deregister_external(primary_partition_table));
|
||||
TEST_ESP_OK(esp_partition_deregister_external(ota_partition_table));
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
TEST_CASE_MULTIPLE_STAGES("OTA update of partition_table via temp partition", "[partition_table_ota][reset=SW_CPU_RESET]", start_partition_table_ota_update_via_ota_part_table, check_after_reboot);
|
||||
|
||||
static void start_partition_table_ota_update_via_primary_part_table(void)
|
||||
{
|
||||
const esp_partition_t *primary_partition_table;
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, ESP_PRIMARY_PARTITION_TABLE_OFFSET, ESP_PARTITION_TABLE_SIZE, "PrimaryPrtTable", ESP_PARTITION_TYPE_PARTITION_TABLE, ESP_PARTITION_SUBTYPE_PARTITION_TABLE_PRIMARY, &primary_partition_table));
|
||||
|
||||
esp_ota_handle_t update_handle;
|
||||
TEST_ESP_OK(esp_ota_begin(primary_partition_table, OTA_WITH_SEQUENTIAL_WRITES, &update_handle));
|
||||
download_new_image_from_partition(update_handle, primary_partition_table);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
|
||||
TEST_ESP_OK(esp_partition_deregister_external(primary_partition_table));
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
TEST_CASE_MULTIPLE_STAGES("OTA update of partition_table via primary partition", "[partition_table_ota][reset=SW_CPU_RESET]", start_partition_table_ota_update_via_primary_part_table, check_after_reboot);
|
||||
|
||||
TEST_CASE("OTA update of NVS partition", "[nvs_ota]")
|
||||
{
|
||||
// intilaize "nvs" partition and define a var (magic_value).
|
||||
TEST_ESP_OK(nvs_flash_erase());
|
||||
TEST_ESP_OK(nvs_flash_init());
|
||||
nvs_handle_t my_handle;
|
||||
TEST_ESP_OK(nvs_open("namespace", NVS_READWRITE, &my_handle));
|
||||
uint32_t magic_value = 0x0729FEED;
|
||||
TEST_ESP_OK(nvs_set_u32(my_handle, "magic_value", magic_value));
|
||||
TEST_ESP_OK(nvs_commit(my_handle));
|
||||
magic_value = 0;
|
||||
TEST_ESP_OK(nvs_get_u32(my_handle, "magic_value", &magic_value));
|
||||
TEST_ASSERT_EQUAL_HEX(0x0729FEED, magic_value);
|
||||
nvs_close(my_handle);
|
||||
TEST_ESP_OK(nvs_flash_deinit());
|
||||
|
||||
// register a new "nvs2" partition
|
||||
const esp_partition_t *nvs_part = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, "nvs");
|
||||
const esp_partition_t *nvs2_part;
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, find_unused_space(nvs_part->size), nvs_part->size, "nvs2", ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, &nvs2_part));
|
||||
ESP_LOGI(TAG, "Use %s partition (0x%08" PRIx32 ") to load a new image", nvs2_part->label, nvs2_part->address);
|
||||
TEST_ESP_OK(nvs_flash_erase_partition("nvs2"));
|
||||
|
||||
// OTA update of the new "nvs2" partition, taking "nvs" partition as source.
|
||||
esp_ota_handle_t update_handle;
|
||||
TEST_ESP_OK(esp_ota_begin(nvs2_part, OTA_WITH_SEQUENTIAL_WRITES, &update_handle));
|
||||
download_new_image_from_partition(update_handle, nvs_part);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
|
||||
// init "nvs2" partition and check if the magic_value == 0x0729FEED
|
||||
TEST_ESP_OK(nvs_flash_init_partition("nvs2"));
|
||||
nvs_handle_t my_handle2;
|
||||
TEST_ESP_OK(nvs_open_from_partition("nvs2", "namespace", NVS_READWRITE, &my_handle2));
|
||||
magic_value = 0;
|
||||
TEST_ESP_OK(nvs_get_u32(my_handle2, "magic_value", &magic_value));
|
||||
TEST_ASSERT_EQUAL_HEX(0x0729FEED, magic_value);
|
||||
nvs_close(my_handle2);
|
||||
TEST_ESP_OK(nvs_flash_deinit_partition("nvs2"));
|
||||
|
||||
// deregister "nvs2"
|
||||
TEST_ESP_OK(esp_partition_deregister_external(nvs2_part));
|
||||
|
||||
TEST_ESP_OK(nvs_flash_erase());
|
||||
}
|
||||
|
||||
static void start_bootloader_ota_update_via_app_part(void)
|
||||
{
|
||||
const esp_partition_t *primary_bootloader;
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, ESP_PRIMARY_BOOTLOADER_OFFSET, ESP_BOOTLOADER_SIZE, "PrimaryBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_PRIMARY, &primary_bootloader));
|
||||
|
||||
const esp_partition_t *free_app_ota_partition = esp_ota_get_next_update_partition(NULL);
|
||||
esp_ota_handle_t update_handle;
|
||||
TEST_ESP_OK(esp_ota_begin(free_app_ota_partition, OTA_WITH_SEQUENTIAL_WRITES, &update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_final_partition(update_handle, primary_bootloader, true));
|
||||
download_new_image_from_partition(update_handle, primary_bootloader);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
|
||||
TEST_ESP_OK(esp_partition_deregister_external(primary_bootloader));
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
TEST_CASE_MULTIPLE_STAGES("OTA update of bootloader via a free ota partition", "[bootloader_ota][reset=SW_CPU_RESET]", start_bootloader_ota_update_via_app_part, check_after_reboot);
|
||||
|
||||
static void start_partition_table_ota_update_via_app_part(void)
|
||||
{
|
||||
const esp_partition_t *primary_partition_table;
|
||||
TEST_ESP_OK(esp_partition_register_external(NULL, ESP_PRIMARY_PARTITION_TABLE_OFFSET, ESP_PARTITION_TABLE_SIZE, "PrimaryPrtTable", ESP_PARTITION_TYPE_PARTITION_TABLE, ESP_PARTITION_SUBTYPE_PARTITION_TABLE_PRIMARY, &primary_partition_table));
|
||||
|
||||
const esp_partition_t *free_app_ota_partition = esp_ota_get_next_update_partition(NULL);
|
||||
esp_ota_handle_t update_handle;
|
||||
TEST_ESP_OK(esp_ota_begin(free_app_ota_partition, OTA_WITH_SEQUENTIAL_WRITES, &update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_final_partition(update_handle, primary_partition_table, true));
|
||||
download_new_image_from_partition(update_handle, primary_partition_table);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
|
||||
TEST_ESP_OK(esp_partition_deregister_external(primary_partition_table));
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
TEST_CASE_MULTIPLE_STAGES("OTA update of partition_table via a free ota partition", "[partition_table_ota][reset=SW_CPU_RESET]", start_partition_table_ota_update_via_app_part, check_after_reboot);
|
||||
|
||||
TEST_CASE("OTA update of NVS partition via a free ota partition", "[nvs_ota]")
|
||||
{
|
||||
// intilaize "nvs" partition and define a var (magic_value).
|
||||
const esp_partition_t *nvs_part = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, "nvs");
|
||||
TEST_ESP_OK(nvs_flash_erase());
|
||||
TEST_ESP_OK(nvs_flash_init());
|
||||
nvs_handle_t my_handle;
|
||||
TEST_ESP_OK(nvs_open("namespace", NVS_READWRITE, &my_handle));
|
||||
uint32_t magic_value = 0x0729FEED;
|
||||
TEST_ESP_OK(nvs_set_u32(my_handle, "magic_value", magic_value));
|
||||
TEST_ESP_OK(nvs_commit(my_handle));
|
||||
magic_value = 0;
|
||||
TEST_ESP_OK(nvs_get_u32(my_handle, "magic_value", &magic_value));
|
||||
TEST_ASSERT_EQUAL_HEX(0x0729FEED, magic_value);
|
||||
nvs_close(my_handle);
|
||||
TEST_ESP_OK(nvs_flash_deinit());
|
||||
|
||||
// 1. OTA update nvs partition into free_app_ota_partition
|
||||
// 2. copy free_app_ota_partition into the original nvs partition (which was erased before coping)
|
||||
const esp_partition_t *free_app_ota_partition = esp_ota_get_next_update_partition(NULL);
|
||||
esp_ota_handle_t update_handle;
|
||||
TEST_ESP_OK(esp_ota_begin(free_app_ota_partition, OTA_WITH_SEQUENTIAL_WRITES, &update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_final_partition(update_handle, nvs_part, true));
|
||||
download_new_image_from_partition(update_handle, nvs_part);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
|
||||
// Check if the magic_value == 0x0729FEED
|
||||
TEST_ESP_OK(nvs_flash_init());
|
||||
TEST_ESP_OK(nvs_open("namespace", NVS_READONLY, &my_handle));
|
||||
magic_value = 0;
|
||||
TEST_ESP_OK(nvs_get_u32(my_handle, "magic_value", &magic_value));
|
||||
TEST_ASSERT_EQUAL_HEX(0x0729FEED, magic_value);
|
||||
nvs_close(my_handle);
|
||||
TEST_ESP_OK(nvs_flash_deinit());
|
||||
TEST_ESP_OK(nvs_flash_erase());
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -7,16 +7,309 @@
|
||||
* Tests for switching between partitions: factory, OTAx, test.
|
||||
*/
|
||||
|
||||
#include "esp_system.h"
|
||||
#include <esp_types.h>
|
||||
#include <stdio.h>
|
||||
#include "string.h"
|
||||
#include <inttypes.h>
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#include "esp_rom_spiflash.h"
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "freertos/queue.h"
|
||||
#include "unity.h"
|
||||
|
||||
#include "bootloader_common.h"
|
||||
#include "../bootloader_flash/include/bootloader_flash_priv.h"
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
#include "unity.h"
|
||||
#include "utils_update.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_ota_ops.h"
|
||||
#include "esp_partition.h"
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "esp_image_format.h"
|
||||
#include "nvs_flash.h"
|
||||
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_sleep.h"
|
||||
#include "test_utils.h"
|
||||
|
||||
#define BOOT_COUNT_NAMESPACE "boot_count"
|
||||
|
||||
static const char *TAG = "ota_test";
|
||||
|
||||
static void set_boot_count_in_nvs(uint8_t boot_count)
|
||||
{
|
||||
nvs_handle_t boot_count_handle;
|
||||
TEST_ESP_OK(nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle));
|
||||
TEST_ESP_OK(nvs_set_u8(boot_count_handle, "boot_count", boot_count));
|
||||
TEST_ESP_OK(nvs_commit(boot_count_handle));
|
||||
nvs_close(boot_count_handle);
|
||||
}
|
||||
|
||||
static uint8_t get_boot_count_from_nvs(void)
|
||||
{
|
||||
nvs_handle_t boot_count_handle;
|
||||
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READONLY, &boot_count_handle);
|
||||
if (err == ESP_ERR_NVS_NOT_FOUND) {
|
||||
set_boot_count_in_nvs(0);
|
||||
}
|
||||
uint8_t boot_count;
|
||||
TEST_ESP_OK(nvs_get_u8(boot_count_handle, "boot_count", &boot_count));
|
||||
nvs_close(boot_count_handle);
|
||||
return boot_count;
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition using handle.
|
||||
*
|
||||
* @param[in] update_handle - Handle of API ota.
|
||||
* @param[in] cur_app - Current app.
|
||||
*/
|
||||
static void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
|
||||
{
|
||||
const void *partition_bin = NULL;
|
||||
esp_partition_mmap_handle_t data_map;
|
||||
ESP_LOGI(TAG, "start the copy process");
|
||||
TEST_ESP_OK(esp_partition_mmap(curr_app, 0, curr_app->size, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
|
||||
TEST_ESP_OK(esp_ota_write(update_handle, (const void *)partition_bin, curr_app->size));
|
||||
esp_partition_munmap(data_map);
|
||||
ESP_LOGI(TAG, "finish the copy process");
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition using handle.
|
||||
*
|
||||
* @param[in] update_handle - Handle of API ota.
|
||||
* @param[in] cur_app - Current app.
|
||||
*/
|
||||
static void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
|
||||
{
|
||||
const void *partition_bin = NULL;
|
||||
esp_partition_mmap_handle_t data_map;
|
||||
ESP_LOGI(TAG, "start the copy process");
|
||||
uint32_t offset = 0, bytes_to_write = curr_app->size;
|
||||
uint32_t write_bytes;
|
||||
while (bytes_to_write > 0) {
|
||||
write_bytes = (bytes_to_write > (4 * 1024)) ? (4 * 1024) : bytes_to_write;
|
||||
TEST_ESP_OK(esp_partition_mmap(curr_app, offset, write_bytes, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
|
||||
TEST_ESP_OK(esp_ota_write_with_offset(update_handle, (const void *)partition_bin, write_bytes, offset));
|
||||
esp_partition_munmap(data_map);
|
||||
bytes_to_write -= write_bytes;
|
||||
offset += write_bytes;
|
||||
}
|
||||
ESP_LOGI(TAG, "finish the copy process");
|
||||
}
|
||||
|
||||
/* @brief Get the next partition of OTA for the update.
|
||||
*
|
||||
* @return The next partition of OTA(OTA0-15).
|
||||
*/
|
||||
static const esp_partition_t * get_next_update_partition(void)
|
||||
{
|
||||
const esp_partition_t *update_partition = esp_ota_get_next_update_partition(NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, update_partition);
|
||||
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, update_partition->subtype, update_partition->address);
|
||||
return update_partition;
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
|
||||
*
|
||||
* @param[in] cur_app_partition - Current app.
|
||||
* @param[in] next_app_partition - Next app for boot.
|
||||
*/
|
||||
static void copy_current_app_to_next_part(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
|
||||
{
|
||||
esp_ota_get_next_update_partition(NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
|
||||
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
|
||||
|
||||
esp_ota_handle_t update_handle = 0;
|
||||
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
|
||||
|
||||
copy_app_partition(update_handle, cur_app_partition);
|
||||
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
|
||||
*
|
||||
* @param[in] cur_app_partition - Current app.
|
||||
* @param[in] next_app_partition - Next app for boot.
|
||||
*/
|
||||
static void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
|
||||
{
|
||||
esp_ota_get_next_update_partition(NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
|
||||
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
|
||||
|
||||
esp_ota_handle_t update_handle = 0;
|
||||
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
|
||||
|
||||
copy_app_partition_with_offset(update_handle, cur_app_partition);
|
||||
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
|
||||
}
|
||||
|
||||
/* @brief Erase otadata partition
|
||||
*/
|
||||
static void erase_ota_data(void)
|
||||
{
|
||||
const esp_partition_t *data_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, data_partition);
|
||||
TEST_ESP_OK(esp_partition_erase_range(data_partition, 0, 2 * data_partition->erase_size));
|
||||
}
|
||||
|
||||
/* @brief Reboots ESP using mode deep sleep. This mode guaranty that RTC_DATA_ATTR variables is not reset.
|
||||
*/
|
||||
static void reboot_as_deep_sleep(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "reboot as deep sleep");
|
||||
esp_deep_sleep(20000);
|
||||
TEST_FAIL_MESSAGE("Should never be reachable except when sleep is rejected, abort");
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition (OTA0-15), after that ESP is rebooting and run this (the next) OTAx.
|
||||
*/
|
||||
static void copy_current_app_to_next_part_and_reboot(void)
|
||||
{
|
||||
const esp_partition_t *cur_app = esp_ota_get_running_partition();
|
||||
ESP_LOGI(TAG, "copy current app to next part");
|
||||
copy_current_app_to_next_part(cur_app, get_next_update_partition());
|
||||
reboot_as_deep_sleep();
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition (OTA0-15) using esp_ota_write_with_offest(), after that ESP is rebooting and run this (the next) OTAx.
|
||||
*/
|
||||
static void copy_current_app_to_next_part_with_offset_and_reboot(void)
|
||||
{
|
||||
const esp_partition_t *cur_app = esp_ota_get_running_partition();
|
||||
ESP_LOGI(TAG, "copy current app to next part");
|
||||
copy_current_app_to_next_part_with_offset(cur_app, get_next_update_partition());
|
||||
reboot_as_deep_sleep();
|
||||
}
|
||||
|
||||
/* @brief Get running app.
|
||||
*
|
||||
* @return The next partition of OTA(OTA0-15).
|
||||
*/
|
||||
static const esp_partition_t* get_running_firmware(void)
|
||||
{
|
||||
const esp_partition_t *configured = esp_ota_get_boot_partition();
|
||||
const esp_partition_t *running = esp_ota_get_running_partition();
|
||||
ESP_LOGI(TAG, "Running partition type %d subtype %d (offset 0x%08"PRIx32")",
|
||||
running->type, running->subtype, running->address);
|
||||
ESP_LOGI(TAG, "Configured partition type %d subtype %d (offset 0x%08"PRIx32")",
|
||||
configured->type, configured->subtype, configured->address);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, configured);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, running);
|
||||
if (running->subtype != ESP_PARTITION_SUBTYPE_APP_TEST) {
|
||||
TEST_ASSERT_EQUAL_PTR(running, configured);
|
||||
}
|
||||
return running;
|
||||
}
|
||||
|
||||
// type of a corrupt ota_data
|
||||
typedef enum {
|
||||
CORR_CRC_1_SECTOR_OTA_DATA = (1 << 0), /*!< Corrupt CRC only 1 sector of ota_data */
|
||||
CORR_CRC_2_SECTOR_OTA_DATA = (1 << 1), /*!< Corrupt CRC only 2 sector of ota_data */
|
||||
} corrupt_ota_data_t;
|
||||
|
||||
/* @brief Get two copies ota_data from otadata partition.
|
||||
*
|
||||
* @param[in] otadata_partition - otadata partition.
|
||||
* @param[out] ota_data_0 - First copy from otadata_partition.
|
||||
* @param[out] ota_data_1 - Second copy from otadata_partition.
|
||||
*/
|
||||
static void get_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data_0, esp_ota_select_entry_t *ota_data_1)
|
||||
{
|
||||
uint32_t offset = otadata_partition->address;
|
||||
uint32_t size = otadata_partition->size;
|
||||
if (offset != 0) {
|
||||
const esp_ota_select_entry_t *ota_select_map;
|
||||
ota_select_map = bootloader_mmap(offset, size);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, ota_select_map);
|
||||
|
||||
memcpy(ota_data_0, ota_select_map, sizeof(esp_ota_select_entry_t));
|
||||
memcpy(ota_data_1, (uint8_t *)ota_select_map + otadata_partition->erase_size, sizeof(esp_ota_select_entry_t));
|
||||
bootloader_munmap(ota_select_map);
|
||||
}
|
||||
}
|
||||
|
||||
/* @brief Writes a ota_data into required sector of otadata_partition.
|
||||
*
|
||||
* @param[in] otadata_partition - Partition information otadata.
|
||||
* @param[in] ota_data - otadata structure.
|
||||
* @param[in] sec_id - Sector number 0 or 1.
|
||||
*/
|
||||
static void write_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data, int sec_id)
|
||||
{
|
||||
esp_partition_write(otadata_partition, otadata_partition->erase_size * sec_id, &ota_data[sec_id], sizeof(esp_ota_select_entry_t));
|
||||
}
|
||||
|
||||
/* @brief Makes a corrupt of ota_data.
|
||||
* @param[in] err - type error
|
||||
*/
|
||||
static void corrupt_ota_data(corrupt_ota_data_t err)
|
||||
{
|
||||
esp_ota_select_entry_t ota_data[2];
|
||||
|
||||
const esp_partition_t *otadata_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, otadata_partition);
|
||||
get_ota_data(otadata_partition, &ota_data[0], &ota_data[1]);
|
||||
|
||||
if (err & CORR_CRC_1_SECTOR_OTA_DATA) {
|
||||
ota_data[0].crc = 0;
|
||||
}
|
||||
if (err & CORR_CRC_2_SECTOR_OTA_DATA) {
|
||||
ota_data[1].crc = 0;
|
||||
}
|
||||
TEST_ESP_OK(esp_partition_erase_range(otadata_partition, 0, otadata_partition->size));
|
||||
write_ota_data(otadata_partition, &ota_data[0], 0);
|
||||
write_ota_data(otadata_partition, &ota_data[1], 1);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BOOTLOADER_FACTORY_RESET) || defined(CONFIG_BOOTLOADER_APP_TEST)
|
||||
/* @brief Sets the pin number to output and sets output level as low. After reboot (deep sleep) this pin keep the same level.
|
||||
*
|
||||
* The output level of the pad will be force locked and can not be changed.
|
||||
* Power down or call gpio_hold_dis will disable this function.
|
||||
*
|
||||
* @param[in] num_pin - Pin number
|
||||
*/
|
||||
static void set_output_pin(uint32_t num_pin)
|
||||
{
|
||||
TEST_ESP_OK(gpio_hold_dis(num_pin));
|
||||
|
||||
gpio_config_t io_conf;
|
||||
io_conf.intr_type = GPIO_INTR_DISABLE;
|
||||
io_conf.mode = GPIO_MODE_OUTPUT;
|
||||
io_conf.pin_bit_mask = (1ULL << num_pin);
|
||||
io_conf.pull_down_en = 0;
|
||||
io_conf.pull_up_en = 0;
|
||||
TEST_ESP_OK(gpio_config(&io_conf));
|
||||
|
||||
TEST_ESP_OK(gpio_set_level(num_pin, 0));
|
||||
TEST_ESP_OK(gpio_hold_en(num_pin));
|
||||
}
|
||||
|
||||
/* @brief Unset the pin number hold function.
|
||||
*/
|
||||
static void reset_output_pin(uint32_t num_pin)
|
||||
{
|
||||
TEST_ESP_OK(gpio_hold_dis(num_pin));
|
||||
TEST_ESP_OK(gpio_reset_pin(num_pin));
|
||||
}
|
||||
#endif
|
||||
|
||||
static void mark_app_valid(void)
|
||||
{
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
|
||||
#endif
|
||||
}
|
||||
|
||||
/* @brief Checks and prepares the partition so that the factory app is launched after that.
|
||||
*/
|
||||
@@ -248,6 +541,20 @@ static void test_flow5(void)
|
||||
TEST_CASE_MULTIPLE_STAGES("Switching between factory, test, factory", "[app_update][timeout=90][reset=SW_CPU_RESET, SW_CPU_RESET, DEEPSLEEP_RESET]", start_test, test_flow5, test_flow5, test_flow5);
|
||||
#endif
|
||||
|
||||
static const esp_partition_t* app_update(void)
|
||||
{
|
||||
const esp_partition_t *cur_app = get_running_firmware();
|
||||
const esp_partition_t* update_partition = esp_ota_get_next_update_partition(NULL);
|
||||
TEST_ASSERT_NOT_NULL(update_partition);
|
||||
esp_ota_handle_t update_handle = 0;
|
||||
TEST_ESP_OK(esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle));
|
||||
copy_app_partition(update_handle, cur_app);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_boot_partition(update_partition));
|
||||
return update_partition;
|
||||
}
|
||||
|
||||
|
||||
static void test_rollback1(void)
|
||||
{
|
||||
uint8_t boot_count = get_boot_count_from_nvs();
|
||||
@@ -537,132 +844,3 @@ TEST_CASE("Test bootloader_common_get_sha256_of_partition returns ESP_ERR_IMAGE_
|
||||
TEST_ESP_ERR(ESP_ERR_IMAGE_INVALID, bootloader_common_get_sha256_of_partition(other_app->address, other_app->size, other_app->type, sha_256_other_app));
|
||||
TEST_ASSERT_EQUAL_MEMORY_MESSAGE(sha_256_cur_app, sha_256_other_app, sizeof(sha_256_cur_app), "must be the same");
|
||||
}
|
||||
|
||||
static void test_rollback3(void)
|
||||
{
|
||||
uint8_t boot_count = get_boot_count_from_nvs();
|
||||
boot_count++;
|
||||
set_boot_count_in_nvs(boot_count);
|
||||
ESP_LOGI(TAG, "boot count %d", boot_count);
|
||||
const esp_partition_t *cur_app = get_running_firmware();
|
||||
const esp_partition_t* update_partition = NULL;
|
||||
switch (boot_count) {
|
||||
case 2:
|
||||
ESP_LOGI(TAG, "Factory");
|
||||
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_FACTORY, cur_app->subtype);
|
||||
update_partition = app_update();
|
||||
reboot_as_deep_sleep();
|
||||
break;
|
||||
case 3:
|
||||
ESP_LOGI(TAG, "OTA0");
|
||||
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_0, cur_app->subtype);
|
||||
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
|
||||
TEST_ASSERT_NULL(esp_ota_get_last_invalid_partition());
|
||||
update_partition = app_update();
|
||||
reboot_as_deep_sleep();
|
||||
break;
|
||||
case 4:
|
||||
ESP_LOGI(TAG, "OTA1");
|
||||
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_1, cur_app->subtype);
|
||||
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
|
||||
|
||||
update_partition = esp_ota_get_next_update_partition(NULL);
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
// two partitions are valid
|
||||
TEST_ASSERT_NULL(esp_ota_get_last_invalid_partition());
|
||||
esp_ota_img_states_t ota_state;
|
||||
TEST_ESP_OK(esp_ota_get_state_partition(update_partition, &ota_state));
|
||||
TEST_ASSERT_EQUAL(ESP_OTA_IMG_VALID, ota_state);
|
||||
#endif
|
||||
|
||||
esp_ota_handle_t update_handle = 0;
|
||||
TEST_ESP_OK(esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle));
|
||||
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
// After esp_ota_begin, the only one partition is valid
|
||||
// ota data slots do not have an entry about the update_partition.
|
||||
TEST_ESP_ERR(ESP_ERR_NOT_FOUND, esp_ota_get_state_partition(update_partition, &ota_state));
|
||||
#endif
|
||||
copy_app_partition(update_handle, get_running_firmware());
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
// esp_ota_set_boot_partition is not called, so the running app will not be changed after reboot
|
||||
reboot_as_deep_sleep();
|
||||
break;
|
||||
default:
|
||||
erase_ota_data();
|
||||
TEST_FAIL_MESSAGE("Unexpected stage");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void test_rollback3_1(void)
|
||||
{
|
||||
set_boot_count_in_nvs(5);
|
||||
uint8_t boot_count = get_boot_count_from_nvs();
|
||||
esp_ota_img_states_t ota_state = 0x5555AAAA;
|
||||
ESP_LOGI(TAG, "boot count %d", boot_count);
|
||||
const esp_partition_t *cur_app = get_running_firmware();
|
||||
ESP_LOGI(TAG, "OTA1");
|
||||
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_1, cur_app->subtype);
|
||||
TEST_ESP_OK(esp_ota_get_state_partition(cur_app, &ota_state));
|
||||
TEST_ASSERT_EQUAL(ESP_OTA_IMG_VALID, ota_state);
|
||||
|
||||
TEST_ASSERT_NULL(esp_ota_get_last_invalid_partition());
|
||||
const esp_partition_t* next_update_partition = esp_ota_get_next_update_partition(NULL);
|
||||
TEST_ASSERT_NOT_NULL(next_update_partition);
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
// ota data slots do not have an entry about the next_update_partition.
|
||||
TEST_ESP_ERR(ESP_ERR_NOT_FOUND, esp_ota_get_state_partition(next_update_partition, &ota_state));
|
||||
#endif
|
||||
erase_ota_data();
|
||||
}
|
||||
|
||||
TEST_CASE_MULTIPLE_STAGES("Test rollback. Updated partition invalidated after esp_ota_begin", "[app_update][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET, DEEPSLEEP_RESET, SW_CPU_RESET]", start_test, test_rollback3, test_rollback3, test_rollback3, test_rollback3_1);
|
||||
|
||||
static void test_rollback4(void)
|
||||
{
|
||||
uint8_t boot_count = get_boot_count_from_nvs();
|
||||
boot_count++;
|
||||
set_boot_count_in_nvs(boot_count);
|
||||
ESP_LOGI(TAG, "boot count %d", boot_count);
|
||||
const esp_partition_t *cur_app = get_running_firmware();
|
||||
switch (boot_count) {
|
||||
case 2:
|
||||
ESP_LOGI(TAG, "Factory");
|
||||
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_FACTORY, cur_app->subtype);
|
||||
app_update();
|
||||
reboot_as_deep_sleep();
|
||||
break;
|
||||
case 3:
|
||||
ESP_LOGI(TAG, "OTA0");
|
||||
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_0, cur_app->subtype);
|
||||
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
|
||||
app_update();
|
||||
|
||||
// Do not reboot and call app_update again.
|
||||
// This will not change the running partition since we haven't rebooted.
|
||||
// The esp_rewrite_otadata() will update the otadata for the non-running partition only.
|
||||
app_update();
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
// The last call to esp_rewrite_otadata should have updated the otadata for the non-running partition only.
|
||||
// Therefore, calling esp_ota_get_state_partition on the running partition should succeed and not return ESP_ERR_NOT_FOUND
|
||||
const esp_partition_t* running_partition;
|
||||
running_partition = esp_ota_get_running_partition();
|
||||
esp_ota_img_states_t ota_state;
|
||||
TEST_ESP_OK(esp_ota_get_state_partition(running_partition, &ota_state));
|
||||
#endif
|
||||
reboot_as_deep_sleep();
|
||||
break;
|
||||
case 4:
|
||||
ESP_LOGI(TAG, "OTA1");
|
||||
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_1, cur_app->subtype);
|
||||
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
|
||||
break;
|
||||
default:
|
||||
erase_ota_data();
|
||||
TEST_FAIL_MESSAGE("Unexpected stage");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_MULTIPLE_STAGES("Test esp_rewrite_otadata. Updated sequence number for non-running partition always", "[app_update][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET, DEEPSLEEP_RESET, SW_CPU_RESET]", start_test, test_rollback4, test_rollback4, test_rollback4);
|
||||
|
||||
@@ -1,307 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "esp_rom_spiflash.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "esp_partition.h"
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "esp_image_format.h"
|
||||
#include "../bootloader_flash/include/bootloader_flash_priv.h"
|
||||
#include "esp_sleep.h"
|
||||
#include "esp_ota_ops.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
#include "test_utils.h"
|
||||
#include "utils_update.h"
|
||||
#include "unity.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#define BOOT_COUNT_NAMESPACE "boot_count"
|
||||
|
||||
static const char *TAG = "ota_test";
|
||||
|
||||
|
||||
void set_boot_count_in_nvs(uint8_t boot_count)
|
||||
{
|
||||
nvs_handle_t boot_count_handle;
|
||||
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle);
|
||||
if (err != ESP_OK) {
|
||||
TEST_ESP_OK(nvs_flash_erase());
|
||||
TEST_ESP_OK(nvs_flash_init());
|
||||
TEST_ESP_OK(nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle));
|
||||
}
|
||||
TEST_ESP_OK(nvs_set_u8(boot_count_handle, "boot_count", boot_count));
|
||||
TEST_ESP_OK(nvs_commit(boot_count_handle));
|
||||
nvs_close(boot_count_handle);
|
||||
}
|
||||
|
||||
uint8_t get_boot_count_from_nvs(void)
|
||||
{
|
||||
nvs_handle_t boot_count_handle;
|
||||
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READONLY, &boot_count_handle);
|
||||
if (err == ESP_ERR_NVS_NOT_FOUND) {
|
||||
set_boot_count_in_nvs(0);
|
||||
}
|
||||
uint8_t boot_count;
|
||||
TEST_ESP_OK(nvs_get_u8(boot_count_handle, "boot_count", &boot_count));
|
||||
nvs_close(boot_count_handle);
|
||||
return boot_count;
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition using handle.
|
||||
*
|
||||
* @param[in] update_handle - Handle of API ota.
|
||||
* @param[in] cur_app - Current app.
|
||||
*/
|
||||
void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
|
||||
{
|
||||
const void *partition_bin = NULL;
|
||||
esp_partition_mmap_handle_t data_map;
|
||||
ESP_LOGI(TAG, "start the copy process");
|
||||
TEST_ESP_OK(esp_partition_mmap(curr_app, 0, curr_app->size, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
|
||||
TEST_ESP_OK(esp_ota_write(update_handle, (const void *)partition_bin, curr_app->size));
|
||||
esp_partition_munmap(data_map);
|
||||
ESP_LOGI(TAG, "finish the copy process");
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition using handle.
|
||||
*
|
||||
* @param[in] update_handle - Handle of API ota.
|
||||
* @param[in] cur_app - Current app.
|
||||
*/
|
||||
void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
|
||||
{
|
||||
const void *partition_bin = NULL;
|
||||
esp_partition_mmap_handle_t data_map;
|
||||
ESP_LOGI(TAG, "start the copy process");
|
||||
uint32_t offset = 0, bytes_to_write = curr_app->size;
|
||||
uint32_t write_bytes;
|
||||
while (bytes_to_write > 0) {
|
||||
write_bytes = (bytes_to_write > (4 * 1024)) ? (4 * 1024) : bytes_to_write;
|
||||
TEST_ESP_OK(esp_partition_mmap(curr_app, offset, write_bytes, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
|
||||
TEST_ESP_OK(esp_ota_write_with_offset(update_handle, (const void *)partition_bin, write_bytes, offset));
|
||||
esp_partition_munmap(data_map);
|
||||
bytes_to_write -= write_bytes;
|
||||
offset += write_bytes;
|
||||
}
|
||||
ESP_LOGI(TAG, "finish the copy process");
|
||||
}
|
||||
|
||||
/* @brief Get the next partition of OTA for the update.
|
||||
*
|
||||
* @return The next partition of OTA(OTA0-15).
|
||||
*/
|
||||
const esp_partition_t * get_next_update_partition(void)
|
||||
{
|
||||
const esp_partition_t *update_partition = esp_ota_get_next_update_partition(NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, update_partition);
|
||||
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, update_partition->subtype, update_partition->address);
|
||||
return update_partition;
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
|
||||
*
|
||||
* @param[in] cur_app_partition - Current app.
|
||||
* @param[in] next_app_partition - Next app for boot.
|
||||
*/
|
||||
void copy_current_app_to_next_part(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
|
||||
{
|
||||
esp_ota_get_next_update_partition(NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
|
||||
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
|
||||
|
||||
esp_ota_handle_t update_handle = 0;
|
||||
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
|
||||
|
||||
copy_app_partition(update_handle, cur_app_partition);
|
||||
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
|
||||
*
|
||||
* @param[in] cur_app_partition - Current app.
|
||||
* @param[in] next_app_partition - Next app for boot.
|
||||
*/
|
||||
void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
|
||||
{
|
||||
esp_ota_get_next_update_partition(NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
|
||||
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
|
||||
|
||||
esp_ota_handle_t update_handle = 0;
|
||||
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
|
||||
|
||||
copy_app_partition_with_offset(update_handle, cur_app_partition);
|
||||
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
|
||||
}
|
||||
|
||||
/* @brief Erase otadata partition
|
||||
*/
|
||||
void erase_ota_data(void)
|
||||
{
|
||||
const esp_partition_t *data_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, data_partition);
|
||||
TEST_ESP_OK(esp_partition_erase_range(data_partition, 0, 2 * data_partition->erase_size));
|
||||
}
|
||||
|
||||
/* @brief Reboots ESP using mode deep sleep. This mode guaranty that RTC_DATA_ATTR variables is not reset.
|
||||
*/
|
||||
void reboot_as_deep_sleep(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "reboot as deep sleep");
|
||||
esp_deep_sleep(20000);
|
||||
TEST_FAIL_MESSAGE("Should never be reachable except when sleep is rejected, abort");
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition (OTA0-15), after that ESP is rebooting and run this (the next) OTAx.
|
||||
*/
|
||||
void copy_current_app_to_next_part_and_reboot(void)
|
||||
{
|
||||
const esp_partition_t *cur_app = esp_ota_get_running_partition();
|
||||
ESP_LOGI(TAG, "copy current app to next part");
|
||||
copy_current_app_to_next_part(cur_app, get_next_update_partition());
|
||||
reboot_as_deep_sleep();
|
||||
}
|
||||
|
||||
/* @brief Copies a current app to next partition (OTA0-15) using esp_ota_write_with_offest(), after that ESP is rebooting and run this (the next) OTAx.
|
||||
*/
|
||||
void copy_current_app_to_next_part_with_offset_and_reboot(void)
|
||||
{
|
||||
const esp_partition_t *cur_app = esp_ota_get_running_partition();
|
||||
ESP_LOGI(TAG, "copy current app to next part");
|
||||
copy_current_app_to_next_part_with_offset(cur_app, get_next_update_partition());
|
||||
reboot_as_deep_sleep();
|
||||
}
|
||||
|
||||
/* @brief Get running app.
|
||||
*
|
||||
* @return The next partition of OTA(OTA0-15).
|
||||
*/
|
||||
const esp_partition_t* get_running_firmware(void)
|
||||
{
|
||||
const esp_partition_t *configured = esp_ota_get_boot_partition();
|
||||
const esp_partition_t *running = esp_ota_get_running_partition();
|
||||
// If a reboot hasn't occurred after app_update(), the configured and running partitions may differ
|
||||
ESP_LOGI(TAG, "Running partition type %d subtype %d (offset 0x%08"PRIx32")",
|
||||
running->type, running->subtype, running->address);
|
||||
ESP_LOGI(TAG, "Configured partition type %d subtype %d (offset 0x%08"PRIx32")",
|
||||
configured->type, configured->subtype, configured->address);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, configured);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, running);
|
||||
return running;
|
||||
}
|
||||
|
||||
/* @brief Get two copies ota_data from otadata partition.
|
||||
*
|
||||
* @param[in] otadata_partition - otadata partition.
|
||||
* @param[out] ota_data_0 - First copy from otadata_partition.
|
||||
* @param[out] ota_data_1 - Second copy from otadata_partition.
|
||||
*/
|
||||
void get_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data_0, esp_ota_select_entry_t *ota_data_1)
|
||||
{
|
||||
uint32_t offset = otadata_partition->address;
|
||||
uint32_t size = otadata_partition->size;
|
||||
if (offset != 0) {
|
||||
const esp_ota_select_entry_t *ota_select_map;
|
||||
ota_select_map = bootloader_mmap(offset, size);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, ota_select_map);
|
||||
|
||||
memcpy(ota_data_0, ota_select_map, sizeof(esp_ota_select_entry_t));
|
||||
memcpy(ota_data_1, (uint8_t *)ota_select_map + otadata_partition->erase_size, sizeof(esp_ota_select_entry_t));
|
||||
bootloader_munmap(ota_select_map);
|
||||
}
|
||||
}
|
||||
|
||||
/* @brief Writes a ota_data into required sector of otadata_partition.
|
||||
*
|
||||
* @param[in] otadata_partition - Partition information otadata.
|
||||
* @param[in] ota_data - otadata structure.
|
||||
* @param[in] sec_id - Sector number 0 or 1.
|
||||
*/
|
||||
void write_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data, int sec_id)
|
||||
{
|
||||
esp_partition_write(otadata_partition, otadata_partition->erase_size * sec_id, &ota_data[sec_id], sizeof(esp_ota_select_entry_t));
|
||||
}
|
||||
|
||||
/* @brief Makes a corrupt of ota_data.
|
||||
* @param[in] err - type error
|
||||
*/
|
||||
void corrupt_ota_data(corrupt_ota_data_t err)
|
||||
{
|
||||
esp_ota_select_entry_t ota_data[2];
|
||||
|
||||
const esp_partition_t *otadata_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
|
||||
TEST_ASSERT_NOT_EQUAL(NULL, otadata_partition);
|
||||
get_ota_data(otadata_partition, &ota_data[0], &ota_data[1]);
|
||||
|
||||
if (err & CORR_CRC_1_SECTOR_OTA_DATA) {
|
||||
ota_data[0].crc = 0;
|
||||
}
|
||||
if (err & CORR_CRC_2_SECTOR_OTA_DATA) {
|
||||
ota_data[1].crc = 0;
|
||||
}
|
||||
TEST_ESP_OK(esp_partition_erase_range(otadata_partition, 0, otadata_partition->size));
|
||||
write_ota_data(otadata_partition, &ota_data[0], 0);
|
||||
write_ota_data(otadata_partition, &ota_data[1], 1);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BOOTLOADER_FACTORY_RESET) || defined(CONFIG_BOOTLOADER_APP_TEST)
|
||||
/* @brief Sets the pin number to output and sets output level as low. After reboot (deep sleep) this pin keep the same level.
|
||||
*
|
||||
* The output level of the pad will be force locked and can not be changed.
|
||||
* Power down or call gpio_hold_dis will disable this function.
|
||||
*
|
||||
* @param[in] num_pin - Pin number
|
||||
*/
|
||||
void set_output_pin(uint32_t num_pin)
|
||||
{
|
||||
TEST_ESP_OK(gpio_hold_dis(num_pin));
|
||||
|
||||
gpio_config_t io_conf;
|
||||
io_conf.intr_type = GPIO_INTR_DISABLE;
|
||||
io_conf.mode = GPIO_MODE_OUTPUT;
|
||||
io_conf.pin_bit_mask = (1ULL << num_pin);
|
||||
io_conf.pull_down_en = 0;
|
||||
io_conf.pull_up_en = 0;
|
||||
TEST_ESP_OK(gpio_config(&io_conf));
|
||||
|
||||
TEST_ESP_OK(gpio_set_level(num_pin, 0));
|
||||
TEST_ESP_OK(gpio_hold_en(num_pin));
|
||||
}
|
||||
|
||||
/* @brief Unset the pin number hold function.
|
||||
*/
|
||||
void reset_output_pin(uint32_t num_pin)
|
||||
{
|
||||
TEST_ESP_OK(gpio_hold_dis(num_pin));
|
||||
TEST_ESP_OK(gpio_reset_pin(num_pin));
|
||||
}
|
||||
#endif
|
||||
|
||||
void mark_app_valid(void)
|
||||
{
|
||||
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
|
||||
#endif
|
||||
}
|
||||
|
||||
const esp_partition_t* app_update(void)
|
||||
{
|
||||
const esp_partition_t *cur_app = get_running_firmware();
|
||||
const esp_partition_t* update_partition = esp_ota_get_next_update_partition(NULL);
|
||||
TEST_ASSERT_NOT_NULL(update_partition);
|
||||
esp_ota_handle_t update_handle = 0;
|
||||
TEST_ESP_OK(esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle));
|
||||
copy_app_partition(update_handle, cur_app);
|
||||
TEST_ESP_OK(esp_ota_end(update_handle));
|
||||
TEST_ESP_OK(esp_ota_set_boot_partition(update_partition));
|
||||
return update_partition;
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_ota_ops.h"
|
||||
#include "esp_partition.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @brief Enumeration for specifying which OTA data sectors' CRCs to corrupt.
|
||||
*/
|
||||
typedef enum {
|
||||
CORR_CRC_1_SECTOR_OTA_DATA = (1 << 0), /*!< Corrupt CRC only 1 sector of ota_data */
|
||||
CORR_CRC_2_SECTOR_OTA_DATA = (1 << 1), /*!< Corrupt CRC only 2 sector of ota_data */
|
||||
} corrupt_ota_data_t;
|
||||
|
||||
/**
|
||||
* @brief Set boot count value in NVS.
|
||||
* @param boot_count Value to set.
|
||||
*/
|
||||
void set_boot_count_in_nvs(uint8_t boot_count);
|
||||
|
||||
/**
|
||||
* @brief Get boot count value from NVS.
|
||||
* @return Boot count value.
|
||||
*/
|
||||
uint8_t get_boot_count_from_nvs(void);
|
||||
|
||||
/**
|
||||
* @brief Copy current app to next partition using OTA handle.
|
||||
* @param update_handle OTA update handle.
|
||||
* @param curr_app Current app partition.
|
||||
*/
|
||||
void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app);
|
||||
|
||||
/**
|
||||
* @brief Copy current app to next partition using OTA handle with offset.
|
||||
* @param update_handle OTA update handle.
|
||||
* @param curr_app Current app partition.
|
||||
*/
|
||||
void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app);
|
||||
|
||||
/**
|
||||
* @brief Get the next OTA update partition.
|
||||
* @return Pointer to next OTA partition.
|
||||
*/
|
||||
const esp_partition_t * get_next_update_partition(void);
|
||||
|
||||
/**
|
||||
* @brief Copy current app to next partition and set boot partition.
|
||||
* @param cur_app_partition Current app partition.
|
||||
* @param next_app_partition Next app partition.
|
||||
*/
|
||||
void copy_current_app_to_next_part(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition);
|
||||
|
||||
/**
|
||||
* @brief Copy current app to next partition with offset and set boot partition.
|
||||
* @param cur_app_partition Current app partition.
|
||||
* @param next_app_partition Next app partition.
|
||||
*/
|
||||
void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition);
|
||||
|
||||
/**
|
||||
* @brief Erase OTA data partition.
|
||||
*/
|
||||
void erase_ota_data(void);
|
||||
|
||||
/**
|
||||
* @brief Reboot ESP using deep sleep mode.
|
||||
*/
|
||||
void reboot_as_deep_sleep(void);
|
||||
|
||||
/**
|
||||
* @brief Copy current app to next partition and reboot.
|
||||
*/
|
||||
void copy_current_app_to_next_part_and_reboot(void);
|
||||
|
||||
/**
|
||||
* @brief Copy current app to next partition with offset and reboot.
|
||||
*/
|
||||
void copy_current_app_to_next_part_with_offset_and_reboot(void);
|
||||
|
||||
/**
|
||||
* @brief Get running firmware partition.
|
||||
* @return Pointer to running firmware partition.
|
||||
*/
|
||||
const esp_partition_t* get_running_firmware(void);
|
||||
|
||||
/**
|
||||
* @brief Get two OTA data copies from OTA data partition.
|
||||
* @param otadata_partition OTA data partition.
|
||||
* @param ota_data_0 First OTA data copy.
|
||||
* @param ota_data_1 Second OTA data copy.
|
||||
*/
|
||||
void get_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data_0, esp_ota_select_entry_t *ota_data_1);
|
||||
|
||||
/**
|
||||
* @brief Write OTA data into required sector of OTA data partition.
|
||||
* @param otadata_partition OTA data partition.
|
||||
* @param ota_data OTA data structure.
|
||||
* @param sec_id Sector number (0 or 1).
|
||||
*/
|
||||
void write_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data, int sec_id);
|
||||
|
||||
/**
|
||||
* @brief Corrupt OTA data for testing.
|
||||
* @param err Type of corruption.
|
||||
*/
|
||||
void corrupt_ota_data(corrupt_ota_data_t err);
|
||||
|
||||
#if defined(CONFIG_BOOTLOADER_FACTORY_RESET) || defined(CONFIG_BOOTLOADER_APP_TEST)
|
||||
/**
|
||||
* @brief Set output pin to low and hold state.
|
||||
* @param num_pin Pin number.
|
||||
*/
|
||||
void set_output_pin(uint32_t num_pin);
|
||||
|
||||
/**
|
||||
* @brief Reset output pin hold function.
|
||||
* @param num_pin Pin number.
|
||||
*/
|
||||
void reset_output_pin(uint32_t num_pin);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Mark app as valid and cancel rollback.
|
||||
*/
|
||||
void mark_app_valid(void);
|
||||
|
||||
/**
|
||||
* @brief Perform app update and set new boot partition.
|
||||
* @return Pointer to updated partition.
|
||||
*/
|
||||
const esp_partition_t* app_update(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -1,15 +1,16 @@
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
import re
|
||||
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
DEFAULT_TIMEOUT = 20
|
||||
TEST_SUBMENU_PATTERN_PYTEST = re.compile(rb'\s+\((\d+)\)\s+"([^"]+)"\r?\n')
|
||||
|
||||
|
||||
@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.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -18,11 +19,13 @@ TEST_SUBMENU_PATTERN_PYTEST = re.compile(rb'\s+\((\d+)\)\s+"([^"]+)"\r?\n')
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_app_update(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=180)
|
||||
dut.run_all_single_board_cases(timeout=90)
|
||||
|
||||
|
||||
@pytest.mark.supported_targets
|
||||
# TODO: [ESP32C61] IDF-9245, IDF-10983
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='C61 has not supported deep sleep')
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -31,11 +34,12 @@ def test_app_update(dut: Dut) -> None:
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_app_update_xip_psram(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=180)
|
||||
dut.run_all_single_board_cases(timeout=90)
|
||||
|
||||
|
||||
@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.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
@@ -44,34 +48,5 @@ def test_app_update_xip_psram(dut: Dut) -> None:
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
def test_app_update_xip_psram_rom_impl(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=180)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'rollback',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32s3', 'esp32p4'], indirect=['target'])
|
||||
def test_app_update_with_rollback(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=180)
|
||||
|
||||
|
||||
@pytest.mark.recovery_bootloader
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
['recovery_bootloader'],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_recovery_bootloader_update(dut: Dut) -> None:
|
||||
try:
|
||||
dut.run_all_single_board_cases(group='recovery_bootloader', timeout=90)
|
||||
finally:
|
||||
# Erase recovery bootloader after test because it may interfere with other tests using this runner
|
||||
dut.serial.erase_flash()
|
||||
dut.run_all_single_board_cases(timeout=90)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_BOOTLOADER_RECOVERY_ENABLE=y
|
||||
CONFIG_BOOTLOADER_RECOVERY_OFFSET=0x3F0000
|
||||
CONFIG_PARTITION_TABLE_OFFSET=0x9000
|
||||
@@ -1,2 +0,0 @@
|
||||
# ESP32C5 supports the Recovery bootloader feature in ROM starting from v1.0 (ECO2)
|
||||
CONFIG_IDF_TARGET="esp32c5"
|
||||
@@ -1,2 +0,0 @@
|
||||
# ESP32C61 supports the Recovery bootloader feature in ROM starting from v1.0 (ECO3)
|
||||
CONFIG_IDF_TARGET="esp32c61"
|
||||
@@ -1 +0,0 @@
|
||||
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_IDF_TARGET="esp32c5"
|
||||
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=18
|
||||
CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET=4
|
||||
@@ -1,5 +1,4 @@
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
idf_build_get_property(esp_tee_build ESP_TEE_BUILD)
|
||||
|
||||
if(${target} STREQUAL "linux")
|
||||
return() # This component is not supported by the POSIX/Linux simulator
|
||||
@@ -8,9 +7,7 @@ endif()
|
||||
idf_component_register(PRIV_REQUIRES partition_table esptool_py)
|
||||
|
||||
# Do not generate flash file when building bootloader or is in early expansion of the build
|
||||
# This also applies to the ESP-TEE build, as the esp_tee component only requires the
|
||||
# Kconfig options from the bootloader
|
||||
if(BOOTLOADER_BUILD OR esp_tee_build OR NOT CONFIG_APP_BUILD_BOOTLOADER)
|
||||
if(BOOTLOADER_BUILD OR NOT CONFIG_APP_BUILD_BOOTLOADER)
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
menu "Application Rollback"
|
||||
|
||||
config BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
bool "Enable app rollback support"
|
||||
default n
|
||||
help
|
||||
After updating the app, the bootloader runs a new app with the "ESP_OTA_IMG_PENDING_VERIFY" state set.
|
||||
This state prevents the re-run of this app. After the first boot of the new app in the user code, the
|
||||
function should be called to confirm the operability of the app or vice versa about its non-operability.
|
||||
If the app is working, then it is marked as valid. Otherwise, it is marked as not valid and rolls back to
|
||||
the previous working app. A reboot is performed, and the app is booted before the software update.
|
||||
Note: If during the first boot a new app the power goes out or the WDT works, then roll back will happen.
|
||||
Rollback is possible only between the apps with the same security versions.
|
||||
|
||||
config BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
bool "Enable app anti-rollback support"
|
||||
depends on BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
default n
|
||||
help
|
||||
This option prevents rollback to previous firmware/application image with lower security version.
|
||||
|
||||
config BOOTLOADER_APP_SECURE_VERSION
|
||||
int "eFuse secure version of app"
|
||||
depends on BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
default 0
|
||||
help
|
||||
The secure version is the sequence number stored in the header of each firmware.
|
||||
The security version is set in the bootloader, version is recorded in the eFuse field
|
||||
as the number of set ones. The allocated number of bits in the efuse field
|
||||
for storing the security version is limited (see BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD option).
|
||||
|
||||
Bootloader: When bootloader selects an app to boot, an app is selected that has
|
||||
a security version greater or equal that recorded in eFuse field.
|
||||
The app is booted with a higher (or equal) secure version.
|
||||
|
||||
The security version is worth increasing if in previous versions there is
|
||||
a significant vulnerability and their use is not acceptable.
|
||||
|
||||
Your partition table should has a scheme with ota_0 + ota_1 (without factory).
|
||||
|
||||
config BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD
|
||||
int "Size of the efuse secure version field"
|
||||
depends on BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
range 1 32 if IDF_TARGET_ESP32
|
||||
default 32 if IDF_TARGET_ESP32
|
||||
range 1 4 if IDF_TARGET_ESP32C2
|
||||
default 4 if IDF_TARGET_ESP32C2
|
||||
range 1 16
|
||||
default 16
|
||||
help
|
||||
The size of the efuse secure version field.
|
||||
Its length is limited to 32 bits for ESP32 and 16 bits for ESP32-S2.
|
||||
This determines how many times the security version can be increased.
|
||||
|
||||
config BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE
|
||||
bool "Emulate operations with efuse secure version(only test)"
|
||||
default n
|
||||
depends on BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
select EFUSE_VIRTUAL
|
||||
select EFUSE_VIRTUAL_KEEP_IN_FLASH
|
||||
help
|
||||
This option allows to emulate read/write operations with all eFuses and efuse secure version.
|
||||
It allows to test anti-rollback implementation without permanent write eFuse bits.
|
||||
There should be an entry in partition table with following details: `emul_efuse, data, efuse, , 0x2000`.
|
||||
|
||||
This option enables: EFUSE_VIRTUAL and EFUSE_VIRTUAL_KEEP_IN_FLASH.
|
||||
|
||||
endmenu
|
||||
@@ -1,54 +0,0 @@
|
||||
menu "Recovery Bootloader and Rollback"
|
||||
|
||||
config BOOTLOADER_RECOVERY_ENABLE
|
||||
bool "Enable Recovery Bootloader"
|
||||
depends on SOC_RECOVERY_BOOTLOADER_SUPPORTED
|
||||
default n
|
||||
help
|
||||
The recovery bootloader feature is implemented in the ROM bootloader. It is required for safe OTA
|
||||
updates of the bootloader. The feature is activated when the eFuse field
|
||||
(ESP_EFUSE_RECOVERY_BOOTLOADER_FLASH_SECTOR) is set, which defines the flash address of the
|
||||
recovery bootloader. If activated and the primary bootloader fails to load, the ROM bootloader
|
||||
will attempt to load the recovery bootloader from the address specified in eFuse.
|
||||
|
||||
config BOOTLOADER_RECOVERY_OFFSET
|
||||
hex "Recovery Bootloader Flash Offset"
|
||||
depends on BOOTLOADER_RECOVERY_ENABLE
|
||||
default 0x3F0000
|
||||
range 0x0 0xFFE000
|
||||
help
|
||||
Flash address where the recovery bootloader is stored.
|
||||
This value must be written to the eFuse field (ESP_EFUSE_RECOVERY_BOOTLOADER_FLASH_SECTOR)
|
||||
to activate the recovery bootloader in the ROM bootloader. The eFuse can be programmed
|
||||
using espefuse.py or in the user application with the API esp_efuse_set_recovery_bootloader_offset().
|
||||
Setting this value in the config allows parttool.py to verify that it does not overlap with existing
|
||||
partitions in the partition table.
|
||||
|
||||
The address must be a multiple of the flash sector size (0x1000 bytes).
|
||||
The eFuse field stores the offset in sectors.
|
||||
If the feature is no longer needed or unused, you can burn the 0xFFF value to disable this feature in
|
||||
the ROM bootloader.
|
||||
|
||||
config BOOTLOADER_ANTI_ROLLBACK_ENABLE
|
||||
bool "Enable bootloader rollback support"
|
||||
depends on BOOTLOADER_RECOVERY_ENABLE
|
||||
default n
|
||||
help
|
||||
This option prevents rollback to previous bootloader image with lower security version.
|
||||
|
||||
config BOOTLOADER_SECURE_VERSION
|
||||
int "Secure version of bootloader"
|
||||
depends on BOOTLOADER_ANTI_ROLLBACK_ENABLE
|
||||
default 0
|
||||
range 0 4
|
||||
help
|
||||
The secure version is the sequence number stored in the header of each bootloader.
|
||||
|
||||
The ROM Bootloader which runs the 2nd stage bootloader (PRIMARY or RECOVERY) checks that
|
||||
the security version is greater or equal that recorded in the eFuse field.
|
||||
Bootloaders that have a secure version in the image < secure version in efuse will not boot.
|
||||
|
||||
The security version is worth increasing if in previous versions there is
|
||||
a significant vulnerability and their use is not acceptable.
|
||||
|
||||
endmenu
|
||||
@@ -1,26 +1,5 @@
|
||||
menu "Log"
|
||||
|
||||
choice BOOTLOADER_LOG_VERSION
|
||||
prompt "Log version"
|
||||
help
|
||||
Select the log version to be used by the ESP log component.
|
||||
The app log version (CONFIG_LOG_VERSION) controls the version used in the bootloader,
|
||||
preventing the selection of different versions.
|
||||
For description of V1 and V2 see CONFIG_LOG_VERSION.
|
||||
|
||||
config BOOTLOADER_LOG_VERSION_1
|
||||
bool "V1" if LOG_VERSION_1
|
||||
config BOOTLOADER_LOG_VERSION_2
|
||||
bool "V2" if LOG_VERSION_2
|
||||
endchoice
|
||||
|
||||
config BOOTLOADER_LOG_VERSION
|
||||
int
|
||||
default 1 if BOOTLOADER_LOG_VERSION_1
|
||||
default 2 if BOOTLOADER_LOG_VERSION_2
|
||||
help
|
||||
This configuration sets the log version number based on the chosen log version.
|
||||
|
||||
choice BOOTLOADER_LOG_LEVEL
|
||||
bool "Bootloader log verbosity"
|
||||
default BOOTLOADER_LOG_LEVEL_INFO
|
||||
@@ -50,8 +29,6 @@ menu "Log"
|
||||
default 4 if BOOTLOADER_LOG_LEVEL_DEBUG
|
||||
default 5 if BOOTLOADER_LOG_LEVEL_VERBOSE
|
||||
|
||||
rsource "Kconfig.log.format"
|
||||
|
||||
rsource "Kconfig.log.settings"
|
||||
orsource "Kconfig.log.format"
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -3,23 +3,11 @@ menu "Format"
|
||||
config BOOTLOADER_LOG_COLORS
|
||||
bool "Color"
|
||||
default n
|
||||
select BOOTLOADER_LOG_COLORS_SUPPORT if BOOTLOADER_LOG_VERSION_2
|
||||
help
|
||||
Enable ANSI terminal color codes. Logs (info, errors, warnings) will contain color codes.
|
||||
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.
|
||||
|
||||
config BOOTLOADER_LOG_COLORS_SUPPORT
|
||||
bool "Allow enabling color output at run time"
|
||||
depends on BOOTLOADER_LOG_VERSION_2
|
||||
default n
|
||||
help
|
||||
Enables support for color codes in the esp_log() function. If CONFIG_LOG_COLORS is enabled, this option
|
||||
is always active. If CONFIG_LOG_COLORS is disabled, this option allows you to still handle color codes
|
||||
in specific files by defining ESP_LOG_COLOR_DISABLED as 0 before including esp_log.h.
|
||||
|
||||
Note that enabling this option may slightly increase RAM/FLASH usage due to additional color handling
|
||||
functionality. It provides flexibility to manage color output even when CONFIG_LOG_COLORS is turned off.
|
||||
|
||||
choice BOOTLOADER_LOG_TIMESTAMP_SOURCE
|
||||
prompt "Timestamp"
|
||||
default BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS
|
||||
@@ -40,25 +28,11 @@ menu "Format"
|
||||
|
||||
config BOOTLOADER_LOG_TIMESTAMP_SOURCE_NONE
|
||||
bool "None"
|
||||
depends on BOOTLOADER_LOG_VERSION_2
|
||||
depends on NO_SYMBOL # hide it now, turn it on final MR
|
||||
|
||||
config BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS
|
||||
bool "Milliseconds Since Boot"
|
||||
select BOOTLOADER_LOG_TIMESTAMP_SUPPORT if BOOTLOADER_LOG_VERSION_2
|
||||
|
||||
endchoice # BOOTLOADER_LOG_TIMESTAMP_SOURCE
|
||||
|
||||
config BOOTLOADER_LOG_TIMESTAMP_SUPPORT
|
||||
bool "Allow enabling timestamp output at run time"
|
||||
depends on BOOTLOADER_LOG_VERSION_2
|
||||
default y
|
||||
help
|
||||
Enables support for timestamp in the esp_log() function.
|
||||
If CONFIG_LOG_TIMESTAMP_SOURCE_NONE, this option allows you to still handle timestamp
|
||||
in specific files by defining ESP_LOG_TIMESTAMP_DISABLED as 0 before including esp_log.h.
|
||||
|
||||
Note that enabling this option may slightly increase RAM/FLASH usage due to additional timestamp handling
|
||||
functionality. It provides flexibility to manage timestamp output even when
|
||||
CONFIG_LOG_TIMESTAMP_SOURCE_NONE.
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
menu "Settings"
|
||||
|
||||
config BOOTLOADER_LOG_MODE_TEXT_EN
|
||||
bool
|
||||
|
||||
config BOOTLOADER_LOG_MODE_BINARY_EN
|
||||
bool
|
||||
|
||||
choice BOOTLOADER_LOG_MODE
|
||||
prompt "Log Mode"
|
||||
default BOOTLOADER_LOG_MODE_TEXT
|
||||
|
||||
config BOOTLOADER_LOG_MODE_TEXT
|
||||
bool "Text Log Mode"
|
||||
select BOOTLOADER_LOG_MODE_TEXT_EN
|
||||
help
|
||||
Enables text-based logging, where log messages are stored in a human-readable format.
|
||||
This mode is useful for development and debugging, as it allows logs to be easily
|
||||
read and interpreted without additional processing.
|
||||
|
||||
config BOOTLOADER_LOG_MODE_BINARY
|
||||
bool "Binary Log Mode"
|
||||
select BOOTLOADER_LOG_MODE_BINARY_EN
|
||||
depends on BOOTLOADER_LOG_VERSION_2
|
||||
help
|
||||
Enables binary logging with host-side format string expansion. In this mode, the
|
||||
format argument of ESP_LOGx, ESP_EARLY_LOG, and ESP_DRAM_LOG macros is stored in a
|
||||
NOLOAD section, not included in the final binary file. This reduces flash usage by
|
||||
approximately 10% - 35%. The esp_log() function uses the binary log handler to output
|
||||
messages. Instead of sending the full log string, the chip transmits only the
|
||||
addresses of these strings (if present in the ELF file). If the format string
|
||||
cannot be found in the ELF file, the chip sends the entire string. The host-side
|
||||
monitor tool, which has access to the ELF file, reconstructs the log message using
|
||||
the format string.
|
||||
This reduces firmware size by eliminating format strings from
|
||||
flash memory and removing the usage of printf-like functions, potentially freeing up
|
||||
a few kilobytes of space. To further reduce firmware size, wrap string data with ESP_LOG_ATTR_STR.
|
||||
|
||||
endchoice
|
||||
endmenu
|
||||
@@ -1,14 +1,12 @@
|
||||
menu "Bootloader config"
|
||||
|
||||
orsource "../esp_bootloader_format/Kconfig.bootloader"
|
||||
orsource "Kconfig.app_rollback"
|
||||
orsource "Kconfig.bootloader_rollback"
|
||||
|
||||
config BOOTLOADER_OFFSET_IN_FLASH
|
||||
hex
|
||||
default 0x1000 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2
|
||||
# the first 2 sectors are reserved for the key manager with AES-XTS (flash encryption) purpose
|
||||
default 0x2000 if IDF_TARGET_ESP32P4 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32H4
|
||||
default 0x2000 if IDF_TARGET_ESP32P4 || IDF_TARGET_ESP32C5
|
||||
default 0x0
|
||||
help
|
||||
Offset address that 2nd bootloader will be flashed to.
|
||||
@@ -314,6 +312,71 @@ menu "Bootloader config"
|
||||
- these options can increase the execution time.
|
||||
Note: RTC_WDT will reset while encryption operations will be performed.
|
||||
|
||||
config BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
bool "Enable app rollback support"
|
||||
default n
|
||||
help
|
||||
After updating the app, the bootloader runs a new app with the "ESP_OTA_IMG_PENDING_VERIFY" state set.
|
||||
This state prevents the re-run of this app. After the first boot of the new app in the user code, the
|
||||
function should be called to confirm the operability of the app or vice versa about its non-operability.
|
||||
If the app is working, then it is marked as valid. Otherwise, it is marked as not valid and rolls back to
|
||||
the previous working app. A reboot is performed, and the app is booted before the software update.
|
||||
Note: If during the first boot a new app the power goes out or the WDT works, then roll back will happen.
|
||||
Rollback is possible only between the apps with the same security versions.
|
||||
|
||||
config BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
bool "Enable app anti-rollback support"
|
||||
depends on BOOTLOADER_APP_ROLLBACK_ENABLE
|
||||
default n
|
||||
help
|
||||
This option prevents rollback to previous firmware/application image with lower security version.
|
||||
|
||||
config BOOTLOADER_APP_SECURE_VERSION
|
||||
int "eFuse secure version of app"
|
||||
depends on BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
default 0
|
||||
help
|
||||
The secure version is the sequence number stored in the header of each firmware.
|
||||
The security version is set in the bootloader, version is recorded in the eFuse field
|
||||
as the number of set ones. The allocated number of bits in the efuse field
|
||||
for storing the security version is limited (see BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD option).
|
||||
|
||||
Bootloader: When bootloader selects an app to boot, an app is selected that has
|
||||
a security version greater or equal that recorded in eFuse field.
|
||||
The app is booted with a higher (or equal) secure version.
|
||||
|
||||
The security version is worth increasing if in previous versions there is
|
||||
a significant vulnerability and their use is not acceptable.
|
||||
|
||||
Your partition table should has a scheme with ota_0 + ota_1 (without factory).
|
||||
|
||||
config BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD
|
||||
int "Size of the efuse secure version field"
|
||||
depends on BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
range 1 32 if IDF_TARGET_ESP32
|
||||
default 32 if IDF_TARGET_ESP32
|
||||
range 1 4 if IDF_TARGET_ESP32C2
|
||||
default 4 if IDF_TARGET_ESP32C2
|
||||
range 1 16
|
||||
default 16
|
||||
help
|
||||
The size of the efuse secure version field.
|
||||
Its length is limited to 32 bits for ESP32 and 16 bits for ESP32-S2.
|
||||
This determines how many times the security version can be increased.
|
||||
|
||||
config BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE
|
||||
bool "Emulate operations with efuse secure version(only test)"
|
||||
default n
|
||||
depends on BOOTLOADER_APP_ANTI_ROLLBACK
|
||||
select EFUSE_VIRTUAL
|
||||
select EFUSE_VIRTUAL_KEEP_IN_FLASH
|
||||
help
|
||||
This option allows to emulate read/write operations with all eFuses and efuse secure version.
|
||||
It allows to test anti-rollback implementation without permanent write eFuse bits.
|
||||
There should be an entry in partition table with following details: `emul_efuse, data, efuse, , 0x2000`.
|
||||
|
||||
This option enables: EFUSE_VIRTUAL and EFUSE_VIRTUAL_KEEP_IN_FLASH.
|
||||
|
||||
config BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP
|
||||
bool "Skip image validation when exiting deep sleep"
|
||||
# note: dependencies for this config item are different to other "skip image validation"
|
||||
@@ -534,7 +597,6 @@ menu "Security features"
|
||||
config SECURE_SIGNED_APPS_RSA_SCHEME
|
||||
bool "RSA"
|
||||
depends on SECURE_BOOT_V2_RSA_SUPPORTED && (SECURE_SIGNED_APPS_NO_SECURE_BOOT || SECURE_BOOT_V2_ENABLED)
|
||||
depends on !(IDF_TARGET_ESP32C5 && ESP32C5_REV_MIN_FULL < 1)
|
||||
help
|
||||
Appends the RSA-3072 based Signature block to the application.
|
||||
Refer to <Secure Boot Version 2 documentation link> before enabling.
|
||||
@@ -764,7 +826,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
|
||||
depends on SECURE_BOOT_V2_ENABLED && SECURE_BOOT_BUILD_SIGNED_BINARIES
|
||||
default n
|
||||
help
|
||||
When Secure Boot V2 is enabled, by default the bootloader is not flashed along with other artifacts
|
||||
@@ -1032,9 +1094,8 @@ menu "Security features"
|
||||
DIS_USB_SERIAL_JTAG, DIS_FORCE_DOWNLOAD, DIS_TWAI, JTAG_SEL_ENABLE,
|
||||
DIS_PAD_JTAG, DIS_DOWNLOAD_MANUAL_ENCRYPT.
|
||||
|
||||
ESP32-H2 & ESP32H21: DIS_ICACHE, DIS_ICACHE, DIS_USB_JTAG, POWERGLITCH_EN, DIS_FORCE_DOWNLOAD,
|
||||
SPI_DOWNLOAD_MSPI_DIS, DIS_TWAI, JTAG_SEL_ENABLE, DIS_PAD_JTAG, DIS_DOWNLOAD_MANUAL_ENCRYPT,
|
||||
DIS_USB_SERIAL_JTAG
|
||||
ESP32-H2: DIS_ICACHE, DIS_USB_JTAG, POWERGLITCH_EN, DIS_FORCE_DOWNLOAD, SPI_DOWNLOAD_MSPI_DIS,
|
||||
DIS_TWAI, JTAG_SEL_ENABLE, DIS_PAD_JTAG, DIS_DOWNLOAD_MANUAL_ENCRYPT.
|
||||
|
||||
ESP32-S2: DIS_ICACHE, DIS_DCACHE, DIS_DOWNLOAD_ICACHE, DIS_DOWNLOAD_DCACHE,
|
||||
DIS_FORCE_DOWNLOAD, DIS_USB, DIS_TWAI, DIS_BOOT_REMAP, SOFT_DIS_JTAG,
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
idf_build_get_property(esp_tee_build ESP_TEE_BUILD)
|
||||
|
||||
set(BOOTLOADER_OFFSET ${CONFIG_BOOTLOADER_OFFSET_IN_FLASH})
|
||||
|
||||
# Do not generate flash file when building bootloader
|
||||
if(BOOTLOADER_BUILD OR esp_tee_build OR NOT CONFIG_APP_BUILD_BOOTLOADER)
|
||||
if(BOOTLOADER_BUILD OR NOT CONFIG_APP_BUILD_BOOTLOADER)
|
||||
return()
|
||||
endif()
|
||||
|
||||
@@ -118,13 +116,8 @@ idf_build_get_property(sdkconfig SDKCONFIG)
|
||||
idf_build_get_property(python PYTHON)
|
||||
idf_build_get_property(extra_cmake_args EXTRA_CMAKE_ARGS)
|
||||
|
||||
# BOOTLOADER_EXTRA_COMPONENT_DIRS may have been set by the `main` component, do not overwrite it
|
||||
idf_build_get_property(bootloader_extra_component_dirs BOOTLOADER_EXTRA_COMPONENT_DIRS)
|
||||
list(APPEND bootloader_extra_component_dirs "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
# We cannot pass lists as a parameter to the external project without modifying the ';' separator
|
||||
# We cannot pass lists are a parameter to the external project without modifying the ';' separator
|
||||
string(REPLACE ";" "|" BOOTLOADER_IGNORE_EXTRA_COMPONENT "${BOOTLOADER_IGNORE_EXTRA_COMPONENT}")
|
||||
string(REPLACE ";" "|" bootloader_extra_component_dirs "${bootloader_extra_component_dirs}")
|
||||
|
||||
externalproject_add(bootloader
|
||||
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/subproject"
|
||||
@@ -134,7 +127,7 @@ externalproject_add(bootloader
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS -DSDKCONFIG=${sdkconfig} -DIDF_PATH=${idf_path} -DIDF_TARGET=${idf_target}
|
||||
-DPYTHON_DEPS_CHECKED=1 -DPYTHON=${python}
|
||||
-DEXTRA_COMPONENT_DIRS=${bootloader_extra_component_dirs}
|
||||
-DEXTRA_COMPONENT_DIRS=${CMAKE_CURRENT_LIST_DIR}
|
||||
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
|
||||
-DIGNORE_EXTRA_COMPONENT=${BOOTLOADER_IGNORE_EXTRA_COMPONENT}
|
||||
${sign_key_arg} ${ver_key_arg}
|
||||
|
||||
@@ -32,11 +32,10 @@ set(COMPONENTS
|
||||
main
|
||||
efuse
|
||||
esp_system
|
||||
newlib
|
||||
esp_tee)
|
||||
newlib)
|
||||
|
||||
# EXTRA_COMPONENT_DIRS can be populated with directories containing one or several components.
|
||||
# Make sure this variable contains `bootloader_components` directory of the project being compiled.
|
||||
# Make EXTRA_COMPONENT_DIRS variable to point to the bootloader_components directory
|
||||
# of the project being compiled
|
||||
set(PROJECT_EXTRA_COMPONENTS "${PROJECT_SOURCE_DIR}/bootloader_components")
|
||||
if(EXISTS ${PROJECT_EXTRA_COMPONENTS})
|
||||
list(APPEND EXTRA_COMPONENT_DIRS "${PROJECT_EXTRA_COMPONENTS}")
|
||||
@@ -65,10 +64,6 @@ set(common_req log esp_rom esp_common esp_hw_support newlib)
|
||||
idf_build_set_property(EXTRA_COMPONENT_EXCLUDE_DIRS "${EXTRA_COMPONENT_EXCLUDE_DIRS}")
|
||||
idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${common_req}")
|
||||
idf_build_set_property(__OUTPUT_SDKCONFIG 0)
|
||||
# Define a property for the default linker script
|
||||
set(LD_DEFAULT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/main/ld/${IDF_TARGET}")
|
||||
idf_build_set_property(BOOTLOADER_LINKER_SCRIPT "${LD_DEFAULT_PATH}/bootloader.ld" APPEND)
|
||||
idf_build_set_property(BOOTLOADER_LINKER_SCRIPT "${LD_DEFAULT_PATH}/bootloader.rom.ld" APPEND)
|
||||
project(bootloader)
|
||||
|
||||
idf_build_set_property(COMPILE_DEFINITIONS "BOOTLOADER_BUILD=1" APPEND)
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
idf_component_register(SRCS "bootloader_start.c"
|
||||
REQUIRES bootloader bootloader_support)
|
||||
|
||||
idf_build_get_property(scripts BOOTLOADER_LINKER_SCRIPT)
|
||||
set(target_folder "${target}")
|
||||
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
set(scripts "ld/${target_folder}/bootloader.ld")
|
||||
|
||||
list(APPEND scripts "ld/${target_folder}/bootloader.rom.ld")
|
||||
target_linker_script(${COMPONENT_LIB} INTERFACE "${scripts}")
|
||||
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u bootloader_hooks_include")
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -53,11 +53,6 @@ void __attribute__((noreturn)) call_start_cpu0(void)
|
||||
bootloader_reset();
|
||||
}
|
||||
|
||||
// 2.1 Load the TEE image
|
||||
#if CONFIG_SECURE_ENABLE_TEE
|
||||
bootloader_utility_load_tee_image(&bs);
|
||||
#endif
|
||||
|
||||
// 3. Load the app image for booting
|
||||
bootloader_utility_load_boot_image(&bs, boot_index);
|
||||
}
|
||||
@@ -134,10 +129,8 @@ static int selected_boot_partition(const bootloader_state_t *bs)
|
||||
return boot_index;
|
||||
}
|
||||
|
||||
#if CONFIG_LIBC_NEWLIB
|
||||
// Return global reent struct if any newlib functions are linked to bootloader
|
||||
struct _reent *__getreent(void)
|
||||
{
|
||||
return _GLOBAL_REENT;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -261,15 +261,4 @@ SECTIONS
|
||||
|
||||
.comment 0 : { *(.comment) }
|
||||
.note.GNU-stack 0: { *(.note.GNU-stack) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -27,7 +27,7 @@ bootloader_usable_dram_end = 0x3fcdcb70;
|
||||
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 = 0x2800;
|
||||
bootloader_iram_seg_len = 0x2000;
|
||||
|
||||
/* 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;
|
||||
@@ -94,7 +94,6 @@ SECTIONS
|
||||
*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.*)
|
||||
*libriscv.a:rv_utils.*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
@@ -272,17 +271,6 @@ SECTIONS
|
||||
* And so forth...
|
||||
*/
|
||||
/DISCARD/ : { *(.rela.*) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -27,7 +27,7 @@ bootloader_usable_dram_end = 0x3fcdc710;
|
||||
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 = 0x2800;
|
||||
bootloader_iram_seg_len = 0x2000;
|
||||
|
||||
/* 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;
|
||||
@@ -94,7 +94,6 @@ SECTIONS
|
||||
*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.*)
|
||||
*libriscv.a:rv_utils.*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
@@ -273,16 +272,6 @@ SECTIONS
|
||||
*/
|
||||
/DISCARD/ : { *(.rela.*) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -7,24 +7,24 @@
|
||||
* Make sure the bootloader can load into main memory without overwriting itself.
|
||||
*
|
||||
* ESP32-C5 ROM static data usage is as follows:
|
||||
* - 0x4084e5a0 - 0x4085c5a0: Shared buffers, used in UART/USB/SPI download mode only
|
||||
* - 0x4085c5a0 - 0x4085e5a0: PRO CPU stack, can be reclaimed as heap after RTOS startup
|
||||
* - 0x4085e5a0 - 0x40860000: ROM .bss and .data (not easily reclaimable)
|
||||
* - 0x4084e9a0 - 0x4085c9a0: Shared buffers, used in UART/USB/SPI download mode only
|
||||
* - 0x4085c9a0 - 0x4085e9a0: PRO CPU stack, can be reclaimed as heap after RTOS startup
|
||||
* - 0x4085e9a0 - 0x40860000: ROM .bss and .data (not easily reclaimable)
|
||||
*
|
||||
* The 2nd stage bootloader can take space up to the end of ROM shared
|
||||
* buffers area (0x4085c5a0).
|
||||
* buffers area (0x4085c9a0).
|
||||
*/
|
||||
|
||||
/* We consider 0x4085c5a0 to be the last usable address for 2nd stage bootloader stack overhead, dram_seg,
|
||||
/* We consider 0x4085c9a0 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 = 0x4085c5a0;
|
||||
bootloader_usable_dram_end = 0x4085c9a0;
|
||||
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 = 0x2A00;
|
||||
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;
|
||||
@@ -45,7 +45,7 @@ MEMORY
|
||||
* 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 == 0x4084e5a0, "bootloader_iram_loader_seg_start inconsistent with SRAM_DRAM_END");
|
||||
ASSERT(bootloader_iram_loader_seg_start == 0x4084E9A0, "bootloader_iram_loader_seg_start inconsistent with SRAM_DRAM_END");
|
||||
|
||||
/* Default entry point: */
|
||||
ENTRY(call_start_cpu0);
|
||||
@@ -92,7 +92,6 @@ SECTIONS
|
||||
*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.*)
|
||||
*libriscv.a:rv_utils.*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
@@ -271,48 +270,38 @@ SECTIONS
|
||||
*/
|
||||
/DISCARD/ : { *(.rela.*) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Appendix: Memory Usage of ROM bootloader
|
||||
*
|
||||
* 0x4084e5a0 ------------------> _dram0_0_start
|
||||
* 0x4084e9a0 ------------------> _dram0_0_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
|
||||
* | |
|
||||
* | |
|
||||
* 0x4085c5a0 ------------------> __stack_sentry
|
||||
* 0x4085c9a0 ------------------> __stack_sentry
|
||||
* | |
|
||||
* | | 2. Startup pro cpu stack (freed when IDF app is running)
|
||||
* | |
|
||||
* 0x4085e5a0 ------------------> __stack (pro cpu)
|
||||
* 0x4085e9a0 ------------------> __stack (pro cpu)
|
||||
* | |
|
||||
* | |
|
||||
* | | 3. Shared memory only used in startup code or nonos/early boot*
|
||||
* | | (can be freed when IDF runs)
|
||||
* | |
|
||||
* | |
|
||||
* 0x4085f4f8 ------------------> _dram0_rtos_reserved_start
|
||||
* 0x4085f500 ------------------> _dram0_rtos_reserved_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 4. Shared memory used in startup code and when IDF runs
|
||||
* | |
|
||||
* | |
|
||||
* 0x4085fbb4 ------------------> _dram0_rtos_reserved_end
|
||||
* 0x4085fc5c ------------------> _dram0_rtos_reserved_end
|
||||
* | |
|
||||
* 0x4085fc60 ------------------> _data_start_interface
|
||||
* 0x4085fc70 ------------------> _data_start_interface
|
||||
* | |
|
||||
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
|
||||
* | |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -24,7 +24,7 @@ bootloader_usable_dram_end = 0x4087c610;
|
||||
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 = 0x2D00;
|
||||
bootloader_iram_seg_len = 0x2500;
|
||||
|
||||
/* 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;
|
||||
@@ -71,7 +71,6 @@ SECTIONS
|
||||
*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_utility_tee.*(.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.*)
|
||||
@@ -93,7 +92,6 @@ SECTIONS
|
||||
*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.*)
|
||||
*libriscv.a:rv_utils.*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
@@ -272,16 +270,6 @@ SECTIONS
|
||||
*/
|
||||
/DISCARD/ : { *(.rela.*) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -24,7 +24,7 @@ bootloader_usable_dram_end = 0x4084ca70;
|
||||
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 = 0x2D00;
|
||||
bootloader_iram_seg_len = 0x2500;
|
||||
|
||||
/* 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;
|
||||
@@ -92,7 +92,6 @@ SECTIONS
|
||||
*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.*)
|
||||
*libriscv.a:rv_utils.*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
@@ -271,16 +270,6 @@ SECTIONS
|
||||
*/
|
||||
/DISCARD/ : { *(.rela.*) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ bootloader_usable_dram_end = 0x4084cfd0;
|
||||
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 = 0x2D00;
|
||||
bootloader_iram_seg_len = 0x2500;
|
||||
|
||||
/* 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;
|
||||
@@ -92,7 +92,6 @@ SECTIONS
|
||||
*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.*)
|
||||
*libriscv.a:rv_utils.*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
@@ -271,16 +270,6 @@ SECTIONS
|
||||
*/
|
||||
/DISCARD/ : { *(.rela.*) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,319 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024-2025 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.
|
||||
*
|
||||
* ESP32-H21 ROM static data usage is as follows:
|
||||
* - 0x4083ba78 - 0x4084d380: Shared buffers, used in UART/USB/SPI download mode only
|
||||
* - 0x4084d380 - 0x4084f380: PRO CPU stack, can be reclaimed as heap after RTOS startup
|
||||
* - 0x4084f380 - 0x4084fee0: ROM .bss and .data used in startup code or nonos/early boot (can be freed when IDF runs)
|
||||
* - 0x4084fee0 - 0x40850000: ROM .bss and .data used in startup code and when IDF runs (cannot be freed)
|
||||
*
|
||||
* The 2nd stage bootloader can take space up to the end of ROM shared
|
||||
* buffers area (0x4084d380).
|
||||
*/
|
||||
|
||||
/* We consider 0x3fcdc710 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 = 0x40849a78;
|
||||
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 = 0x2D00;
|
||||
|
||||
/* 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/esp32h21/memory.ld.in to the same value.
|
||||
*/
|
||||
ASSERT(bootloader_iram_loader_seg_start == 0x4083ba78, "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_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.*)
|
||||
*libriscv.a:rv_utils.*(.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.*) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Appendix: Memory Usage of ROM bootloader
|
||||
*
|
||||
* 0x4083ba78 ------------------> _dram0_0_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
|
||||
* | |
|
||||
* | |
|
||||
* 0x4084d380 ------------------> __stack_sentry
|
||||
* | |
|
||||
* | | 2. Startup pro cpu stack (freed when IDF app is running)
|
||||
* | |
|
||||
* 0x4084f380 ------------------> __stack (pro cpu)
|
||||
* | |
|
||||
* | |
|
||||
* | | 3. Shared memory only used in startup code or nonos/early boot*
|
||||
* | | (can be freed when IDF runs)
|
||||
* | |
|
||||
* | |
|
||||
* 0x4084fee0 ------------------> _dram0_rtos_reserved_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 4. Shared memory used in startup code and when IDF runs
|
||||
* | |
|
||||
* | |
|
||||
* 0x4084ffc0 ------------------> _dram0_rtos_reserved_end
|
||||
* | |
|
||||
* 0x4084ffc8 ------------------> _data_start_interface
|
||||
* | |
|
||||
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
|
||||
* | |
|
||||
* 0x40850000 ------------------> _data_end_interface
|
||||
*/
|
||||
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/* No definition for ESP32-H21 target */
|
||||
@@ -1,307 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 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.
|
||||
*
|
||||
* ESP32-H4 ROM static data usage is as follows:
|
||||
* - 0x4084d350 - 0x4085b350: Shared buffers, used in UART/USB/SPI download mode only
|
||||
* - 0x4085b350 - 0x4085d350: PRO CPU stack, can be reclaimed as heap after RTOS startup
|
||||
* - 0x4085d350 - 0x40860000: ROM .bss and .data (not easily reclaimable)
|
||||
*
|
||||
* The 2nd stage bootloader can take space up to the end of ROM shared
|
||||
* buffers area (0x4085b350).
|
||||
*/
|
||||
|
||||
/* We consider 0x4085b350 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 = 0x4085d350;
|
||||
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_SEG_END in components/esp_system/ld/esp32h4/memory.ld.in to the same value.
|
||||
*/
|
||||
ASSERT(bootloader_iram_loader_seg_start == 0x4084f350, "bootloader_iram_loader_seg_start inconsistent with SRAM_SEG_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.*)
|
||||
*libriscv.a:rv_utils.*(.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
|
||||
*
|
||||
* 0x4084d350 ------------------> _dram0_0_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
|
||||
* | |
|
||||
* | |
|
||||
* 0x4085b350 ------------------> __stack_sentry
|
||||
* | |
|
||||
* | | 2. Startup pro cpu stack (freed when IDF app is running)
|
||||
* | |
|
||||
* 0x4085d350 ------------------> __stack (pro cpu)
|
||||
* | |
|
||||
* | |
|
||||
* | | 3. Shared memory only used in startup code or nonos/early boot*
|
||||
* | | (can be freed when IDF runs)
|
||||
* | |
|
||||
* | |
|
||||
* 0x4085fea8 ------------------> _dram0_rtos_reserved_start
|
||||
* | |
|
||||
* | |
|
||||
* | | 4. Shared memory used in startup code and when IDF runs
|
||||
* | |
|
||||
* | |
|
||||
* 0x4085ffb4 ------------------> _dram0_rtos_reserved_end
|
||||
* | |
|
||||
* 0x4085ffc4 ------------------> _data_start_interface
|
||||
* | |
|
||||
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
|
||||
* | |
|
||||
* 0x40860000 ------------------> _data_end_interface
|
||||
*/
|
||||
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/* No definition for ESP32-H4 target */
|
||||
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/**
|
||||
* TODO: IDF-8002
|
||||
* Simplified memory map for the bootloader.
|
||||
* Make sure the bootloader can load into main memory without overwriting itself.
|
||||
*
|
||||
@@ -25,7 +26,7 @@ bootloader_usable_dram_end = 0x4ff3abd0;
|
||||
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 = 0x2D00;
|
||||
bootloader_iram_seg_len = 0x2000;
|
||||
|
||||
/* 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;
|
||||
@@ -92,7 +93,6 @@ SECTIONS
|
||||
*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.*)
|
||||
*libriscv.a:rv_utils.*(.literal .text .literal.* .text.*)
|
||||
*(.fini.literal)
|
||||
*(.fini)
|
||||
*(.gnu.version)
|
||||
@@ -271,16 +271,6 @@ SECTIONS
|
||||
*/
|
||||
/DISCARD/ : { *(.rela.*) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -251,14 +251,4 @@ SECTIONS
|
||||
.comment 0 : { *(.comment) }
|
||||
.note.GNU-stack 0: { *(.note.GNU-stack) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -285,16 +285,6 @@ SECTIONS
|
||||
.comment 0 : { *(.comment) }
|
||||
.note.GNU-stack 0: { *(.note.GNU-stack) }
|
||||
|
||||
/**
|
||||
* This section is not included in the binary image; it is only present in the ELF file.
|
||||
* It is used to keep certain symbols in the ELF file.
|
||||
*/
|
||||
.noload 0 (INFO) :
|
||||
{
|
||||
_noload_keep_in_elf_start = ABSOLUTE(.);
|
||||
KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*))
|
||||
_noload_keep_in_elf_end = ABSOLUTE(.);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,37 +1,9 @@
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
idf_build_get_property(esp_tee_build ESP_TEE_BUILD)
|
||||
|
||||
if(${target} STREQUAL "linux")
|
||||
return() # This component is not supported by the POSIX/Linux simulator
|
||||
endif()
|
||||
|
||||
if(esp_tee_build)
|
||||
set(tee_inc_dirs "include"
|
||||
"private_include"
|
||||
"bootloader_flash/include")
|
||||
|
||||
set(tee_srcs "src/flash_partitions.c"
|
||||
"src/bootloader_sha.c"
|
||||
"src/bootloader_common_loader.c"
|
||||
"src/esp_image_format.c"
|
||||
"src/bootloader_utility.c"
|
||||
"src/bootloader_utility_tee.c"
|
||||
"bootloader_flash/src/bootloader_flash.c")
|
||||
|
||||
if(CONFIG_SECURE_BOOT_V2_ENABLED)
|
||||
if(CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME OR CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME)
|
||||
list(APPEND tee_srcs "src/secure_boot_v2/secure_boot_signatures_bootloader.c"
|
||||
"src/secure_boot_v2/secure_boot.c"
|
||||
"src/${IDF_TARGET}/secure_boot_secure_features.c")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS ${tee_srcs}
|
||||
INCLUDE_DIRS ${tee_inc_dirs}
|
||||
PRIV_REQUIRES efuse esp_app_format)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(srcs
|
||||
"src/bootloader_common.c"
|
||||
"src/bootloader_common_loader.c"
|
||||
@@ -64,11 +36,6 @@ if(CONFIG_APP_BUILD_TYPE_APP_2NDBOOT)
|
||||
)
|
||||
endif()
|
||||
|
||||
list(APPEND srcs "src/bootloader_sha.c")
|
||||
if(CONFIG_ESP_ROM_REV0_HAS_NO_ECDSA_INTERFACE)
|
||||
list(APPEND srcs "src/${IDF_TARGET}/bootloader_ecdsa.c")
|
||||
endif()
|
||||
|
||||
if(BOOTLOADER_BUILD OR CONFIG_APP_BUILD_TYPE_RAM)
|
||||
set(include_dirs "include" "bootloader_flash/include"
|
||||
"private_include")
|
||||
@@ -78,14 +45,18 @@ if(BOOTLOADER_BUILD OR CONFIG_APP_BUILD_TYPE_RAM)
|
||||
"src/bootloader_clock_loader.c"
|
||||
"src/bootloader_console.c"
|
||||
"src/bootloader_console_loader.c"
|
||||
"src/${IDF_TARGET}/bootloader_sha.c"
|
||||
"src/${IDF_TARGET}/bootloader_soc.c"
|
||||
"src/${IDF_TARGET}/bootloader_${IDF_TARGET}.c"
|
||||
)
|
||||
if(CONFIG_SECURE_ENABLE_TEE)
|
||||
list(APPEND srcs "src/bootloader_utility_tee.c")
|
||||
endif()
|
||||
list(APPEND priv_requires hal)
|
||||
if(CONFIG_ESP_ROM_REV0_HAS_NO_ECDSA_INTERFACE)
|
||||
list(APPEND srcs
|
||||
"src/${IDF_TARGET}/bootloader_ecdsa.c")
|
||||
endif()
|
||||
else()
|
||||
list(APPEND srcs
|
||||
"src/idf/bootloader_sha.c")
|
||||
set(include_dirs "include" "bootloader_flash/include")
|
||||
set(priv_include_dirs "private_include")
|
||||
# heap is required for `heap_memory_layout.h` header
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -28,7 +28,7 @@ uint32_t bootloader_read_flash_id(void);
|
||||
/**
|
||||
* @brief Startup flow recommended by XMC. Call at startup before any erase/write operation.
|
||||
*
|
||||
* @return ESP_OK When startup successfully, otherwise ESP_FAIL (indicating you should reboot before erase/write).
|
||||
* @return ESP_OK When startup successfully, otherwise ESP_FAIL (indiciating you should reboot before erase/write).
|
||||
*/
|
||||
esp_err_t bootloader_flash_xmc_startup(void);
|
||||
|
||||
@@ -36,16 +36,9 @@ esp_err_t bootloader_flash_xmc_startup(void);
|
||||
* @brief Unlock Flash write protect.
|
||||
* Please do not call this function in SDK.
|
||||
*
|
||||
* @note This can be overridden because it's attribute weak, when there is a same name symbol.
|
||||
* @note This can be overridden because it's attribute weak.
|
||||
*/
|
||||
esp_err_t bootloader_flash_unlock(void);
|
||||
|
||||
/**
|
||||
* @brief Unlock Flash write protect.
|
||||
* This is alias to `bootloader_flash_unlock`.
|
||||
* Please do not call this function in SDK.
|
||||
*/
|
||||
esp_err_t bootloader_flash_unlock_default(void);
|
||||
esp_err_t __attribute__((weak)) bootloader_flash_unlock(void);
|
||||
|
||||
/**
|
||||
* @brief Reset the flash chip (66H + 99H).
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -99,20 +99,15 @@ void bootloader_write_status_8b_xmc25qu64a(unsigned new_status);
|
||||
|
||||
Searching of this table stops when the first match is found.
|
||||
*/
|
||||
extern const bootloader_qio_info_t* bootloader_flash_qe_support_list;
|
||||
|
||||
/**
|
||||
* @brief The bootloader flash qe list count number.
|
||||
*/
|
||||
extern uint8_t bootloader_flash_qe_list_count;
|
||||
extern const bootloader_qio_info_t __attribute__((weak)) bootloader_flash_qe_support_list[];
|
||||
|
||||
/**
|
||||
* @brief Unlock Flash write protect.
|
||||
* Please do not call this function in SDK.
|
||||
*
|
||||
* @note This can be overridden because it's attribute weak, when there is a same name symbol.
|
||||
* @note This can be overridden because it's attribute weak.
|
||||
*/
|
||||
esp_err_t bootloader_flash_unlock(void);
|
||||
esp_err_t __attribute__((weak)) bootloader_flash_unlock(void);
|
||||
|
||||
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH || CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_OCTAL_FLASH
|
||||
/**
|
||||
@@ -120,7 +115,7 @@ esp_err_t bootloader_flash_unlock(void);
|
||||
*
|
||||
* @param flash_mode SPI flash working mode.
|
||||
*
|
||||
* @note This can be overridden because it's attribute weak, when there is a same name symbol.
|
||||
* @note This can be overridden because it's attribute weak.
|
||||
*/
|
||||
void __attribute__((weak)) bootloader_flash_32bits_address_map_enable(esp_rom_spiflash_read_mode_t flash_mode);
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -128,10 +128,7 @@ esp_err_t bootloader_flash_read(size_t src_addr, void *dest, size_t size, bool a
|
||||
*
|
||||
* @note All of dest_addr, src and size have to be 4-byte aligned. If write_encrypted is set, dest_addr and size must be 32-byte aligned.
|
||||
*
|
||||
* @note In bootloader, when write_encrypted == true, the src buffer is encrypted in place.
|
||||
*
|
||||
* @note [ESP-TEE] Using this API from the TEE will return an error if the dest_addr lies
|
||||
* within the active TEE partition range.
|
||||
* Note: In bootloader, when write_encrypted == true, the src buffer is encrypted in place.
|
||||
*
|
||||
* @param dest_addr Destination address to write in Flash.
|
||||
* @param src Pointer to the data to write to flash
|
||||
@@ -155,9 +152,6 @@ esp_err_t bootloader_flash_erase_sector(size_t sector);
|
||||
/**
|
||||
* @brief Erase the Flash range.
|
||||
*
|
||||
* @note [ESP-TEE] Using this API from the TEE will return an error if the start_addr lies
|
||||
* within the active TEE partition range.
|
||||
*
|
||||
* @param start_addr start address of flash offset
|
||||
* @param size sector aligned size to be erased
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -13,12 +13,11 @@
|
||||
#include "hal/efuse_ll.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
|
||||
#if !NON_OS_BUILD
|
||||
#ifndef BOOTLOADER_BUILD
|
||||
#include "spi_flash_mmap.h"
|
||||
#endif
|
||||
#include "hal/spi_flash_ll.h"
|
||||
#include "rom/spi_flash.h"
|
||||
#include "esp_private/cache_utils.h"
|
||||
#if !CONFIG_IDF_TARGET_ESP32
|
||||
#include "hal/spimem_flash_ll.h"
|
||||
#endif
|
||||
@@ -45,7 +44,7 @@
|
||||
#define ESP_BOOTLOADER_SPIFLASH_QE_GD_SR2 BIT1 // QE position when you write 8 bits(for SR2) at one time.
|
||||
#define ESP_BOOTLOADER_SPIFLASH_QE_SR1_2BYTE BIT9 // QE position when you write 16 bits at one time.
|
||||
|
||||
#if !NON_OS_BUILD
|
||||
#ifndef BOOTLOADER_BUILD
|
||||
/* Normal app version maps to spi_flash_mmap.h operations...
|
||||
*/
|
||||
static const char *TAG = "bootloader_mmap";
|
||||
@@ -112,7 +111,7 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
|
||||
return esp_flash_erase_region(NULL, start_addr, size);
|
||||
}
|
||||
|
||||
#else // NON_OS_BUILD
|
||||
#else //BOOTLOADER_BUILD
|
||||
/* Bootloader version, uses ROM functions only */
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#include "esp32/rom/cache.h"
|
||||
@@ -128,53 +127,16 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
|
||||
#include "esp32s3/rom/opi_flash.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#include "esp32p4/rom/opi_flash.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C5
|
||||
#include "esp32c5/rom/opi_flash.h"
|
||||
#endif
|
||||
#include "spi_flash/spi_flash_defs.h"
|
||||
|
||||
#if ESP_TEE_BUILD
|
||||
#include "esp_fault.h"
|
||||
#include "esp_flash_partitions.h"
|
||||
#include "rom/spi_flash.h"
|
||||
|
||||
extern bool esp_tee_flash_check_paddr_in_active_tee_part(size_t paddr);
|
||||
#endif
|
||||
|
||||
static const char *TAG = "bootloader_flash";
|
||||
|
||||
/*
|
||||
* NOTE: Memory mapping strategy
|
||||
*
|
||||
* Bootloader:
|
||||
* - Uses the first N-1 MMU entries for general memory mapping.
|
||||
* - Reserves the Nth (last) MMU entry for flash read through the cache
|
||||
* (auto-decryption).
|
||||
* - This strategy is viable because the bootloader runs exclusively
|
||||
* on the device from the internal SRAM.
|
||||
*
|
||||
* ESP-TEE (Trusted Execution Environment)
|
||||
* - Cannot adopt the strategy used by the bootloader as the TEE app operates
|
||||
* in parallel to the REE.
|
||||
* - The few initial MMU entries have already been taken by the TEE and REE
|
||||
* application flash IDROM segments.
|
||||
* - The REE could have also mapped some custom flash partitions it requires.
|
||||
* - Therefore, the TEE uses MMU entries from the end of the range, with the number
|
||||
* of entries corresponding to the size of its IDROM segment sizes.
|
||||
* - The final MMU entry in this range is reserved for flash reads through the
|
||||
* cache (auto-decryption).
|
||||
* - The pages used by TEE are protected by PMP (Physical Memory Protection).
|
||||
* While REE attempts to mmap this protected area would trigger a load access
|
||||
* fault, this is unlikely since the MMU can address up to 16MB at once.
|
||||
*/
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
/* Use first 50 blocks in MMU for bootloader_mmap,
|
||||
50th block for bootloader_flash_read
|
||||
*/
|
||||
#define MMU_BLOCK0_VADDR SOC_DROM_LOW
|
||||
#define MMU_TOTAL_SIZE (0x320000)
|
||||
#define MMU_BLOCK50_VADDR (MMU_BLOCK0_VADDR + MMU_TOTAL_SIZE)
|
||||
#define MMAP_MMU_SIZE (0x320000)
|
||||
#define MMU_BLOCK50_VADDR (MMU_BLOCK0_VADDR + MMAP_MMU_SIZE)
|
||||
#define FLASH_READ_VADDR MMU_BLOCK50_VADDR
|
||||
|
||||
#else // !CONFIG_IDF_TARGET_ESP32
|
||||
@@ -188,89 +150,21 @@ static const char *TAG = "bootloader_flash";
|
||||
* On ESP32S2 we use `(SOC_DRAM0_CACHE_ADDRESS_HIGH - SOC_DRAM0_CACHE_ADDRESS_LOW)`.
|
||||
* As this code is in bootloader, we keep this on ESP32S2
|
||||
*/
|
||||
#define MMU_TOTAL_SIZE (SOC_DRAM0_CACHE_ADDRESS_HIGH - SOC_DRAM0_CACHE_ADDRESS_LOW) // This mmu size means that the mmu size to be mapped
|
||||
#define MMAP_MMU_SIZE (SOC_DRAM0_CACHE_ADDRESS_HIGH - SOC_DRAM0_CACHE_ADDRESS_LOW) // This mmu size means that the mmu size to be mapped
|
||||
#else
|
||||
#define MMU_TOTAL_SIZE (SOC_DRAM_FLASH_ADDRESS_HIGH - SOC_DRAM_FLASH_ADDRESS_LOW) // This mmu size means that the mmu size to be mapped
|
||||
#define MMAP_MMU_SIZE (SOC_DRAM_FLASH_ADDRESS_HIGH - SOC_DRAM_FLASH_ADDRESS_LOW) // This mmu size means that the mmu size to be mapped
|
||||
#endif
|
||||
#define MMU_END_VADDR (MMU_BLOCK0_VADDR + MMU_TOTAL_SIZE)
|
||||
#define MMU_BLOCKL_VADDR (MMU_END_VADDR - 1 * CONFIG_MMU_PAGE_SIZE)
|
||||
#define FLASH_READ_VADDR MMU_BLOCKL_VADDR
|
||||
#define MMU_BLOCK63_VADDR (MMU_BLOCK0_VADDR + MMAP_MMU_SIZE - SPI_FLASH_MMU_PAGE_SIZE)
|
||||
#define FLASH_READ_VADDR MMU_BLOCK63_VADDR
|
||||
#endif
|
||||
|
||||
#if !ESP_TEE_BUILD
|
||||
#define MMAP_MMU_SIZE (MMU_TOTAL_SIZE)
|
||||
// Represents the MMU pages available for mmapping by the bootloader
|
||||
#define MMU_FREE_PAGES (MMAP_MMU_SIZE / CONFIG_MMU_PAGE_SIZE)
|
||||
#define FLASH_MMAP_VADDR (MMU_BLOCK0_VADDR)
|
||||
#else /* ESP_TEE_BUILD */
|
||||
#define MMAP_MMU_SIZE (CONFIG_SECURE_TEE_IROM_SIZE + CONFIG_SECURE_TEE_DROM_SIZE)
|
||||
// Represents the MMU pages available for mmapping by the TEE
|
||||
#define MMU_FREE_PAGES (MMAP_MMU_SIZE / CONFIG_MMU_PAGE_SIZE)
|
||||
#define FLASH_MMAP_VADDR (MMU_END_VADDR - (MMU_FREE_PAGES + 1) * CONFIG_MMU_PAGE_SIZE)
|
||||
#endif /* !ESP_TEE_BUILD */
|
||||
|
||||
static bool mapped;
|
||||
|
||||
// Required for bootloader_flash_munmap() for ESP-TEE
|
||||
static uint32_t current_mapped_size;
|
||||
|
||||
// Current bootloader mapping (ab)used for bootloader_read()
|
||||
static uint32_t current_read_mapping = UINT32_MAX;
|
||||
|
||||
#if ESP_TEE_BUILD && CONFIG_IDF_TARGET_ESP32C6
|
||||
extern void spi_common_set_dummy_output(esp_rom_spiflash_read_mode_t mode);
|
||||
extern void spi_dummy_len_fix(uint8_t spi, uint8_t freqdiv);
|
||||
|
||||
/* TODO: [ESP-TEE] Workarounds for the ROM read API
|
||||
*
|
||||
* The esp_rom_spiflash_read API requires two workarounds on ESP32-C6 ECO0:
|
||||
*
|
||||
* 1. [IDF-7199] Call esp_rom_spiflash_write API once before reading.
|
||||
* Without this, reads return corrupted data.
|
||||
*
|
||||
* 2. Configure ROM flash parameters before each read using the function below.
|
||||
* Without this, the first byte read is corrupted.
|
||||
*
|
||||
* Note: These workarounds are not needed for ESP32-C6 ECO1 and later versions.
|
||||
*/
|
||||
static void rom_read_api_workaround(void)
|
||||
{
|
||||
static bool is_first_call = true;
|
||||
if (is_first_call) {
|
||||
uint32_t dummy_val = UINT32_MAX;
|
||||
uint32_t dest_addr = ESP_PARTITION_TABLE_OFFSET + ESP_PARTITION_TABLE_MAX_LEN;
|
||||
esp_rom_spiflash_write(dest_addr, &dummy_val, sizeof(dummy_val));
|
||||
is_first_call = false;
|
||||
}
|
||||
|
||||
uint32_t freqdiv = 0;
|
||||
|
||||
#if CONFIG_ESPTOOLPY_FLASHFREQ_80M
|
||||
freqdiv = 1;
|
||||
#elif CONFIG_ESPTOOLPY_FLASHFREQ_40M
|
||||
freqdiv = 2;
|
||||
#elif CONFIG_ESPTOOLPY_FLASHFREQ_20M
|
||||
freqdiv = 4;
|
||||
#endif
|
||||
|
||||
esp_rom_spiflash_read_mode_t read_mode;
|
||||
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO
|
||||
read_mode = ESP_ROM_SPIFLASH_QIO_MODE;
|
||||
#elif CONFIG_ESPTOOLPY_FLASHMODE_QOUT
|
||||
read_mode = ESP_ROM_SPIFLASH_QOUT_MODE;
|
||||
#elif CONFIG_ESPTOOLPY_FLASHMODE_DIO
|
||||
read_mode = ESP_ROM_SPIFLASH_DIO_MODE;
|
||||
#elif CONFIG_ESPTOOLPY_FLASHMODE_DOUT
|
||||
read_mode = ESP_ROM_SPIFLASH_DOUT_MODE;
|
||||
#endif
|
||||
|
||||
esp_rom_spiflash_config_clk(freqdiv, 1);
|
||||
spi_dummy_len_fix(1, freqdiv);
|
||||
esp_rom_spiflash_config_readmode(read_mode);
|
||||
spi_common_set_dummy_output(read_mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint32_t bootloader_mmap_get_free_pages(void)
|
||||
{
|
||||
/**
|
||||
@@ -294,15 +188,13 @@ const void *bootloader_mmap(uint32_t src_paddr, uint32_t size)
|
||||
uint32_t src_paddr_aligned = src_paddr & MMU_FLASH_MASK;
|
||||
//The addr is aligned, so we add the mask off length to the size, to make sure the corresponding buses are enabled.
|
||||
uint32_t size_after_paddr_aligned = (src_paddr - src_paddr_aligned) + size;
|
||||
|
||||
uint32_t actual_mapped_len = 0;
|
||||
/**
|
||||
* @note 1
|
||||
* Will add here a check to make sure the vaddr is on read-only and executable buses, since we use others for psram
|
||||
* Now simply check if it's valid vaddr, didn't check if it's readable, writable or executable.
|
||||
* TODO: IDF-4710
|
||||
*/
|
||||
if (mmu_ll_check_valid_ext_vaddr_region(0, FLASH_MMAP_VADDR, size_after_paddr_aligned, MMU_VADDR_DATA | MMU_VADDR_INSTRUCTION) == 0) {
|
||||
if (mmu_ll_check_valid_ext_vaddr_region(0, MMU_BLOCK0_VADDR, size_after_paddr_aligned, MMU_VADDR_DATA | MMU_VADDR_INSTRUCTION) == 0) {
|
||||
ESP_EARLY_LOGE(TAG, "vaddr not valid");
|
||||
return NULL;
|
||||
}
|
||||
@@ -312,25 +204,15 @@ const void *bootloader_mmap(uint32_t src_paddr, uint32_t size)
|
||||
Cache_Read_Disable(0);
|
||||
Cache_Flush(0);
|
||||
#else
|
||||
/* NOTE: [ESP-TEE] Cache suspension vs disabling
|
||||
*
|
||||
* For ESP-TEE , we use suspend the cache instead of disabling it to avoid flushing the entire cache.
|
||||
* This prevents performance hits when returning to the REE app due to cache misses.
|
||||
* This is not applicable to the bootloader as it runs exclusively on the device from the internal SRAM.
|
||||
*/
|
||||
#if !ESP_TEE_BUILD
|
||||
cache_hal_disable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#else
|
||||
cache_hal_suspend(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//---------------Do mapping------------------------
|
||||
ESP_EARLY_LOGD(TAG, "rodata starts from paddr=0x%08" PRIx32 ", size=0x%" PRIx32 ", will be mapped to vaddr=0x%08" PRIx32, src_paddr, size, (uint32_t)FLASH_MMAP_VADDR);
|
||||
ESP_EARLY_LOGD(TAG, "rodata starts from paddr=0x%08" PRIx32 ", size=0x%" PRIx32 ", will be mapped to vaddr=0x%08" PRIx32, src_paddr, size, (uint32_t)MMU_BLOCK0_VADDR);
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
uint32_t count = GET_REQUIRED_MMU_PAGES(size, src_paddr);
|
||||
int e = cache_flash_mmu_set(0, 0, FLASH_MMAP_VADDR, src_paddr_aligned, 64, count);
|
||||
ESP_EARLY_LOGV(TAG, "after mapping, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", src_paddr_aligned, (uint32_t)FLASH_MMAP_VADDR, count * SPI_FLASH_MMU_PAGE_SIZE);
|
||||
int e = cache_flash_mmu_set(0, 0, MMU_BLOCK0_VADDR, src_paddr_aligned, 64, count);
|
||||
ESP_EARLY_LOGV(TAG, "after mapping, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", src_paddr_aligned, (uint32_t)MMU_BLOCK0_VADDR, count * SPI_FLASH_MMU_PAGE_SIZE);
|
||||
if (e != 0) {
|
||||
ESP_EARLY_LOGE(TAG, "cache_flash_mmu_set failed: %d", e);
|
||||
Cache_Read_Enable(0);
|
||||
@@ -341,8 +223,9 @@ const void *bootloader_mmap(uint32_t src_paddr, uint32_t size)
|
||||
* This hal won't return error, it assumes the inputs are valid. The related check should be done in `bootloader_mmap()`.
|
||||
* See above comments (note 1) about IDF-4710
|
||||
*/
|
||||
mmu_hal_map_region(0, MMU_TARGET_FLASH0, FLASH_MMAP_VADDR, src_paddr_aligned, size_after_paddr_aligned, &actual_mapped_len);
|
||||
ESP_EARLY_LOGV(TAG, "after mapping, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", src_paddr_aligned, (uint32_t)FLASH_MMAP_VADDR, actual_mapped_len);
|
||||
uint32_t actual_mapped_len = 0;
|
||||
mmu_hal_map_region(0, MMU_TARGET_FLASH0, MMU_BLOCK0_VADDR, src_paddr_aligned, size_after_paddr_aligned, &actual_mapped_len);
|
||||
ESP_EARLY_LOGV(TAG, "after mapping, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", src_paddr_aligned, (uint32_t)MMU_BLOCK0_VADDR, actual_mapped_len);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -355,19 +238,14 @@ const void *bootloader_mmap(uint32_t src_paddr, uint32_t size)
|
||||
Cache_Read_Enable(0);
|
||||
#else
|
||||
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
|
||||
cache_ll_invalidate_addr(CACHE_LL_LEVEL_ALL, CACHE_TYPE_ALL, CACHE_LL_ID_ALL, FLASH_MMAP_VADDR, actual_mapped_len);
|
||||
cache_ll_invalidate_addr(CACHE_LL_LEVEL_ALL, CACHE_TYPE_ALL, CACHE_LL_ID_ALL, MMU_BLOCK0_VADDR, actual_mapped_len);
|
||||
#endif
|
||||
#if !ESP_TEE_BUILD
|
||||
cache_hal_enable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#else
|
||||
cache_hal_resume(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
mapped = true;
|
||||
current_mapped_size = actual_mapped_len;
|
||||
|
||||
return (void *)(FLASH_MMAP_VADDR + (src_paddr - src_paddr_aligned));
|
||||
return (void *)(MMU_BLOCK0_VADDR + (src_paddr - src_paddr_aligned));
|
||||
}
|
||||
|
||||
void bootloader_munmap(const void *mapping)
|
||||
@@ -379,18 +257,11 @@ void bootloader_munmap(const void *mapping)
|
||||
Cache_Flush(0);
|
||||
mmu_init(0);
|
||||
#else
|
||||
#if !ESP_TEE_BUILD
|
||||
cache_hal_disable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
mmu_hal_unmap_all();
|
||||
#else
|
||||
cache_hal_suspend(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
mmu_hal_unmap_region(0, FLASH_MMAP_VADDR, current_mapped_size);
|
||||
cache_hal_invalidate_addr(FLASH_MMAP_VADDR, current_mapped_size);
|
||||
cache_hal_resume(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#endif
|
||||
#endif
|
||||
mapped = false;
|
||||
current_mapped_size = 0;
|
||||
current_read_mapping = UINT32_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,11 +285,7 @@ static esp_err_t bootloader_flash_read_no_decrypt(size_t src_addr, void *dest, s
|
||||
Cache_Read_Disable(0);
|
||||
Cache_Flush(0);
|
||||
#else
|
||||
#if !ESP_TEE_BUILD
|
||||
cache_hal_disable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#elif CONFIG_ESP32C6_REV_MIN_0
|
||||
rom_read_api_workaround();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
esp_rom_spiflash_result_t r = esp_rom_spiflash_read(src_addr, dest, size);
|
||||
@@ -426,9 +293,7 @@ static esp_err_t bootloader_flash_read_no_decrypt(size_t src_addr, void *dest, s
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
Cache_Read_Enable(0);
|
||||
#else
|
||||
#if !ESP_TEE_BUILD
|
||||
cache_hal_enable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return spi_to_esp_err(r);
|
||||
@@ -451,13 +316,7 @@ static esp_err_t bootloader_flash_read_allow_decrypt(size_t src_addr, void *dest
|
||||
Cache_Read_Disable(0);
|
||||
Cache_Flush(0);
|
||||
#else
|
||||
#if !ESP_TEE_BUILD
|
||||
cache_hal_disable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#else
|
||||
cache_hal_suspend(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
//---------------Invalidating entries at to-be-mapped v_addr------------------------
|
||||
cache_hal_invalidate_addr(FLASH_READ_VADDR, SPI_FLASH_MMU_PAGE_SIZE);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//---------------Do mapping------------------------
|
||||
@@ -478,18 +337,13 @@ static esp_err_t bootloader_flash_read_allow_decrypt(size_t src_addr, void *dest
|
||||
Cache_Read_Enable(0);
|
||||
#else
|
||||
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
|
||||
cache_ll_invalidate_addr(CACHE_LL_LEVEL_ALL, CACHE_TYPE_ALL, CACHE_LL_ID_ALL, FLASH_MMAP_VADDR, actual_mapped_len);
|
||||
cache_ll_invalidate_addr(CACHE_LL_LEVEL_ALL, CACHE_TYPE_ALL, CACHE_LL_ID_ALL, MMU_BLOCK0_VADDR, actual_mapped_len);
|
||||
#endif
|
||||
#if !ESP_TEE_BUILD
|
||||
cache_hal_enable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#else
|
||||
cache_hal_resume(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
map_ptr = (uint32_t *)(FLASH_READ_VADDR + (word_src - map_at));
|
||||
dest_words[word] = *map_ptr;
|
||||
current_read_mapping = UINT32_MAX;
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -518,19 +372,7 @@ esp_err_t bootloader_flash_read(size_t src_addr, void *dest, size_t size, bool a
|
||||
|
||||
esp_err_t bootloader_flash_write(size_t dest_addr, void *src, size_t size, bool write_encrypted)
|
||||
{
|
||||
/* NOTE: [ESP-TEE] Flash operation address validation with anti-FI check
|
||||
*
|
||||
* Ensure that flash operations cannot be executed within forbidden memory ranges
|
||||
* by validating the address before proceeding.
|
||||
*/
|
||||
#if ESP_TEE_BUILD
|
||||
bool addr_chk = esp_tee_flash_check_paddr_in_active_tee_part(dest_addr);
|
||||
if (addr_chk) {
|
||||
ESP_EARLY_LOGE(TAG, "bootloader_flash_write invalid dest_addr");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
ESP_FAULT_ASSERT(!addr_chk);
|
||||
#endif
|
||||
esp_err_t err;
|
||||
size_t alignment = write_encrypted ? 32 : 4;
|
||||
if ((dest_addr % alignment) != 0) {
|
||||
ESP_EARLY_LOGE(TAG, "bootloader_flash_write dest_addr 0x%x not %d-byte aligned", dest_addr, alignment);
|
||||
@@ -545,29 +387,16 @@ esp_err_t bootloader_flash_write(size_t dest_addr, void *src, size_t size, bool
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
esp_err_t err = bootloader_flash_unlock();
|
||||
err = bootloader_flash_unlock();
|
||||
if (err != ESP_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
esp_rom_spiflash_result_t rc = ESP_ROM_SPIFLASH_RESULT_OK;
|
||||
|
||||
if (write_encrypted && !ENCRYPTION_IS_VIRTUAL) {
|
||||
rc = esp_rom_spiflash_write_encrypted(dest_addr, src, size);
|
||||
return spi_to_esp_err(esp_rom_spiflash_write_encrypted(dest_addr, src, size));
|
||||
} else {
|
||||
rc = esp_rom_spiflash_write(dest_addr, src, size);
|
||||
return spi_to_esp_err(esp_rom_spiflash_write(dest_addr, src, size));
|
||||
}
|
||||
/* NOTE: [ESP-TEE] Cache flushing after flash writes/erases
|
||||
*
|
||||
* After writing or erasing the flash, we need to flush the cache at locations
|
||||
* corresponding to the destination write/erase address. This prevents stale data
|
||||
* from being read from already memory-mapped addresses that were modified.
|
||||
*/
|
||||
#if ESP_TEE_BUILD
|
||||
spi_flash_check_and_flush_cache(dest_addr, size);
|
||||
#endif
|
||||
|
||||
return spi_to_esp_err(rc);
|
||||
}
|
||||
|
||||
esp_err_t bootloader_flash_erase_sector(size_t sector)
|
||||
@@ -577,13 +406,6 @@ esp_err_t bootloader_flash_erase_sector(size_t sector)
|
||||
|
||||
esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
|
||||
{
|
||||
#if ESP_TEE_BUILD
|
||||
bool addr_chk = esp_tee_flash_check_paddr_in_active_tee_part(start_addr);
|
||||
if (addr_chk) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
ESP_FAULT_ASSERT(!addr_chk);
|
||||
#endif
|
||||
if (start_addr % FLASH_SECTOR_SIZE != 0) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
@@ -604,10 +426,6 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
|
||||
++sector;
|
||||
}
|
||||
}
|
||||
#if ESP_TEE_BUILD
|
||||
spi_flash_check_and_flush_cache(start_addr, size);
|
||||
#endif
|
||||
|
||||
return spi_to_esp_err(rc);
|
||||
}
|
||||
|
||||
@@ -618,37 +436,37 @@ void bootloader_flash_32bits_address_map_enable(esp_rom_spiflash_read_mode_t fla
|
||||
switch (flash_mode) {
|
||||
case ESP_ROM_SPIFLASH_DOUT_MODE:
|
||||
cache_rd.addr_bit_len = 32;
|
||||
cache_rd.dummy_bit_len = SPI_FLASH_DOUT_DUMMY_BITLEN;
|
||||
cache_rd.dummy_bit_len = 8;
|
||||
cache_rd.cmd = CMD_FASTRD_DUAL_4B;
|
||||
cache_rd.cmd_bit_len = 8;
|
||||
break;
|
||||
case ESP_ROM_SPIFLASH_DIO_MODE:
|
||||
cache_rd.addr_bit_len = 32;
|
||||
cache_rd.dummy_bit_len = SPI_FLASH_DIO_DUMMY_BITLEN;
|
||||
cache_rd.dummy_bit_len = 4;
|
||||
cache_rd.cmd = CMD_FASTRD_DIO_4B;
|
||||
cache_rd.cmd_bit_len = 8;
|
||||
break;
|
||||
case ESP_ROM_SPIFLASH_QOUT_MODE:
|
||||
cache_rd.addr_bit_len = 32;
|
||||
cache_rd.dummy_bit_len = SPI_FLASH_QOUT_DUMMY_BITLEN;
|
||||
cache_rd.dummy_bit_len = 8;
|
||||
cache_rd.cmd = CMD_FASTRD_QUAD_4B;
|
||||
cache_rd.cmd_bit_len = 8;
|
||||
break;
|
||||
case ESP_ROM_SPIFLASH_QIO_MODE:
|
||||
cache_rd.addr_bit_len = 32;
|
||||
cache_rd.dummy_bit_len = SPI_FLASH_QIO_DUMMY_BITLEN;
|
||||
cache_rd.dummy_bit_len = 6;
|
||||
cache_rd.cmd = CMD_FASTRD_QIO_4B;
|
||||
cache_rd.cmd_bit_len = 8;
|
||||
break;
|
||||
case ESP_ROM_SPIFLASH_FASTRD_MODE:
|
||||
cache_rd.addr_bit_len = 32;
|
||||
cache_rd.dummy_bit_len = SPI_FLASH_FASTRD_DUMMY_BITLEN;
|
||||
cache_rd.dummy_bit_len = 8;
|
||||
cache_rd.cmd = CMD_FASTRD_4B;
|
||||
cache_rd.cmd_bit_len = 8;
|
||||
break;
|
||||
case ESP_ROM_SPIFLASH_SLOWRD_MODE:
|
||||
cache_rd.addr_bit_len = 32;
|
||||
cache_rd.dummy_bit_len = SPI_FLASH_SLOWRD_DUMMY_BITLEN;
|
||||
cache_rd.dummy_bit_len = 0;
|
||||
cache_rd.cmd = CMD_SLOWRD_4B;
|
||||
cache_rd.cmd_bit_len = 8;
|
||||
break;
|
||||
@@ -662,7 +480,7 @@ void bootloader_flash_32bits_address_map_enable(esp_rom_spiflash_read_mode_t fla
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // NON_OS_BUILD
|
||||
#endif // BOOTLOADER_BUILD
|
||||
|
||||
|
||||
FORCE_INLINE_ATTR bool is_issi_chip(const esp_rom_spiflash_chip_t* chip)
|
||||
@@ -681,7 +499,7 @@ FORCE_INLINE_ATTR bool is_mxic_chip(const esp_rom_spiflash_chip_t* chip)
|
||||
return BYTESHIFT(chip->device_id, 2) == MXIC_ID;
|
||||
}
|
||||
|
||||
esp_err_t IRAM_ATTR bootloader_flash_unlock_default(void)
|
||||
esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void)
|
||||
{
|
||||
// At the beginning status == new_status == status_sr2 == new_status_sr2 == 0.
|
||||
// If the register doesn't need to be updated, keep them the same (0), so that no command will be actually sent.
|
||||
@@ -750,17 +568,6 @@ esp_err_t IRAM_ATTR bootloader_flash_unlock_default(void)
|
||||
return err;
|
||||
}
|
||||
|
||||
esp_err_t __attribute__((weak, alias("bootloader_flash_unlock_default"))) bootloader_flash_unlock(void);
|
||||
|
||||
|
||||
#if CONFIG_SECURE_TEE_EXT_FLASH_MEMPROT_SPI1 && !NON_OS_BUILD
|
||||
extern uint32_t bootloader_flash_execute_command_common(
|
||||
uint8_t command,
|
||||
uint32_t addr_len, uint32_t address,
|
||||
uint8_t dummy_len,
|
||||
uint8_t mosi_len, uint32_t mosi_data,
|
||||
uint8_t miso_len);
|
||||
#else
|
||||
IRAM_ATTR uint32_t bootloader_flash_execute_command_common(
|
||||
uint8_t command,
|
||||
uint32_t addr_len, uint32_t address,
|
||||
@@ -813,7 +620,6 @@ IRAM_ATTR uint32_t bootloader_flash_execute_command_common(
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint32_t IRAM_ATTR bootloader_execute_flash_command(uint8_t command, uint32_t mosi_data, uint8_t mosi_len, uint8_t miso_len)
|
||||
{
|
||||
@@ -865,7 +671,7 @@ void bootloader_spi_flash_reset(void)
|
||||
#define XMC_SUPPORT CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT
|
||||
#define XMC_VENDOR_ID_1 0x20
|
||||
|
||||
#if NON_OS_BUILD
|
||||
#if BOOTLOADER_BUILD
|
||||
#define BOOTLOADER_FLASH_LOG(level, ...) ESP_EARLY_LOG##level(TAG, ##__VA_ARGS__)
|
||||
#else
|
||||
static DRAM_ATTR char bootloader_flash_tag[] = "bootloader_flash";
|
||||
@@ -981,7 +787,7 @@ esp_err_t IRAM_ATTR bootloader_flash_reset_chip(void)
|
||||
|
||||
bool IRAM_ATTR bootloader_flash_is_octal_mode_enabled(void)
|
||||
{
|
||||
#if SOC_SPI_MEM_SUPPORT_FLASH_OPI_MODE
|
||||
#if SOC_SPI_MEM_SUPPORT_OPI_MODE
|
||||
return efuse_ll_get_flash_type();
|
||||
#else
|
||||
return false;
|
||||
|
||||
@@ -93,7 +93,7 @@ void IRAM_ATTR bootloader_flash_gpio_config(const esp_image_header_t* pfhdr)
|
||||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302) {
|
||||
// For ESP32D2WD or ESP32-PICO series,the SPI pins are already configured
|
||||
// flash clock signal should come from IO MUX.
|
||||
gpio_ll_func_sel(&GPIO, FLASH_CLK_IO, MSPI_FUNC_NUM);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
|
||||
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
|
||||
} else {
|
||||
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
|
||||
@@ -108,14 +108,14 @@ void IRAM_ATTR bootloader_flash_gpio_config(const esp_image_header_t* pfhdr)
|
||||
esp_rom_gpio_connect_out_signal(FLASH_SPIHD_IO, SPIHD_OUT_IDX, 0, 0);
|
||||
esp_rom_gpio_connect_in_signal(FLASH_SPIHD_IO, SPIHD_IN_IDX, 0);
|
||||
//select pin function gpio
|
||||
gpio_ll_func_sel(&GPIO, FLASH_SPIQ_IO, PIN_FUNC_GPIO);
|
||||
gpio_ll_func_sel(&GPIO, FLASH_SPID_IO, PIN_FUNC_GPIO);
|
||||
gpio_ll_func_sel(&GPIO, FLASH_SPIHD_IO, PIN_FUNC_GPIO);
|
||||
gpio_ll_func_sel(&GPIO, FLASH_SPIWP_IO, PIN_FUNC_GPIO);
|
||||
gpio_ll_func_sel(&GPIO, FLASH_CS_IO, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA0_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA1_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA2_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA3_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_CMD_U, PIN_FUNC_GPIO);
|
||||
// flash clock signal should come from IO MUX.
|
||||
gpio_ll_func_sel(&GPIO, FLASH_CLK_IO, MSPI_FUNC_NUM);
|
||||
// set drive ability for clock
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
|
||||
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
|
||||
|
||||
uint32_t flash_id = g_rom_flashchip.device_id;
|
||||
@@ -190,7 +190,7 @@ int bootloader_flash_get_wp_pin(void)
|
||||
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302:
|
||||
return ESP32_PICO_V3_GPIO;
|
||||
default:
|
||||
return FLASH_SPIWP_IO;
|
||||
return MSPI_IOMUX_PIN_NUM_WP;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -207,7 +207,7 @@ void bootloader_configure_spi_pins(int drv)
|
||||
pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302) {
|
||||
// For ESP32D2WD or ESP32-PICO series,the SPI pins are already configured
|
||||
// flash clock signal should come from IO MUX.
|
||||
gpio_ll_func_sel(&GPIO, FLASH_CLK_IO, MSPI_FUNC_NUM);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
|
||||
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
|
||||
} else {
|
||||
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
|
||||
@@ -222,14 +222,14 @@ void bootloader_configure_spi_pins(int drv)
|
||||
esp_rom_gpio_connect_out_signal(FLASH_SPIHD_IO, SPIHD_OUT_IDX, 0, 0);
|
||||
esp_rom_gpio_connect_in_signal(FLASH_SPIHD_IO, SPIHD_IN_IDX, 0);
|
||||
//select pin function gpio
|
||||
gpio_ll_func_sel(&GPIO, FLASH_SPIQ_IO, PIN_FUNC_GPIO);
|
||||
gpio_ll_func_sel(&GPIO, FLASH_SPID_IO, PIN_FUNC_GPIO);
|
||||
gpio_ll_func_sel(&GPIO, FLASH_SPIHD_IO, PIN_FUNC_GPIO);
|
||||
gpio_ll_func_sel(&GPIO, FLASH_SPIWP_IO, PIN_FUNC_GPIO);
|
||||
gpio_ll_func_sel(&GPIO, FLASH_CS_IO, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA0_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA1_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA2_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA3_U, PIN_FUNC_GPIO);
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_CMD_U, PIN_FUNC_GPIO);
|
||||
// flash clock signal should come from IO MUX.
|
||||
gpio_ll_func_sel(&GPIO, FLASH_CLK_IO, MSPI_FUNC_NUM);
|
||||
// set drive ability for clock
|
||||
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_CLK_U, FUNC_SD_CLK_SPICLK);
|
||||
SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, drv, FUN_DRV_S);
|
||||
|
||||
#if CONFIG_SPIRAM_TYPE_ESPPSRAM32 || CONFIG_SPIRAM_TYPE_ESPPSRAM64
|
||||
@@ -371,10 +371,6 @@ esp_err_t bootloader_init_spi_flash(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((void*)bootloader_flash_unlock != (void*)bootloader_flash_unlock_default) {
|
||||
ESP_EARLY_LOGD(TAG, "Using overridden bootloader_flash_unlock");
|
||||
}
|
||||
|
||||
bootloader_flash_unlock();
|
||||
|
||||
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
|
||||
|
||||
@@ -238,9 +238,6 @@ esp_err_t bootloader_init_spi_flash(void)
|
||||
bootloader_init_flash_configure();
|
||||
|
||||
bootloader_spi_flash_resume();
|
||||
if ((void*)bootloader_flash_unlock != (void*)bootloader_flash_unlock_default) {
|
||||
ESP_EARLY_LOGD(TAG, "Using overridden bootloader_flash_unlock");
|
||||
}
|
||||
bootloader_flash_unlock();
|
||||
|
||||
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
|
||||
|
||||
@@ -247,9 +247,6 @@ esp_err_t bootloader_init_spi_flash(void)
|
||||
#endif
|
||||
|
||||
bootloader_spi_flash_resume();
|
||||
if ((void*)bootloader_flash_unlock != (void*)bootloader_flash_unlock_default) {
|
||||
ESP_EARLY_LOGD(TAG, "Using overridden bootloader_flash_unlock");
|
||||
}
|
||||
bootloader_flash_unlock();
|
||||
|
||||
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
#include "hal/mmu_ll.h"
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/cache_ll.h"
|
||||
#include "hal/mspi_ll.h"
|
||||
#include "bootloader_flash_override.h"
|
||||
#include "hal/mspi_timing_tuning_ll.h"
|
||||
|
||||
void bootloader_flash_update_id()
|
||||
{
|
||||
@@ -54,9 +53,8 @@ void IRAM_ATTR bootloader_init_mspi_clock(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_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_SPLL);
|
||||
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
|
||||
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
|
||||
mspi_ll_clock_src_sel(MSPI_CLK_SRC_SPLL);
|
||||
mspi_ll_fast_set_hs_divider(6);
|
||||
}
|
||||
|
||||
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
|
||||
@@ -119,9 +117,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;
|
||||
default:
|
||||
size = 2;
|
||||
}
|
||||
@@ -198,9 +193,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;
|
||||
default:
|
||||
str = "2MB";
|
||||
break;
|
||||
@@ -226,19 +218,12 @@ esp_err_t bootloader_init_spi_flash(void)
|
||||
|
||||
bootloader_init_flash_configure();
|
||||
bootloader_spi_flash_resume();
|
||||
if ((void*)bootloader_flash_unlock != (void*)bootloader_flash_unlock_default) {
|
||||
ESP_EARLY_LOGD(TAG, "Using overridden bootloader_flash_unlock");
|
||||
}
|
||||
bootloader_flash_unlock();
|
||||
|
||||
#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);
|
||||
|
||||
cache_hal_disable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
@@ -307,10 +292,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);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user