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

West: openocd runner: Don't let debug mode on by default #32984

Closed
erwango opened this issue Mar 5, 2021 · 6 comments
Closed

West: openocd runner: Don't let debug mode on by default #32984

erwango opened this issue Mar 5, 2021 · 6 comments
Assignees
Labels
area: Flashing area: OpenOCD area: West West utility bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale

Comments

@erwango
Copy link
Member

erwango commented Mar 5, 2021

Describe the bug
When flashing using openocd runner, the cortex-m processor is left in debug mode. It can, then, only be released after a power-on reset (cold reset).

This conflicts with the use of #31481 (Null pointer exception detection via DWT), and prevent its use by default in tests.

For this reason, Null pointer exception detection was disabled by default on all STM32 platforms, but it would be great to be able to re-instantiate it.

Note: This potentially affect other runners as well (pyocd, for instance).

To Reproduce
Steps to reproduce the behavior:

  1. Revert soc: stm32: Disable null pointer exception detection by default #32983
  2. Run any zephyr test on a STM32 target using openocd runner for flashing
  3. See error

Expected behavior
Don't prevent use of Null pointer exception detection when using openocd runner

Impact
Prevent use of Null pointer exception detection when using openocd runner in zephyr tests

Logs and console output
If applicable, add console logs or other types of debug information
e.g Wireshark capture or Logic analyzer capture (upload in zip archive).
copy-and-paste text and put a code fence (```) before and after, to help
explain the issue. (if unable to obtain text log, add a screenshot)

Environment (please complete the following information):

  • OS: (e.g. Linux, MacOS, Windows)
  • Toolchain (e.g Zephyr SDK, ...)
  • Commit SHA or Version used

Additional context
Add any other context about the problem here.

@erwango erwango added bug The issue is a bug, or the PR is fixing a bug area: Flashing area: West West utility area: OpenOCD labels Mar 5, 2021
@ioannisg
Copy link
Member

ioannisg commented Mar 5, 2021

Thanks for the ticket @erwango
To the best of my knowledge, pyocd, jlink, or nrfjprog are not affected. I've tried with several boards/runners and this seems to be the case.

@ioannisg
Copy link
Member

ioannisg commented Mar 5, 2021

Guess the main issue here is that we do not have a consistent west flash, with respect to the state the core is left at, after west flash is done.

@ioannisg
Copy link
Member

ioannisg commented Mar 5, 2021

@mbolivar-nordic can you take a look here (or suggest alternative maintainer)?

@nashif nashif added the priority: medium Medium impact/importance bug label Mar 6, 2021
erwango added a commit to erwango/zephyr that referenced this issue Mar 8, 2021
Null-pointer exception detection using DWT is currently incompatible
with current openocd runner default implementation that leaves debug
mode on by default.
As a consequence, on all targets that use openocd runner, null-pointer
exception detection using DWT will generated an assert.
As a consequence, all tests are failing on such platforms.

Disable this until openocd behavior is fixed (zephyrproject-rtos#32984) and enable
the MPU based solution for now.

Signed-off-by: Erwan Gouriou <[email protected]>
@nashif nashif added priority: high High impact/importance bug and removed priority: medium Medium impact/importance bug labels Mar 9, 2021
@nashif
Copy link
Member

nashif commented Mar 9, 2021

looks like pyocd is also affected

see #32966

nashif pushed a commit that referenced this issue Mar 9, 2021
Null-pointer exception detection using DWT is currently incompatible
with current openocd runner default implementation that leaves debug
mode on by default.
As a consequence, on all targets that use openocd runner, null-pointer
exception detection using DWT will generated an assert.
As a consequence, all tests are failing on such platforms.

Disable this until openocd behavior is fixed (#32984) and enable
the MPU based solution for now.

Signed-off-by: Erwan Gouriou <[email protected]>
@mbolivar-nordic
Copy link
Contributor

@mbolivar-nordic can you take a look here (or suggest alternative maintainer)?

Sorry @ioannisg, I don't know enough about the underlying debug IPs to really help here. I see you already posted a PR for openocd, so it seems like you're on your own here :(.

@galak galak added priority: medium Medium impact/importance bug and removed priority: high High impact/importance bug labels Apr 6, 2021
@galak galak added this to the v2.6.0 milestone May 11, 2021
@galak galak added priority: low Low impact/importance bug and removed priority: medium Medium impact/importance bug labels Jun 1, 2021
@galak galak removed this from the v2.6.0 milestone Jun 1, 2021
@github-actions
Copy link

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Flashing area: OpenOCD area: West West utility bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants