Skip to content

Corruption of register a0 during step-by-step debugging #3

@MikeSmith78

Description

@MikeSmith78

MRS_Community_V160
OpenOCD 0.11.0+dev-02415-gfad123a16-dirty (2023-09-22-10:36)
WCH-LinkE-R0-1v3 (firmware v2.11)
Chip CH32V307VCT6

Problem: during step-by-step debugging, register a0 is overwritten with the value 0xE0000000, if debugging view "registers" is open, and registers ft0... are visible.
The debugger probably uses dscratch interface to read ft0..ftN (after next step, dscratch0/1 has same value, 0xE0000000), and does not restore contents of the a0 register.

This problem exists while mstatus is zero. At the end of startup code, value 0x6088 is written to the mstatus, and debugger starts working correctly.

изображение
изображение

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions