2
2
#
3
3
# SPDX-License-Identifier: Apache-2.0
4
4
5
- '''Runner for debugging and flashing Intel_s1000 devices'''
5
+ '''Runner for debugging and flashing intel_s1000 devices'''
6
6
from os import path
7
7
from .core import ZephyrBinaryRunner
8
8
import time
9
9
import signal
10
10
11
11
DEFAULT_XT_GDB_PORT = 20000
12
12
13
- class intel_s1000BinaryRunner (ZephyrBinaryRunner ):
13
+
14
+ class IntelS1000BinaryRunner (ZephyrBinaryRunner ):
14
15
'''Runner front-end for Intel_s1000.'''
15
16
16
17
def __init__ (self ,
17
18
board_dir , xt_ocd_dir ,
18
19
ocd_topology , ocd_jtag_instr , gdb_flash_file ,
19
20
elf_name , gdb ,
20
21
gdb_port = DEFAULT_XT_GDB_PORT , debug = False ):
21
- super (intel_s1000BinaryRunner , self ).__init__ (debug = debug )
22
+ super (IntelS1000BinaryRunner , self ).__init__ (debug = debug )
22
23
self .board_dir = board_dir
23
24
self .xt_ocd_dir = xt_ocd_dir
24
25
self .ocd_topology = ocd_topology
@@ -37,29 +38,37 @@ def do_add_parser(cls, parser):
37
38
# Required
38
39
39
40
# Optional
40
- parser .add_argument ('--gdb-port' , default = DEFAULT_XT_GDB_PORT ,
41
- help = 'xt-gdb port, defaults to 20000' )
42
- parser .add_argument ('--xt-ocd-dir' , default = '/opt/Tensilica/xocd-12.0.4/xt-ocd' ,
43
- help = 'ocd-dir, defaults to /opt/Tensilica/xocd-12.0.4/xt-ocd' )
44
- parser .add_argument ('--ocd-topology' , default = 'topology_dsp0_flyswatter2.xml' ,
45
- help = 'ocd-topology, defaults to topology_dsp0_flyswatter2.xml' )
46
- parser .add_argument ('--ocd-jtag-instr' , default = 'dsp0_gdb.txt' ,
47
- help = 'ocd-jtag-instr, defaults to dsp0_gdb.txt' )
48
- parser .add_argument ('--gdb-flash-file' , default = 'load_elf.txt' ,
49
- help = 'gdb-flash-file, defaults to load_elf.txt' )
41
+ parser .add_argument (
42
+ '--gdb-port' , default = DEFAULT_XT_GDB_PORT ,
43
+ help = 'xt-gdb port, defaults to 20000' )
44
+ parser .add_argument (
45
+ '--xt-ocd-dir' , default = '/opt/Tensilica/xocd-12.0.4/xt-ocd' ,
46
+ help = 'ocd-dir, defaults to /opt/Tensilica/xocd-12.0.4/xt-ocd' )
47
+ parser .add_argument (
48
+ '--ocd-topology' , default = 'topology_dsp0_flyswatter2.xml' ,
49
+ help = 'ocd-topology, defaults to topology_dsp0_flyswatter2.xml' )
50
+ parser .add_argument (
51
+ '--ocd-jtag-instr' , default = 'dsp0_gdb.txt' ,
52
+ help = 'ocd-jtag-instr, defaults to dsp0_gdb.txt' )
53
+ parser .add_argument (
54
+ '--gdb-flash-file' , default = 'load_elf.txt' ,
55
+ help = 'gdb-flash-file, defaults to load_elf.txt' )
50
56
51
57
@classmethod
52
58
def create_from_args (command , args ):
53
- return intel_s1000BinaryRunner (
59
+ return IntelS1000BinaryRunner (
54
60
args .board_dir , args .xt_ocd_dir ,
55
61
args .ocd_topology , args .ocd_jtag_instr , args .gdb_flash_file ,
56
62
args .kernel_elf , args .gdb ,
57
63
gdb_port = args .gdb_port , debug = args .verbose )
58
64
59
65
def do_run (self , command , ** kwargs ):
60
- kwargs ['ocd-topology' ] = path .join (self .board_dir , 'support' , self .ocd_topology )
61
- kwargs ['ocd-jtag-instr' ] = path .join (self .board_dir , 'support' , self .ocd_jtag_instr )
62
- kwargs ['gdb-flash-file' ] = path .join (self .board_dir , 'support' , self .gdb_flash_file )
66
+ kwargs ['ocd-topology' ] = path .join (self .board_dir , 'support' ,
67
+ self .ocd_topology )
68
+ kwargs ['ocd-jtag-instr' ] = path .join (self .board_dir , 'support' ,
69
+ self .ocd_jtag_instr )
70
+ kwargs ['gdb-flash-file' ] = path .join (self .board_dir , 'support' ,
71
+ self .gdb_flash_file )
63
72
64
73
if command == 'flash' :
65
74
self .flash (** kwargs )
@@ -75,8 +84,8 @@ def flash(self, **kwargs):
75
84
76
85
self .print_gdbserver_message (self .gdb_port )
77
86
server_cmd = [self .xt_ocd_dir ,
78
- '-c' , topology_file ,
79
- '-I' , jtag_instr_file ]
87
+ '-c' , topology_file ,
88
+ '-I' , jtag_instr_file ]
80
89
81
90
# Start the server
82
91
# Note that XTOCD always fails the first time. It has to be
@@ -107,8 +116,8 @@ def do_debug(self):
107
116
raise ValueError ('Cannot debug; no gdb specified' )
108
117
109
118
gdb_cmd = [self .gdb_cmd ,
110
- '-ex' , 'target remote :{}' .format (self .gdb_port ),
111
- self .elf_name ]
119
+ '-ex' , 'target remote :{}' .format (self .gdb_port ),
120
+ self .elf_name ]
112
121
113
122
# The below statement will consume the "^C" keypress ensuring
114
123
# the python main application doesn't exit. This is important
@@ -128,8 +137,8 @@ def debugserver(self, **kwargs):
128
137
129
138
self .print_gdbserver_message (self .gdb_port )
130
139
server_cmd = [self .xt_ocd_dir ,
131
- '-c' , topology_file ,
132
- '-I' , jtag_instr_file ]
140
+ '-c' , topology_file ,
141
+ '-I' , jtag_instr_file ]
133
142
134
143
# Note that XTOCD always fails the first time. It has to be
135
144
# relaunched the second time to work.
0 commit comments