Skip to content

OpenOCD support code version not raised on recent additions #13448

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

Closed
dgloeck opened this issue Feb 16, 2019 · 1 comment
Closed

OpenOCD support code version not raised on recent additions #13448

dgloeck opened this issue Feb 16, 2019 · 1 comment
Assignees
Labels
area: Toolchains Toolchains bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@dgloeck
Copy link
Contributor

dgloeck commented Feb 16, 2019

The commit a5b6215 added three elements to the _kernel_openocd_offsets array without raising the OPENOCD_OFFSET_VERSION as was instructed in the comment above the array. So even if OpenOCD was able to use those new values, it would not be able to determine if they exist.

But since our patch to OpenOCD right now rejects unknown versions (see zephyrproject-rtos/openocd#3), I suggest to change the meaning of the OPENOCD_OFFSET_VERSION field to inform only about incompatible changes. For detecting backward compatible additions to the end of the array like the commit mentioned above, we should add a new variable to the .openocd_debug section that has the value ARRAY_SIZE(_kernel_openocd_offsets) (C does not allow us to put this value inside the array).

Also note that our patch to OpenOCD is not yet upstream (#2933).
I'd be willing to make pull requests with the necessary changes, both for this issue and for zephyrproject-rtos/openocd.

@dgloeck dgloeck added the bug The issue is a bug, or the PR is fixing a bug label Feb 16, 2019
@galak
Copy link
Collaborator

galak commented Feb 16, 2019

@dgloeck please go ahead with the fixing and upstreaming.

@galak galak added the area: Toolchains Toolchains label Feb 16, 2019
@nashif nashif added the priority: medium Medium impact/importance bug label Feb 18, 2019
dgloeck added a commit to dgloeck/zephyr that referenced this issue Feb 23, 2019
Every time the array of offsets was changed, it was changed in a
backward compatible way by appending elements to the end. The version
number was incremented to inform OpenOCD about the existence of the new
elements. But the patch for OpenOCD to support Zephyr has never been
updated to support anything else than version 0, causing OpenOCD to
reject recent Zephyr versions. So the idea of using a version number to
track compatible changes didn't work out.

Therefore add another symbol that can be read by OpenOCD to get the
number of elements in the array. This value is automatically calculated
during compilation. The version number element should from now on be
incremented only for incompatible changes.

Fixes: zephyrproject-rtos#13448

Signed-off-by: Daniel Glöckner <[email protected]>
galak pushed a commit that referenced this issue Feb 27, 2019
Every time the array of offsets was changed, it was changed in a
backward compatible way by appending elements to the end. The version
number was incremented to inform OpenOCD about the existence of the new
elements. But the patch for OpenOCD to support Zephyr has never been
updated to support anything else than version 0, causing OpenOCD to
reject recent Zephyr versions. So the idea of using a version number to
track compatible changes didn't work out.

Therefore add another symbol that can be read by OpenOCD to get the
number of elements in the array. This value is automatically calculated
during compilation. The version number element should from now on be
incremented only for incompatible changes.

Fixes: #13448

Signed-off-by: Daniel Glöckner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Toolchains Toolchains bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants