Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
编程深海AiKoder
nrfutil_gui
提交
7f957a3e
N
nrfutil_gui
项目概览
编程深海AiKoder
/
nrfutil_gui
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nrfutil_gui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7f957a3e
编写于
11月 17, 2021
作者:
编程深海AiKoder
🚴🏻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add action
上级
3d6db475
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
403 addition
and
9 deletion
+403
-9
main.py
main.py
+385
-9
settings/dfu.txt
settings/dfu.txt
+18
-0
settings/title.ico
settings/title.ico
+0
-0
未找到文件。
main.py
浏览文件 @
7f957a3e
...
...
@@ -2,6 +2,8 @@
import
wx
from
wx.core
import
BITMAP_TYPE_ICO
import
subprocess
import
os
class
GenerateKey
(
wx
.
Panel
):
...
...
@@ -19,6 +21,11 @@ class GenerateKey(wx.Panel):
# item
self
.
generate_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Generate"
)
self
.
display_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Display"
)
# bind a action
self
.
generate_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
generate_action
)
self
.
display_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
display_action
)
self
.
hbox
.
Add
(
self
.
generate_btn
,
0
,
wx
.
LEFT
|
wx
.
ALL
,
2
)
self
.
hbox
.
Add
(
self
.
display_btn
,
0
,
wx
.
LEFT
|
wx
.
ALL
,
2
)
...
...
@@ -26,6 +33,88 @@ class GenerateKey(wx.Panel):
self
.
vbox
.
Add
(
self
.
sbox_sizer
,
0
,
wx
.
ALL
|
wx
.
ALIGN_LEFT
,
2
)
self
.
SetSizer
(
self
.
vbox
)
def
generate_action
(
self
,
event
):
# find cmd path
cur_dir
=
os
.
path
.
abspath
(
"."
)
cmd_dir
=
os
.
path
.
join
(
cur_dir
,
"nrf"
)
nrfutil_cmd
=
os
.
path
.
join
(
cmd_dir
,
"nrfutil.exe"
)
print
(
nrfutil_cmd
)
# check key.pem
file
=
"out/key.pem"
if
os
.
path
.
exists
(
file
):
# os.remove(file)
rsp
=
wx
.
MessageBox
(
"Are you sure to remove the key.pem ?"
,
"Warning"
,
wx
.
OK
|
wx
.
CANCEL
|
wx
.
ICON_WARNING
,
)
if
rsp
==
wx
.
OK
:
os
.
remove
(
file
)
print
(
"removing..."
)
else
:
print
(
"Cancel."
)
return
# run
process
=
subprocess
.
run
(
[
nrfutil_cmd
,
"keys"
,
"generate"
,
"out/key.pem"
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
,
)
if
process
.
returncode
==
0
:
print
(
"Generate key.pem OK."
)
def
display_action
(
self
,
e
):
# find cmd path
cur_dir
=
os
.
path
.
abspath
(
"."
)
cmd_dir
=
os
.
path
.
join
(
cur_dir
,
"nrf"
)
nrfutil_cmd
=
os
.
path
.
join
(
cmd_dir
,
"nrfutil.exe"
)
print
(
nrfutil_cmd
)
file
=
"out/key.pem"
if
os
.
path
.
exists
(
file
):
os
.
remove
(
"out/dfu_public_key.c"
)
# display key
process
=
subprocess
.
run
(
[
nrfutil_cmd
,
"keys"
,
"display"
,
"--key"
,
"pk"
,
"--format"
,
"code"
,
"out/key.pem"
,
"--out_file"
,
"out/dfu_public_key.c"
,
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
,
)
print
(
"Generate dfu_public_key.c"
)
process
=
subprocess
.
run
(
[
nrfutil_cmd
,
"keys"
,
"display"
,
"--key"
,
"pk"
,
"--format"
,
"code"
,
"out/key.pem"
,
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
,
)
print
(
process
.
stdout
)
else
:
print
(
"file not found."
)
class
GenerateBlSettings
(
wx
.
Panel
):
"""Generating and displaying bootloader settings"""
...
...
@@ -33,6 +122,8 @@ class GenerateBlSettings(wx.Panel):
def
__init__
(
self
,
parent
):
super
(
GenerateBlSettings
,
self
).
__init__
(
parent
)
self
.
app_load_path
=
None
self
.
vbox
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
# group
self
.
sbox
=
wx
.
StaticBox
(
...
...
@@ -57,7 +148,8 @@ class GenerateBlSettings(wx.Panel):
self
.
bl_settings_title
=
wx
.
StaticText
(
self
.
sbox
,
-
1
,
label
=
"--bl-settings-version"
)
self
.
bl_settings_list
=
[
"1 (=SDK 12.0)"
,
"2 (>=SDK 15.3.0)"
]
# self.bl_settings_list = ["1 (=SDK 12.0)", "2 (>=SDK 15.3.0)"]
self
.
bl_settings_list
=
[
"1"
,
"2"
]
self
.
bl_settings_cbo
=
wx
.
ComboBox
(
self
.
sbox
,
choices
=
self
.
bl_settings_list
,
...
...
@@ -70,10 +162,14 @@ class GenerateBlSettings(wx.Panel):
self
.
app_path_title
=
wx
.
StaticText
(
self
.
sbox
,
-
1
,
"--application"
)
self
.
app_path_display
=
wx
.
TextCtrl
(
self
.
sbox
,
style
=
wx
.
TE_READONLY
)
self
.
app_
path
_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Load"
)
self
.
app_
load
_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Load"
)
self
.
generate_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Generate"
)
# bind a action
self
.
generate_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
generate_action
)
self
.
app_load_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
app_load_action
)
self
.
gbs
.
Add
(
self
.
family_title
,
pos
=
(
0
,
0
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
family_cbo
,
pos
=
(
0
,
1
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
boot_version_title
,
pos
=
(
1
,
0
),
flag
=
wx
.
ALL
)
...
...
@@ -84,13 +180,69 @@ class GenerateBlSettings(wx.Panel):
self
.
gbs
.
Add
(
self
.
app_version
,
pos
=
(
3
,
1
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
app_path_title
,
pos
=
(
4
,
0
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
app_path_display
,
pos
=
(
4
,
1
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
app_
path
_btn
,
pos
=
(
4
,
2
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
app_
load
_btn
,
pos
=
(
4
,
2
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
generate_btn
,
pos
=
(
5
,
2
),
flag
=
wx
.
ALL
)
self
.
sbox_sizer
.
Add
(
self
.
gbs
,
0
,
wx
.
ALL
|
wx
.
LEFT
,
2
)
self
.
vbox
.
Add
(
self
.
sbox_sizer
,
0
,
wx
.
ALL
|
wx
.
ALIGN_LEFT
,
2
)
self
.
SetSizer
(
self
.
vbox
)
def
app_load_action
(
self
,
e
):
print
(
"app_load_action"
)
load_file
=
wx
.
FileDialog
(
self
,
"Open"
,
"."
,
""
,
"hex file (*.hex)|*.hex"
,
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
,
)
load_file
.
ShowModal
()
print
(
load_file
.
GetPath
())
self
.
app_load_path
=
load_file
.
GetPath
()
_
,
file_name
=
os
.
path
.
split
(
load_file
.
GetPath
())
load_file
.
Destroy
()
self
.
app_path_display
.
SetValue
(
file_name
)
def
generate_action
(
self
,
e
):
if
self
.
app_load_path
is
None
:
print
(
"Please load you application."
)
wx
.
MessageBox
(
"Please load you application first."
,
"Warning"
,
wx
.
OK
|
wx
.
ICON_WARNING
,
)
return
# find cmd path
cur_dir
=
os
.
path
.
abspath
(
"."
)
cmd_dir
=
os
.
path
.
join
(
cur_dir
,
"nrf"
)
nrfutil_cmd
=
os
.
path
.
join
(
cmd_dir
,
"nrfutil.exe"
)
print
(
nrfutil_cmd
)
# run
process
=
subprocess
.
run
(
[
nrfutil_cmd
,
"settings"
,
"generate"
,
"--family"
,
self
.
family_cbo
.
GetValue
(),
"--application"
,
self
.
app_load_path
,
"--application-version"
,
self
.
app_version
.
GetValue
(),
"--bootloader-version"
,
self
.
boot_version
.
GetValue
(),
"--bl-settings-version"
,
self
.
bl_settings_cbo
.
GetValue
(),
"out/settings.hex"
,
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
,
)
print
(
process
.
stdout
)
class
MergeFile
(
wx
.
Panel
):
"""Merging files into a single file"""
...
...
@@ -98,6 +250,11 @@ class MergeFile(wx.Panel):
def
__init__
(
self
,
parent
):
super
(
MergeFile
,
self
).
__init__
(
parent
)
self
.
sd_file
=
None
self
.
bl_file
=
None
self
.
app_file
=
None
self
.
settings_file
=
None
self
.
vbox
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
# group
self
.
sbox
=
wx
.
StaticBox
(
self
,
-
1
,
"Merging files into a single file"
)
...
...
@@ -118,6 +275,15 @@ class MergeFile(wx.Panel):
self
.
settings_load_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Load"
)
self
.
generate_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Generate"
)
self
.
clear_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Clear"
)
# bind a action
self
.
sd_load_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
sd_load_action
)
self
.
bl_load_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
bl_load_action
)
self
.
app_load_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
app_load_action
)
self
.
settings_load_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
settings_load_action
)
self
.
generate_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
generate_action
)
self
.
clear_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
clear_action
)
self
.
gbs
.
Add
(
self
.
sd_txt
,
pos
=
(
0
,
0
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
sd_path_txt
,
pos
=
(
0
,
1
),
flag
=
wx
.
ALL
)
...
...
@@ -131,17 +297,144 @@ class MergeFile(wx.Panel):
self
.
gbs
.
Add
(
self
.
settings_txt
,
pos
=
(
3
,
0
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
settings_path_txt
,
pos
=
(
3
,
1
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
settings_load_btn
,
pos
=
(
3
,
2
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
clear_btn
,
pos
=
(
4
,
1
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
generate_btn
,
pos
=
(
4
,
2
),
flag
=
wx
.
ALL
)
self
.
sbox_sizer
.
Add
(
self
.
gbs
,
0
,
wx
.
ALL
|
wx
.
LEFT
,
2
)
self
.
vbox
.
Add
(
self
.
sbox_sizer
,
0
,
wx
.
ALL
|
wx
.
ALIGN_LEFT
,
2
)
self
.
SetSizer
(
self
.
vbox
)
def
sd_load_action
(
self
,
e
):
load_file
=
wx
.
FileDialog
(
self
,
"Open"
,
"."
,
""
,
"hex file (*.hex)|*.hex"
,
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
,
)
load_file
.
ShowModal
()
print
(
load_file
.
GetPath
())
self
.
sd_file
=
load_file
.
GetPath
()
_
,
file_name
=
os
.
path
.
split
(
load_file
.
GetPath
())
load_file
.
Destroy
()
self
.
sd_path_txt
.
SetValue
(
file_name
)
def
bl_load_action
(
self
,
e
):
load_file
=
wx
.
FileDialog
(
self
,
"Open"
,
"."
,
""
,
"hex file (*.hex)|*.hex"
,
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
,
)
load_file
.
ShowModal
()
print
(
load_file
.
GetPath
())
self
.
bl_file
=
load_file
.
GetPath
()
_
,
file_name
=
os
.
path
.
split
(
load_file
.
GetPath
())
load_file
.
Destroy
()
self
.
bl_path_txt
.
SetValue
(
file_name
)
def
app_load_action
(
self
,
e
):
load_file
=
wx
.
FileDialog
(
self
,
"Open"
,
"."
,
""
,
"hex file (*.hex)|*.hex"
,
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
,
)
load_file
.
ShowModal
()
print
(
load_file
.
GetPath
())
self
.
app_file
=
load_file
.
GetPath
()
_
,
file_name
=
os
.
path
.
split
(
load_file
.
GetPath
())
load_file
.
Destroy
()
self
.
app_path_txt
.
SetValue
(
file_name
)
def
settings_load_action
(
self
,
e
):
load_file
=
wx
.
FileDialog
(
self
,
"Open"
,
"."
,
""
,
"hex file (*.hex)|*.hex"
,
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
,
)
load_file
.
ShowModal
()
print
(
load_file
.
GetPath
())
self
.
settings_file
=
load_file
.
GetPath
()
_
,
file_name
=
os
.
path
.
split
(
load_file
.
GetPath
())
load_file
.
Destroy
()
self
.
settings_path_txt
.
SetValue
(
file_name
)
def
clear_action
(
self
,
e
):
self
.
sd_file
=
None
self
.
bl_file
=
None
self
.
app_file
=
None
self
.
settings_file
=
None
self
.
sd_path_txt
.
Clear
()
self
.
bl_path_txt
.
Clear
()
self
.
app_path_txt
.
Clear
()
self
.
settings_path_txt
.
Clear
()
def
generate_action
(
self
,
e
):
if
(
self
.
sd_file
is
None
or
self
.
bl_file
is
None
or
self
.
app_file
is
None
or
self
.
settings_file
is
None
):
wx
.
MessageBox
(
"Please load you files first."
,
"Warning"
,
wx
.
OK
|
wx
.
ICON_WARNING
,
)
return
# find cmd path
cur_dir
=
os
.
path
.
abspath
(
"."
)
cmd_dir
=
os
.
path
.
join
(
cur_dir
,
"nrf"
)
nrfutil_cmd
=
os
.
path
.
join
(
cmd_dir
,
"mergehex.exe"
)
print
(
nrfutil_cmd
)
# run
process
=
subprocess
.
run
(
[
nrfutil_cmd
,
"-m"
,
self
.
sd_file
,
self
.
bl_file
,
self
.
app_file
,
"-o"
,
"out/output_1.hex"
,
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
,
)
print
(
process
.
stdout
)
print
(
"OKOKOKOKOKOKOKOKOKOKOKOK"
)
process
=
subprocess
.
run
(
[
nrfutil_cmd
,
"-m"
,
"out/output_1.hex"
,
self
.
settings_file
,
"-o"
,
"out/app_release.hex"
,
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
,
)
print
(
process
.
stdout
)
class
GenerateDfuPackage
(
wx
.
Panel
):
def
__init__
(
self
,
parent
):
super
(
GenerateDfuPackage
,
self
).
__init__
(
parent
)
self
.
app_file
=
None
self
.
key_file
=
None
self
.
vbox
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
# group
self
.
sbox
=
wx
.
StaticBox
(
self
,
-
1
,
"Generating DFU packages"
)
...
...
@@ -158,7 +451,8 @@ class GenerateDfuPackage(wx.Panel):
)
self
.
sd_seq_txt
=
wx
.
StaticText
(
self
.
sbox
,
-
1
,
"--sd-req"
)
self
.
sd_seq_sel
=
[
"0x101 (s132_nrf52_7.2.0)"
,
"0xCB (s132_nrf52_7.0.1)"
]
# self.sd_seq_sel = ["0x101 (s132_nrf52_7.2.0)", "0xCB (s132_nrf52_7.0.1)"]
self
.
sd_seq_sel
=
[
"0x101"
]
self
.
sd_seq_cb
=
wx
.
ComboBox
(
self
.
sbox
,
choices
=
self
.
sd_seq_sel
,
...
...
@@ -176,6 +470,12 @@ class GenerateDfuPackage(wx.Panel):
self
.
key_file_txt
=
wx
.
StaticText
(
self
.
sbox
,
-
1
,
"--key-file"
)
self
.
key_file_path
=
wx
.
TextCtrl
(
self
.
sbox
,
style
=
wx
.
TE_READONLY
)
self
.
key_file_load_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Load"
)
self
.
generate_btn
=
wx
.
Button
(
self
.
sbox
,
label
=
"Generate"
)
# bind a action
self
.
app_file_load_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
app_load_action
)
self
.
key_file_load_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
key_load_action
)
self
.
generate_btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
generate_action
)
self
.
gbs
.
Add
(
self
.
hw_version_txt
,
pos
=
(
0
,
0
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
hw_version
,
pos
=
(
0
,
1
),
flag
=
wx
.
ALL
)
...
...
@@ -189,19 +489,88 @@ class GenerateDfuPackage(wx.Panel):
self
.
gbs
.
Add
(
self
.
key_file_txt
,
pos
=
(
4
,
0
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
key_file_path
,
pos
=
(
4
,
1
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
key_file_load_btn
,
pos
=
(
4
,
2
),
flag
=
wx
.
ALL
)
self
.
gbs
.
Add
(
self
.
generate_btn
,
pos
=
(
5
,
2
),
flag
=
wx
.
ALL
)
self
.
sbox_sizer
.
Add
(
self
.
gbs
,
0
,
wx
.
ALL
|
wx
.
LEFT
,
2
)
self
.
vbox
.
Add
(
self
.
sbox_sizer
,
0
,
wx
.
ALL
|
wx
.
ALIGN_LEFT
,
2
)
self
.
SetSizer
(
self
.
vbox
)
def
app_load_action
(
self
,
e
):
load_file
=
wx
.
FileDialog
(
self
,
"Open"
,
"."
,
""
,
"hex file (*.hex)|*.hex"
,
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
,
)
load_file
.
ShowModal
()
print
(
load_file
.
GetPath
())
self
.
app_file
=
load_file
.
GetPath
()
_
,
file_name
=
os
.
path
.
split
(
load_file
.
GetPath
())
load_file
.
Destroy
()
self
.
app_file_path
.
SetValue
(
file_name
)
def
key_load_action
(
self
,
e
):
load_file
=
wx
.
FileDialog
(
self
,
"Open"
,
"."
,
""
,
"key file (*.pem)|*.pem"
,
wx
.
FD_OPEN
|
wx
.
FD_FILE_MUST_EXIST
,
)
load_file
.
ShowModal
()
print
(
load_file
.
GetPath
())
self
.
key_file
=
load_file
.
GetPath
()
_
,
file_name
=
os
.
path
.
split
(
load_file
.
GetPath
())
load_file
.
Destroy
()
self
.
key_file_path
.
SetValue
(
file_name
)
def
generate_action
(
self
,
e
):
if
self
.
app_file
is
None
or
self
.
key_file
is
None
:
wx
.
MessageBox
(
"Please load you files first."
,
"Warning"
,
wx
.
OK
|
wx
.
ICON_WARNING
,
)
return
# find cmd path
cur_dir
=
os
.
path
.
abspath
(
"."
)
cmd_dir
=
os
.
path
.
join
(
cur_dir
,
"nrf"
)
nrfutil_cmd
=
os
.
path
.
join
(
cmd_dir
,
"nrfutil.exe"
)
print
(
nrfutil_cmd
)
# run
process
=
subprocess
.
run
(
[
nrfutil_cmd
,
"pkg"
,
"generate"
,
"--hw-version"
,
self
.
hw_version
.
GetValue
(),
"--sd-req"
,
self
.
sd_seq_cb
.
GetValue
(),
"--application-version"
,
self
.
application_version
.
GetValue
(),
"--application"
,
self
.
app_file
,
"--key-file"
,
self
.
key_file
,
"out/app_dfu_package.zip"
,
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
,
)
print
(
process
.
stdout
)
class
Logger
(
wx
.
Panel
):
class
Help
(
wx
.
Panel
):
def
__init__
(
self
,
parent
):
super
(
Logger
,
self
).
__init__
(
parent
)
super
(
Help
,
self
).
__init__
(
parent
)
self
.
vbox
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
# group
self
.
sbox
=
wx
.
StaticBox
(
self
,
-
1
,
"
Logging
"
)
self
.
sbox
=
wx
.
StaticBox
(
self
,
-
1
,
"
Help
"
)
self
.
sbox_sizer
=
wx
.
StaticBoxSizer
(
self
.
sbox
,
wx
.
VERTICAL
)
self
.
log_ctrl
=
wx
.
TextCtrl
(
self
.
sbox
,
...
...
@@ -213,6 +582,13 @@ class Logger(wx.Panel):
self
.
vbox
.
Add
(
self
.
sbox_sizer
)
self
.
SetSizer
(
self
.
vbox
)
# read help file
help_file
=
"settings/dfu.txt"
if
os
.
path
.
exists
(
help_file
):
with
open
(
help_file
)
as
fobj
:
for
line
in
fobj
:
self
.
log_ctrl
.
WriteText
(
line
)
class
NrfutilGui
(
wx
.
Frame
):
def
__init__
(
self
,
parent
):
...
...
@@ -237,13 +613,13 @@ class NrfutilGui(wx.Frame):
vbox1
.
Add
(
GenerateDfuPackage
(
panel
),
0
,
wx
.
ALL
|
wx
.
EXPAND
,
1
)
vbox2
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
vbox2
.
Add
(
Logger
(
panel
))
vbox2
.
Add
(
Help
(
panel
))
hbox
.
Add
(
vbox1
)
hbox
.
Add
(
vbox2
)
panel
.
SetSizer
(
hbox
)
ico
=
wx
.
Icon
(
"
confi
gs/title.ico"
,
type
=
BITMAP_TYPE_ICO
)
ico
=
wx
.
Icon
(
"
settin
gs/title.ico"
,
type
=
BITMAP_TYPE_ICO
)
self
.
SetIcon
(
ico
)
# display
self
.
Layout
()
...
...
settings/dfu.txt
0 → 100644
浏览文件 @
7f957a3e
1.
nrfutil keys generate key.pem
nrfutil keys display --key pk --format code key.pem
2.
nrfutil keys display --key pk --format code key.pem --out_file dfu_public_key.c
3.
nrfutil settings generate --family NRF52 --application gateway_10.hex --application-version 10 --bootloader-version 1 --bl-settings-version 2 settings.hex
nrfutil settings display settings.hex
4.
nrfutil pkg generate --hw-version 52 --sd-req 0x0101 --application-version 11 --application gateway_11.hex --key-file key.pem app_dfu_package.zip
nrfutil pkg display app_dfu_package.zip
5.
mergehex -m s132_nrf52_7.2.0_softdevice.hex bootloader.hex gateway_10.hex -o output_1.hex
mergehex -m output_1.hex settings.hex -o app_release.hex
\ No newline at end of file
confi
gs/title.ico
→
settin
gs/title.ico
浏览文件 @
7f957a3e
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录