7
31
Fork
You've already forked blackmagic
23

RISC-V support #292

Open
gsmcmullin wants to merge 19 commits from gsmcmullin/riscv into main
pull from: gsmcmullin/riscv
merge into: blackmagic-debug:main
blackmagic-debug:main
blackmagic-debug:feature/bmda-remote-comms
blackmagic-debug:ALTracer/feature/aarch64-ident
blackmagic-debug:feature/better-meson-optimisation-handling
blackmagic-debug:feature/am335x-support
blackmagic-debug:feature/esp32-c3-support
blackmagic-debug:feature/cortex-ar-software-breakpoints
blackmagic-debug:feature/unit-testing
blackmagic-debug:feature/windows-usb-serial-interface-naming
blackmagic-debug:fix/bmp-external-spi
blackmagic-debug:ALTracer/feature/bluepillplus-platform
blackmagic-debug:ALTracer/feature/at32f43x-unrdp
blackmagic-debug:feature/const-correctness
blackmagic-debug:ALTracer/feature/fault_handlers
blackmagic-debug:ALTracer/feature/hazard3-ice40-support
blackmagic-debug:fix/ci-cleanup
blackmagic-debug:ALTracer/fix/gdb-10-12-thread
blackmagic-debug:ALTracer/feature/blackpill-f4-adc
blackmagic-debug:ALTracer/fix/cortex-desc-allocfail-report
blackmagic-debug:ALTracer/feature/spi-perf
blackmagic-debug:ALTracer/feature/calibrate_swd
blackmagic-debug:ALTracer/feature/blank-check
blackmagic-debug:feature/avr
blackmagic-debug:v2.0
blackmagic-debug:v1.9
blackmagic-debug:v1.10
blackmagic-debug:v1.8
gsmcmullin commented 2017年10月03日 02:41:34 +02:00 (Migrated from github.com)
Copy link

First cut at RISC-V support, for single-hart rv32i.

Merge #291 first and then rebase.

First cut at RISC-V support, for single-hart rv32i. Merge #291 first and then rebase.
gsmcmullin commented 2017年10月03日 02:49:12 +02:00 (Migrated from github.com)
Copy link

@esden reports reset does not work.

I think hard_srst and connect_srst reset everything including the jtag debug subsystem ... causing issues. also run seems to not restart the program from the beginning over here. start results in No registers.

@esden reports reset does not work. > I think hard_srst and connect_srst reset everything including the jtag debug subsystem ... causing issues. also `run` seems to not restart the program from the beginning over here. `start` results in `No registers.`
esden commented 2017年11月03日 20:09:50 +01:00 (Migrated from github.com)
Copy link

Just a note for the casual visitor of this pull request. We have tested this code and it works as well as the OOCD target does. Unfortunately the RISC-V debug interface V11 that is implemented on the Freedom E310 silicon has a reset bug preventing 'run' 'start' and some other typical debug operations from working. This means all you can do is connect to the target and step through the code from the position where the code was at the moment of connection.

As it is only of limited usability for debugging purposes and does not have equivalent ease of use and expected feature set compared to the currently supported ARM targets we will not be merging the RISC-V support at the moment.

We will likely wait for the next generation of SiFive chips to become available with fully functional debug interface (V13) before we add RISC-V support to Black Magic Probe.

If you have questions or suggestions please feel free to leave them here, we will keep this pull request open for now. :)

Note: We are missing a flash stub to be able to use the load command and flash the firmware through the BMP. This will be added when we return to the RISC-V platform debugging.

Just a note for the casual visitor of this pull request. We have tested this code and it works as well as the OOCD target does. Unfortunately the RISC-V debug interface V11 that is implemented on the Freedom E310 silicon has a reset bug preventing 'run' 'start' and some other typical debug operations from working. This means all you can do is connect to the target and step through the code from the position where the code was at the moment of connection. As it is only of limited usability for debugging purposes and does not have equivalent ease of use and expected feature set compared to the currently supported ARM targets we will not be merging the RISC-V support at the moment. We will likely wait for the next generation of SiFive chips to become available with fully functional debug interface (V13) before we add RISC-V support to Black Magic Probe. If you have questions or suggestions please feel free to leave them here, we will keep this pull request open for now. :) Note: We are missing a flash stub to be able to use the `load` command and flash the firmware through the BMP. This will be added when we return to the RISC-V platform debugging.
UweBonnes commented 2020年05月10日 13:33:05 +02:00 (Migrated from github.com)
Copy link

