Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDB runner is not capturing real board's output #26676

Closed
abrodkin opened this issue Jul 6, 2020 · 2 comments
Closed

MDB runner is not capturing real board's output #26676

abrodkin opened this issue Jul 6, 2020 · 2 comments
Assignees
Labels
area: ARC ARC Architecture area: Documentation area: Sanitycheck Sanitycheck has been renamed to Twister priority: low Low impact/importance bug

Comments

@abrodkin
Copy link
Collaborator

abrodkin commented Jul 6, 2020

With addition of MDB runner (see #24806) it's now possible to run Zephyr binaries on both ARC boards and nSIM simulator via MetaWare debugger. But while it works OK-ish (see #26272) with manual execution and to some extent with sanitycheck script with simulated nsim_* targets, attempt to use sanitycheck script with ARC boards results on all failed tests.

That's because MDB runner is based on ZephyrBinaryRunner (see https://github.com/zephyrproject-rtos/zephyr/blob/master/scripts/west_commands/runners/mdb.py#L13) which listens on stdout of the spawned process. But in case of real board connected via UART we need to act more like OpenOCD runner listening on the specified serial port.

Obviously there're 2 options on how to solve this:

  1. Restrict usage/disable MDB runner for real boards keeping it only for simulation (especially nsim_hs_smp).
  2. Add missing back-end to the runner for connection to the serial port

But looking forward with addition of MetaWare toolchain support (see #22668) we'd like to have an ability to use MetaWare tools for everything (both building and running) w/o any extra tools, so having MDB runner capable of running Zephyr on real targets in sanitycheck could be a very nice addition. So I'd prefer the second option to be implemented.

@abrodkin abrodkin added bug The issue is a bug, or the PR is fixing a bug area: ARC ARC Architecture area: Sanitycheck Sanitycheck has been renamed to Twister labels Jul 6, 2020
@MaureenHelm MaureenHelm added the priority: low Low impact/importance bug label Jul 7, 2020
@abrodkin abrodkin assigned abrodkin, IRISZZW and YuguoWH and unassigned abrodkin Aug 19, 2020
@IRISZZW
Copy link
Contributor

IRISZZW commented Sep 7, 2020

I believe the root cause is in the sanity check script, not in MDB runner.
MDB and openocd runner both not listening on the specified serial port.

There are two basic Handlers in sanity check script:BinaryHandler and DeviceHandler.

DeviceHandler will listen on the specified serial port, while BinaryHandler will listen on the STD.

elif instance.platform.simulation == "nsim":
if find_executable("nsimdrv"):
instance.handler = BinaryHandler(instance, "nsim")
instance.handler.call_make_run = True
elif instance.platform.simulation == "renode":
if find_executable("renode"):
instance.handler = BinaryHandler(instance, "renode")
instance.handler.pid_fn = os.path.join(instance.build_dir, "renode.pid")
instance.handler.call_make_run = True
elif self.device_testing:
instance.handler = DeviceHandler(instance, "device")

How to run sanitycheck script with ARC boards with mdb runner:

./scripts/sanitycheck -p iotdk -O build.sanity.iotdk --device-testing --device-serial /dev/serial-board-251642517567 -T tests/kernel/common --west-runner=mdb --west-flash=--dig-device=IoTDK

How to run sanitycheck script with nsim with mdb runner:

comment these lines and run sanitycheck as usual.

if(NOT CONFIG_SOC_NSIM_HS_SMP)
board_set_flasher_ifnset(arc-nsim)
board_set_debugger_ifnset(arc-nsim)
endif()

@abrodkin abrodkin added area: Documentation and removed bug The issue is a bug, or the PR is fixing a bug labels Sep 7, 2020
@abrodkin
Copy link
Collaborator Author

abrodkin commented Sep 7, 2020

@evgeniy-paltsev this piece of info should be merged in a greater MetaWare-related documentation section in say https://docs.zephyrproject.org/latest/getting_started/toolchain_3rd_party_x_compilers.html as suggested by @tejlmand.

@abrodkin abrodkin closed this as completed Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARC ARC Architecture area: Documentation area: Sanitycheck Sanitycheck has been renamed to Twister priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

6 participants