Browse Source

scripts: west_commands: runners: fix dt-flash handling in some runners

In minichlink and spi_burn, the script checks if dt_flash is True by
checking if the value is "y". But dt_flash is a boolean.
Fix these checks.

Also, when dt-flash is True, spi_burn calculate the address in a
convoluted way, by substrating CONFIG_FLASH_LOAD_OFFSET to
itself.
Simplify this computation.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
pull/89301/head
Miguel Gazquez 5 months ago committed by Benjamin Cabé
parent
commit
783103ebf6
  1. 2
      scripts/west_commands/runners/minichlink.py
  2. 11
      scripts/west_commands/runners/spi_burn.py

2
scripts/west_commands/runners/minichlink.py

@ -57,7 +57,7 @@ class MiniChLinkBinaryRunner(ZephyrBinaryRunner): @@ -57,7 +57,7 @@ class MiniChLinkBinaryRunner(ZephyrBinaryRunner):
minichlink=args.minichlink,
erase=args.erase,
reset=args.reset,
dt_flash=(args.dt_flash == "y"),
dt_flash=args.dt_flash,
terminal=args.terminal,
)

11
scripts/west_commands/runners/spi_burn.py

@ -56,11 +56,14 @@ class SpiBurnBinaryRunner(ZephyrBinaryRunner): @@ -56,11 +56,14 @@ class SpiBurnBinaryRunner(ZephyrBinaryRunner):
iceman = 'ICEman'
# Get flash address offset
if args.dt_flash == 'y':
if args.dt_flash:
build_conf = BuildConfiguration(cfg.build_dir)
address = hex(
cls.get_flash_address(args, build_conf) - build_conf['CONFIG_FLASH_BASE_ADDRESS']
)
if build_conf.getboolean('CONFIG_HAS_FLASH_LOAD_OFFSET'):
address = hex(build_conf['CONFIG_FLASH_LOAD_OFFSET'])
else:
address = '0x0'
else:
address = args.addr

Loading…
Cancel
Save