I rebased the branch, hopefully with no colateral damage. GD32V103 uses debug version 1 not (yet?) supported.

I rebased the branch, hopefully with no colateral damage. GD32V103 uses debug version 1 not (yet?) supported.
alistair23 commented 2020年05月11日 21:10:57 +02:00 (Migrated from github.com)
Copy link

Will this be merged soon then?

Will this be merged soon then?
UweBonnes commented 2020年05月11日 21:42:27 +02:00 (Migrated from github.com)
Copy link

Probably not soon, as it only supports V0.11. I played around with it and the SiPeed Longan (GD32VF103) and had only problems and no success. Somebody has to care for V0.13...

Probably not soon, as it only supports V0.11. I played around with it and the SiPeed Longan (GD32VF103) and had only problems and no success. Somebody has to care for V0.13...
alistair23 commented 2020年05月12日 02:25:23 +02:00 (Migrated from github.com)
Copy link

Ah, that's unfortunate.

Ah, that's unfortunate.
UweBonnes commented 2020年12月06日 22:19:32 +01:00 (Migrated from github.com)
Copy link

Rebased again.

Rebased again.
arabine commented 2022年07月22日 15:23:27 +02:00 (Migrated from github.com)
Copy link

Hello,
I don't understand the reason why this branch is not merged since there are now multiple RISC-V chips on the market (Gigadevice, Espressif). Are you waiting for at least one chip fully supported?

Thank you.

Hello, I don't understand the reason why this branch is not merged since there are now multiple RISC-V chips on the market (Gigadevice, Espressif). Are you waiting for at least one chip fully supported? Thank you.

Hi arabine, this PR implements experimental support for RISC-V's older version 0.11 debug spec. This means it won't work for most of the current RISC-V chips. Because the support required to make either this or version 0.13 debug spec work requires some major work inside BMP to do, we are in the process of preparing the code base (v1.9). Support will land in v2.

TL;DR: It's a complicated problem and we're working on it but it takes time.

Hi arabine, this PR implements experimental support for RISC-V's older version 0.11 debug spec. This means it won't work for most of the current RISC-V chips. Because the support required to make either this or version 0.13 debug spec work requires some major work inside BMP to do, we are in the process of preparing the code base (v1.9). Support will land in v2. TL;DR: It's a complicated problem and we're working on it but it takes time.
arabine commented 2022年07月25日 13:06:18 +02:00 (Migrated from github.com)
Copy link

Ok thank you for your answer. I can help you testing if needed.

Ok thank you for your answer. I can help you testing if needed.
mrx23dot commented 2023年12月18日 12:35:02 +01:00 (Migrated from github.com)
Copy link

Hi arabine, this PR implements experimental support for RISC-V's older version 0.11 debug spec. This means it won't work for most of the current RISC-V chips. Because the support required to make either this or version 0.13 debug spec work requires some major work inside BMP to do, we are in the process of preparing the code base (v1.9). Support will land in v2.

TL;DR: It's a complicated problem and we're working on it but it takes time.

Isn't BMP abstracted into layers?
Higher layer saying write XZ to address Z and not caring about implementation details?

> Hi arabine, this PR implements experimental support for RISC-V's older version 0.11 debug spec. This means it won't work for most of the current RISC-V chips. Because the support required to make either this or version 0.13 debug spec work requires some major work inside BMP to do, we are in the process of preparing the code base (v1.9). Support will land in v2. > > TL;DR: It's a complicated problem and we're working on it but it takes time. Isn't BMP abstracted into layers? Higher layer saying write XZ to address Z and not caring about implementation details?
mrx23dot commented 2023年12月18日 12:36:48 +01:00 (Migrated from github.com)
Copy link

For the reboot issue can't we use NVIC_SystemReset();
it's implemented on RISC-V and CMSIS.

For the reboot issue can't we use `NVIC_SystemReset(); ` it's implemented on RISC-V and CMSIS.

