[SOLVED] Execute RISCV_DMI_WriteReg from interactive console

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Execute RISCV_DMI_WriteReg from interactive console

    OpenOCD has a command `riscv dmi_write address value` which we can trigger from GDB using `monitor`

    I can't seem to find anything similar in JLinkGDBServer.

    They have the API `int JLINK_RISCV_DMI_WriteReg(U32 RegAddr, U32 Data);` which can be called from the script but can't find a way to trigger it on demand from GDB

    Any ideas?
  • The answer is simple:
    It is not supported.

    What do you need it for in GDB?
    Writing custom DMI sequences should be only necessary for custom chip bringup, where InitTarget() in a script is the right place for.

    For what do you need it after all the target connect etc. has already happened and GDB connected to the core?

    If I have a specific use-case, I may be able to justify allocating the dev time for adding support in GDB Server, at the next team meeting.


    BR
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Alex,

    I am mmahdi's colleague.

    We have a specific debugging case in our chip where we have the chip in an unrecoverable state (normal halt command won't work) and we need to send a command to for example force the halting of the cpu, I am doing this by writing a custom dmi register since the system is not yet halted and the CSR registers cannot be written yet, do you have a better idea in mind that may be already supported ?

    Is there no way of sending any kind of custom instructions to the debug module ?
  • As GDB Server already tries to halt the core at startup of GDB Server, a monitor command would be too late.
    As GDB as one of the first things requests the CPU registers, the core must be halted at the time GDB connects to GDB Server.

    I recommend to use a script file with an InitTarget() function and do the DMI accesses there.
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.