mcu-debug / peripheral-viewer

Standalone Peripheral(SVD) Viewer extension extracted from cortex-debug, now works with any debugger
MIT License
10 stars 5 forks source link

Wrong peripheral values are shown when expanded for the first time #33

Open AndriiLishchynskyi opened 4 months ago

AndriiLishchynskyi commented 4 months ago

Type: Bug Report

The first time XPeripherals view is expanded, it does not display proper register values. "Refresh" button does not help either. As soon as any action (step, continue-pause) is performed, the view is refreshed and shows proper values.

Steps to reproduce the behavior:

  1. In the firmware store value of some peripheral register, lets call it "DAC_VAL" into the variable.
  2. Set breakpoint next to the variable from step#1.
  3. Launch debug session, resume the core until it reaches your breakpoint.
  4. Expand XPeripherals view, then find DAC_VAL reg
  5. Compare value of peripheral register with:
  1. Press the "Refresh" button and observe it does not change DAC_VAL
  2. Read DAC_VAL by GDB 'x' command and observe GDB's value differs from XPeripherals
  3. Perform single step and observe XPeripherals is refreshed and now shows proper DAC_VAL value

Expected behavior XPeripherals shows proper values once expanded for the first time

Screenshots image