Hi arabine, this PR implements experimental support for RISC-V's older version 0.11 debug spec. This means it won't work for most of the current RISC-V chips. Because the support required to make either this or version 0.13 debug spec work requires some major work inside BMP to do, we are in the process of preparing the code base (v1.9). Support will land in v2.
TL;DR: It's a complicated problem and we're working on it but it takes time.

Isn't BMP abstracted into layers? Higher layer saying write XZ to address Z and not caring about implementation details?

Yes, but that's not relevant to the question - there are multiple versions of the RISC-V debug protocol that are in production, and supporting, eg, v0.13 protocol does not provide support for parts talking v0.11 protocol as they are incompatible. BMD was, at the time we answered, also suffering from a significant amount of ARM-specificity which inhibited the lower level layers from working correctly with RISC-V devices.

For the reboot issue can't we use NVIC_SystemReset();
it's implemented on RISC-V and CMSIS.

No, RISC-V processors do not have an NVIC (this is an ARM-specific) and this conflates the concepts of target firmware-induced reboot with debugger induced reboot, which are two entirely different mechanisms. The latter is driven by, for RISC-V debug, a mix of the nRST pin on the target, and registers in the DM - see github.com/blackmagic-debug/blackmagic@8c15dd459b/src/target/riscv_debug.c (L878-L905) for details.

> > Hi arabine, this PR implements experimental support for RISC-V's older version 0.11 debug spec. This means it won't work for most of the current RISC-V chips. Because the support required to make either this or version 0.13 debug spec work requires some major work inside BMP to do, we are in the process of preparing the code base (v1.9). Support will land in v2. > > TL;DR: It's a complicated problem and we're working on it but it takes time. > > Isn't BMP abstracted into layers? Higher layer saying write XZ to address Z and not caring about implementation details? Yes, but that's not relevant to the question - there are multiple versions of the RISC-V debug protocol that are in production, and supporting, eg, v0.13 protocol *does not* provide support for parts talking v0.11 protocol as they are incompatible. BMD was, at the time we answered, also suffering from a significant amount of ARM-specificity which inhibited the lower level layers from working correctly with RISC-V devices. > For the reboot issue can't we use `NVIC_SystemReset(); ` > it's implemented on RISC-V and CMSIS. No, RISC-V processors do not have an NVIC (this is an ARM-specific) and this conflates the concepts of target firmware-induced reboot with debugger induced reboot, which are two entirely different mechanisms. The latter is driven by, for RISC-V debug, a mix of the nRST pin on the target, and registers in the DM - see https://github.com/blackmagic-debug/blackmagic/blob/8c15dd459b98e80e18c6bab94b3d0c1f3c3ea498/src/target/riscv_debug.c#L878-L905 for details.
This pull request has changes conflicting with the target branch.
  • src/Makefile
  • src/platforms/hosted/ftdi_bmp.c
  • src/target/jtag_devs.c
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin gsmcmullin/riscv:gsmcmullin/riscv
git switch gsmcmullin/riscv
Sign in to join this conversation.
No reviewers
Labels
Clear labels
BMD App
Black Magic Debug App (aka. PC hosted) (not firmware)
BMP Firmware
Black Magic Probe Firmware (not PC hosted software)
Bug
Confirmed bug
Build system
Build system
Can't reproduce
Maintainers can't reproduce this problem
CI
Continuous Integration System
Contribution wanted
User contributions welcome
Documentation
Project documentation
Draft
Work in progress draft
Duplicate
This issue or pull request already exists
Enhancement
General project improvement
Feedback wanted
Requires additional submitter feedback
Foreign Host Board
Non Native hardware to runing Black Magic firmware on
GDB
Issue/PR related to GDB
Good first issue
Good for newcommers
HwIssue Mitigation
Solving or mitigating a Hardware issue in Software
Information Needed
Maintainers need more information
NativeHardware
Official Black Magic Debug Hardware
New Host Board
New hardware to run Black Magic firmware on
New Target
New debug target
Off Topic
Something that does not involve the project in any way
Potential Bug
A potential, unconfirmed or very special circumstance bug
Regression
Bug caused by a regression
User Interest Needed
More user interest required before consideration
User Testing Needed
Looking for user testing reports
Won't fix
Outside of the project scope or works as intended
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
blackmagic-debug/blackmagic!292
Reference in a new issue
blackmagic-debug/blackmagic
No description provided.
Delete branch "gsmcmullin/riscv"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?