Skip to content

Commit 04221a5

Browse files
committed
runners: jlink: Add support for big endian device
Sets the endianness of the JLink and the GDB Server based on if `CONFIG_BIG_ENDIAN` is set. Doc on JLink LE/BE option: https://wiki.segger.com/J-Link_Commander#LE Doc on GDB server -endian option: https://wiki.segger.com/J-Link_GDB_Server#-endian Signed-off-by: Sigmund Klåpbakken <[email protected]>
1 parent 23a03b7 commit 04221a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/west_commands/runners/jlink.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ def do_run(self, command, **kwargs):
233233
rtos = self.thread_info_enabled and self.supports_thread_info
234234
plugin_dir = os.fspath(Path(self.commander).parent / 'GDBServer' /
235235
'RTOSPlugin_Zephyr')
236+
big_endian = self.build_conf.getboolean('CONFIG_BIG_ENDIAN')
236237

237238
server_cmd = ([self.gdbserver] +
238239
['-select',
@@ -243,6 +244,7 @@ def do_run(self, command, **kwargs):
243244
'-speed', self.speed,
244245
'-device', self.device,
245246
'-silent',
247+
'-endian', 'big' if big_endian else 'little',
246248
'-singlerun'] +
247249
(['-nogui'] if self.supports_nogui else []) +
248250
(['-rtos', plugin_dir] if rtos else []) +
@@ -290,6 +292,7 @@ def flash(self, **kwargs):
290292
lines = [
291293
'ExitOnError 1', # Treat any command-error as fatal
292294
'r', # Reset and halt the target
295+
'BE' if self.build_conf.getboolean('CONFIG_BIG_ENDIAN') else 'LE'
293296
]
294297

295298
if self.erase:

0 commit comments

Comments
 (0)