Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
esp32_efuse_wt_tool
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Python_Scripts_For_Embedded_Developer
esp32_efuse_wt_tool
Commits
d2531c3a
Commit
d2531c3a
authored
Aug 13, 2025
by
aohui.li
😋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v0.2 简化配置方式
parent
a7ac687d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
auto.py
auto.py
+18
-3
config.json
config.json
+1
-1
No files found.
auto.py
View file @
d2531c3a
...
@@ -29,7 +29,22 @@ try:
...
@@ -29,7 +29,22 @@ try:
BIN
=
json
.
load
(
open
(
json_file
))[
"bin"
]
BIN
=
json
.
load
(
open
(
json_file
))[
"bin"
]
bin_file
=
os
.
path
.
join
(
path
,
BIN
)
bin_file
=
os
.
path
.
join
(
path
,
BIN
)
PORT
=
json
.
load
(
open
(
json_file
))[
"port"
]
PORT
=
json
.
load
(
open
(
json_file
))[
"port"
]
EXPECTED_DATA
=
json
.
load
(
open
(
json_file
))[
"expected_data"
]
EXPECT_VERSION
=
json
.
load
(
open
(
json_file
))[
"expect_version"
]
EXPECTED_DATA
=
EXPECT_VERSION
.
encode
()
EXPECTED_DATA
+=
b
"
\x00
"
*
(
32
-
len
(
EXPECTED_DATA
))
HEX_EXPECTED_DATA
=
' '
.
join
(
f
'{byte:02x}'
for
byte
in
EXPECTED_DATA
)
with
open
(
bin_file
,
"rb"
)
as
f
:
data
=
f
.
read
()
if
EXPECTED_DATA
==
data
:
print
(
f
"bin文件校验成功"
)
else
:
print
(
f
"bin文件校验失败"
)
print
(
f
"期望数据: {HEX_EXPECTED_DATA}"
)
print
(
f
"实际数据: {data.hex()}"
)
exit
(
1
)
if
PORT
is
None
:
if
PORT
is
None
:
raise
ValueError
(
"请在config.json中配置端口"
)
raise
ValueError
(
"请在config.json中配置端口"
)
...
@@ -47,12 +62,12 @@ try:
...
@@ -47,12 +62,12 @@ try:
print
(
"Data type:"
,
type
(
read_user_efuse
))
print
(
"Data type:"
,
type
(
read_user_efuse
))
print
(
"Read data:"
,
read_user_efuse
)
print
(
"Read data:"
,
read_user_efuse
)
if
read_user_efuse
==
EXPECTED_DATA
:
if
read_user_efuse
==
HEX_
EXPECTED_DATA
:
print
(
"
\n
烧录成功,即将关闭..."
)
print
(
"
\n
烧录成功,即将关闭..."
)
time
.
sleep
(
5
)
time
.
sleep
(
5
)
else
:
else
:
print
(
"烧录失败"
)
print
(
"烧录失败"
)
print
(
f
"期望数据: {EXPECTED_DATA}"
)
print
(
f
"期望数据: {
HEX_
EXPECTED_DATA}"
)
print
(
f
"实际数据: {read_user_efuse}"
)
print
(
f
"实际数据: {read_user_efuse}"
)
input
(
"程序检测到烧录失败,按回车键继续..."
)
input
(
"程序检测到烧录失败,按回车键继续..."
)
...
...
config.json
View file @
d2531c3a
{
{
"port"
:
"COM111"
,
"port"
:
"COM111"
,
"bin"
:
"WIT_HW30.bin"
,
"bin"
:
"WIT_HW30.bin"
,
"expect
ed_data"
:
"48 57 33 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
0"
"expect
_version"
:
"HW3
0"
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment