[SOLVED] JLink Commander cannot read/write R13 or R15

  • The target is a GD32F303ZK. I am using SEGGER J-Link Commander V7.60d.

    I can debug the chip without problem (using IAR 5.2 or IAR 9.1), and I can flash it using JFlash or JLink commander. So generally the J-Link is working fine with the GD32F303ZK.

    However I was doing some low-level checkout because one of our boards is acting strange (though everything I copy/paste here is from a a session with a fully working board). I wanted to manipulate the R15 (PC) and R13 (SP) registers to simulate a reset to a different program that is flashed on the board, but is different than the program that is specified in the GD32's flash memory locations for the the initial SP and PC (addresses 0x0800_0000 and 0x0800_0004).

    I can use the `rreg` and `wreg` jlink commander commands to read or write any general purpose register except r13 or r15. For those registers jlink command responds "Illegal register name." "Syntax: rreg <RegName>" then proceeds to list dozens of valid register names (including "R13 (SP)" and "R15 (PC)").


    I have tried using variations of the register names, such as "r13", "R13", "sp", "SP", and even "R13 (SP)" (as given in the error message) with the same result for all of them.


    Here is a copy paste (with the list of valid register names mostly deleted to make reading easier):


  • Update: While the following doesn't work:

    Code
    J-Link>rreg R13 (SP)
    Illegal register name.
    Syntax: rreg <RegName>
    
    
    ... long list of registers elided ...

    I found that using quotes makes it work:

    Code
    J-Link>rreg "R13 (SP)"
    R13 (SP) = 0x20003400
    J-Link>rreg "R15 (PC)"
    R15 (PC) = 0x080271E8


    I'd like to ask for an enhancement to jlink.exe so that the simpler, more commonly used names "R13", "SP", "R15", and "PC" be accepted as aliases for the respective registers.

    I find it surprising that no one has complained about this before.

  • Hello,

    Thank you for your inquriy.
    The issue is reproducible and will be fixed.

    Best regards,
    Nino

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!