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

Fails to flash using a GD-Link, a CMSIS-DAP debugger #189

Open
luojia65 opened this issue Mar 18, 2020 · 14 comments
Open

Fails to flash using a GD-Link, a CMSIS-DAP debugger #189

luojia65 opened this issue Mar 18, 2020 · 14 comments
Labels
architecture:riscv Issues and PRs for the RISC-V architecture enhancement New feature or request help wanted Extra attention is needed probe:cmsis-dap Issues and PRs specific to cmsis-dap based probes protocol:jtag Issues and PRs concerning the JTAG transport protocol

Comments

@luojia65
Copy link

luojia65 commented Mar 18, 2020

Describe the bug
I tried to flash with a GD-Link debugger (CMSIS-DAP) connected, but error occurred.

To Reproduce
Steps to reproduce the behavior:

  1. Connect GD32VF103C-START board (with GD-Link) to the computer
  2. Clone https://github.com/gd32v-rust/gd32vf103-hal
  3. Execute cargo flash --example vf103c-start-blinky

Expected behavior
The program should be flashed and the LED light blinks.

Stacktrace
No stacktrace available

Desktop (please complete the following information):

  • macOS Catalina 10.15.3

Additional context
RUST_LOG=debug report:
zvCwSEKYSPtbjuwNlCbjxHTz

Full RUST_LOG=trace report:
https://paste.ubuntu.com/p/V5ygXJSqTz/

@luojia65 luojia65 added the bug Something isn't working label Mar 18, 2020
@Tiwalun
Copy link
Member

Tiwalun commented Mar 18, 2020

The GD32VF103 is a RISC-V based chip, not an ARM chip, so we need to use JTAG for the connection.

@Yatekii Yatekii added the probe:cmsis-dap Issues and PRs specific to cmsis-dap based probes label Mar 21, 2020
@Tiwalun Tiwalun added the protocol:jtag Issues and PRs concerning the JTAG transport protocol label Mar 22, 2020
@Yatekii
Copy link
Member

Yatekii commented Apr 24, 2020

Is this still an issue or could you fix this by using JTag as a protocol @luojia65 :)

@Tiwalun
Copy link
Member

Tiwalun commented Apr 24, 2020

This is not implemented yet, we don't support raw JTAG for RISC-V using CMSIS-DAP.

@Tiwalun Tiwalun added the architecture:riscv Issues and PRs for the RISC-V architecture label Apr 24, 2020
@Yatekii
Copy link
Member

Yatekii commented Apr 24, 2020

Oh I am sorry, I completely forgot that JTag is not supported on CMSIS-DAP yet.

@elfmimi
Copy link
Contributor

elfmimi commented Apr 29, 2020

Is this issue solved? What I want to say here is, ...
Why not open another issue to track support for GD32V ?

@Yatekii
Copy link
Member

Yatekii commented Apr 29, 2020

Thew problem here is that JTag is not implemented for CMSIS-DAP. If you want to put in the effort, please feel free to do that, I would gladly accept a PR. But it's so rarely used I don't see fit to put my time into it :)

@Yatekii Yatekii added enhancement New feature or request help wanted Extra attention is needed and removed bug Something isn't working labels Apr 29, 2020
@elfmimi
Copy link
Contributor

elfmimi commented Apr 30, 2020

Thanks for your reply. If no one is working on it, then I'll happily do it. I can't estimate how long it will take though. I'll get back here when I get something ready to show you.

@Yatekii
Copy link
Member

Yatekii commented May 31, 2020

@elfmimi what is the progress on this? :) I think @Disasm expressed interest in this too. I'll go ahead and mark this as an oxidize impl days issue. Maybe you folks make sure to coordinate :)

@elfmimi
Copy link
Contributor

elfmimi commented Jun 1, 2020

Hi! Not much progress. I was playing around with GD32V bootloader.
Here is my progress on that side, if you are interested.
riscv-mcu/gd32-dfu-utils#5

As for probe-rs, I could proceed to the point ram_download example completes successfully.
The difficult part is that, I mentioned this before, that GD32V has two entities in its jtag chain.
So it is required to come up with acceptable modification to the existing framework which I suppose unlikely to end up small. I'm kept back here.

If Disasm-san or anyone is to get this done, I won't be pissed at all. No worry there.

@Yatekii Yatekii removed the oxidize label Nov 13, 2020
@Yatekii
Copy link
Member

Yatekii commented Nov 13, 2020

@Disasm @elfmimi is this covered with the work done on FTDI? Or is there any other movement here? :)

@Disasm
Copy link
Contributor

Disasm commented Nov 13, 2020

To support GD32V flashing we need three things:

  • JTAG support for CMSIS-DAP. This one needs (preferably common for different probe types) a JTAG machinery that exists only for FTDI right now. Unfortunately, I still didn't find time to implement this.
  • GD32V debug support. I checked GD32V debugging through FTDI and it didn't work well, apparently due to the GD32V<->FE310 debug module differences.
  • GD32V flash algorithm

@Tiwalun
Copy link
Member

Tiwalun commented Nov 15, 2020

@Disasm Could you try debugging the GD32V again? I recently fixed a small issue (see #423), and it should work better now.

@Disasm
Copy link
Contributor

Disasm commented Nov 15, 2020

@Tiwalun I tried running cli with cargo run --features ftdi debug --chip riscv, but no success: https://pastebin.com/90bYeuQq
This Target supports 0 breakpoints looks suspicious, because I believe this chip does support breakpoints.

Yatekii pushed a commit that referenced this issue Jan 13, 2023
189: Bump git-version from 0.3.4 to 0.3.5 r=Tiwalun a=dependabot[bot]

Bumps [git-version](https://github.com/fusion-engineering/rust-git-version) from 0.3.4 to 0.3.5.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/fusion-engineering/rust-git-version/commit/e46c2f3f7d6954f421bf829abc4fe3ecfd565135"><code>e46c2f3</code></a> Bump version to 0.3.5.</li>
<li><a href="https://github.com/fusion-engineering/rust-git-version/commit/3dbe2ad73e18f0472d1e6d8dacda2425b310a5de"><code>3dbe2ad</code></a> Include COPYING file in macro crate.</li>
<li><a href="https://github.com/fusion-engineering/rust-git-version/commit/f40e32dbb0cb8cfde94e1570eac9f7f739de0655"><code>f40e32d</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/fusion-engineering/rust-git-version/issues/13">#13</a> from kingsimmy/patch-1</li>
<li><a href="https://github.com/fusion-engineering/rust-git-version/commit/2c2c3a43ff7e4098be7a2670362cd0ed79d6e21b"><code>2c2c3a4</code></a> Update lib.rs</li>
<li>See full diff in <a href="https://github.com/fusion-engineering/rust-git-version/compare/v0.3.4...v0.3.5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=git-version&package-manager=cargo&previous-version=0.3.4&new-version=0.3.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@bors bors bot closed this as completed in 55a0215 Jan 13, 2023
@Yatekii Yatekii reopened this Jan 13, 2023
@bugadani
Copy link
Contributor

bugadani commented Apr 3, 2024

GD32Vxxx-START boards unfortunately seem to be impossible to source :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture:riscv Issues and PRs for the RISC-V architecture enhancement New feature or request help wanted Extra attention is needed probe:cmsis-dap Issues and PRs specific to cmsis-dap based probes protocol:jtag Issues and PRs concerning the JTAG transport protocol
Projects
None yet
Development

No branches or pull requests

6 participants