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

Fix split command compatibility in OpenOCD for updated Tcl interpreter behavior #2150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eastWillow
Copy link

Error Output

stream.cfg:20: Error: expected integer but got "0x0000
0001
0001
0001
....... (repeated)
0001"
Traceback (most recent call last):
, in jtagstream_serve
    jtagstream_rxtx xc7.tap ::aio.sockstream5 0
  File "stream.cfg", line 44, in jtagstream_rxtx
    jtagstream_drain xc7.tap {} 128 4096
  File "stream.cfg", line 30, in jtagstream_drain
    jtagstream_poll xc7.tap {} 128
  File "stream.cfg", line 20, in jtagstream_poll
    expr { "0x${rxj}" & 0x200 }

Solution

The behavior of the jimtcl (Tcl interpreter) has changed in the latest OpenOCD.
It is necessary to find an alternative way to use the spilt command.

If splitChars is an empty string then each character of string becomes a separate element of the result list.
tcl manual

Test the openocd version from latest to 2022/4/14

Because the openocd.py previous is edited at 0a73800

  • v0.12.0-rc1
    • is supported set rxi [split [drscan $tap {{*}}$txi {endstate}] " "]
    • is supported set rxi [split [drscan $tap {{*}}$txi {endstate}]]
  • v0.12.0-rc2
    • is supported set rxi [split [drscan $tap {{*}}$txi {endstate}] " "]
    • is supported set rxi [split [drscan $tap {{*}}$txi {endstate}]]
  • v0.12.0-rc3
    • is supported set rxi [split [drscan $tap {{*}}$txi {endstate}] " "]
    • is supported set rxi [split [drscan $tap {{*}}$txi {endstate}]]
  • v0.12.0
    • is supported set rxi [split [drscan $tap {{*}}$txi {endstate}] " "]
    • is supported set rxi [split [drscan $tap {{*}}$txi {endstate}]]
  • latest : fd62626dff25cf503a25040d3040b0a2bb9b2a76 (HEAD, tag: latest)
    Mon Sep 16 18:01:17 2024 +0300
    • is not supported set rxi [split [drscan $tap {{*}}$txi {endstate}] " "]
    • is supported set rxi [split [drscan $tap {{*}}$txi {endstate}]]

Find the openocd commit that changed the jimtcl submodule, the latest one between v0.12.0.

  • 30c3d077f281876286a7aa37afbd411d4bd1667e
    Fri Sep 27 22:40:06 2024 +0200
    jimtcl: update to version 0.83
    is not supported set rxi [split [drscan $tap {{*}}$txi {endstate}] " "]
  • dccf323c1f78d015f75db4cef8cdc33523e1abd6
    Sat Mar 4 12:08:58 2023 +0100
    jimtcl: update to version 0.82
    is supported set rxi [split [drscan $tap {{*}}$txi {endstate}] " "]

Final

Finally, I can follow these steps to create a bridge to SoC

image

Screenshot from 2024-12-29 00-23-18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant