Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VSC-1412] Add validation for debug session status for monitor start with no reset flag #1270

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

radurentea
Copy link
Collaborator

@radurentea radurentea commented Aug 2, 2024

Description

JIRA: https://jira.espressif.com:8443/browse/VSC-1412

Type of change

  • New feature (non-breaking change which adds functionality)

Steps to test this pull request

  1. Debug a project (ex: blink)
  2. While debugging, start monitoring
  • Expected behaviour:

The board should not reset itself, monitor should start from the current state of the board

How has this been tested?

As described above using the blink example on a ESP32-C6 board

Test Configuration:

  • ESP-IDF Version: 5.3
  • OS (Windows,Linux and macOS): Windows 11

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

Copy link

github-actions bot commented Aug 2, 2024

Download the artifacts for this pull request:
You can test these changes by installing this VSIX by click menu View -> Command Palette..., type Install from VSIX and then select downloaded esp-idf-extension.vsix file to install the extension.

@radurentea
Copy link
Collaborator Author

Hi @brianignacio5, PTAL

@radurentea radurentea self-assigned this Aug 2, 2024
Copy link
Collaborator

@brianignacio5 brianignacio5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@radurentea
Copy link
Collaborator Author

Hi @AndriiFilippov PTAL

Copy link

Pull request has been marked as stale since there are no activities, and this will be closed in 5 days if there are no further activities

@github-actions github-actions bot added the stale Stale PR or Issue label Aug 24, 2024
@brianignacio5 brianignacio5 removed the stale Stale PR or Issue label Aug 26, 2024
@AndriiFilippov
Copy link
Collaborator

AndriiFilippov commented Sep 2, 2024

@radurentea hi !

Tested under:
OS - MacOS
ESP-IDF: v5.2.2

Steps:
start debug session - run Monitor - stop debug session - try to start again -> ERROR:

/Users/andriifilippov/.espressif/tools/riscv32-esp-elf-gdb/14.2_20240403/riscv32-esp-elf-gdb/bin/riscv32-esp-elf-gdb

/Users/andriifilippov/.espressif/tools/openocd-esp32/v0.12.0-esp32-20240318/openocd-esp32/bin/openocd

Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:28)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

Info : only one transport option; autoselecting 'jtag'

Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

Info : esp_usb_jtag: serial (60:55:F9:F7:2C:26)

Info : esp_usb_jtag: Device found. Base speed 24000KHz, div range 1 to 255

Info : clock speed 24000 kHz

Info : JTAG tap: esp32h2.cpu tap/device found: 0x00010c25 (mfg: 0x612 (Espressif Systems), part: 0x0010, ver: 0x0)

Info : [esp32h2] datacount=2 progbufsize=16

Info : [esp32h2] Examined RISC-V core; found 1 harts
Info : [esp32h2]  XLEN=32, misa=0x40903105

Info : [esp32h2] Examination succeed
Info : starting gdb server for esp32h2 on 3333
Info : Listening on port 3333 for gdb connections

Info : accepting 'gdb' connection on tcp/3333

Info : [esp32h2] Halt cause (5) - (PMP Load access fault)

Warn : No symbols for FreeRTOS!

❌ Error: Algorithm timed out after 40001 ms.

Info : [esp32h2] Halt cause (5) - (PMP Load access fault)

❌ Error: ra = 0x40800924

❌ Error: sp = 0x408046b0

❌ Error: gp = 0x4080a270

❌ Error: tp = 0x408061b4

❌ Error: t0 = 0x400106c4

❌ Error: t1 = 0xffffffe0

❌ Error: t2 = 0x0

❌ Error: fp = 0x1

❌ Error: s1 = 0xf8

❌ Error: a0 = 0x40804710

❌ Error: a1 = 0x42f88000

❌ Error: a2 = 0x20

❌ Error: a3 = 0x40804730

❌ Error: a4 = 0x40804730

❌ Error: a5 = 0x1

❌ Error: a6 = 0x20

❌ Error: a7 = 0x80000000

❌ Error: s2 = 0x8000

❌ Error: s3 = 0x20

❌ Error: s4 = 0x42f90000

❌ Error: s5 = 0x42f88000

❌ Error: s6 = 0x0

❌ Error: s7 = 0x60002000

❌ Error: s8 = 0x10000

❌ Error: s9 = 0x42f80000

❌ Error: s10 = 0x40804144

❌ Error: s11 = 0x1

❌ Error: t3 = 0x0

❌ Error: t4 = 0x0

❌ Error: t5 = 0x0

❌ Error: t6 = 0x0

❌ Error: pc = 0x40800000

❌ Error: mstatus = 0x1800

❌ Error: mepc = 0x40800008
Error: mcause = 0x5
Error: Failed to wait algorithm (-302)!
Error: Algorithm run failed (-302)!

❌ Error: Failed to run flasher stub (-302)!
Warn : Failed to get flash mappings (-302)!

❌ Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!

❌ Error: Failed to run flasher stub (-4)!

❌ Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!

❌ Error: Failed to run flasher stub (-4)!
Error: Failed to probe flash, size 0 KB
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.

❌ Error: attempted 'gdb' connection rejected

Have tried multiple times. Leads to same error.

@radurentea
Copy link
Collaborator Author

Hi @AndriiFilippov,

The problem is not related to the change itself, but rather to the debugging process.
The intended behavior occurs when we:

  1. Start a debug session
  2. Begin monitoring
  3. Apply the --no-reset flag and the monitoring starts without reseting the board

However, issues arise when:

  1. We close the debugging session without properly ending the monitoring process
  2. Or, we halt the program at a breakpoint before closing the session (board needs to be reset before attempting debugging again)

In these cases, when we attempt to restart debugging, we encounter errors.

I think we can close this issue if the intended behaviour works and open a discussion about the debugging process with @brianignacio5 and @kolipakakondal maybe they have a better understanding if we should and if we can support the a fix for what you found.

@brianignacio5 brianignacio5 changed the title Add validation for debug session status Add validation for debug session status for monitor start with no reset flag Sep 10, 2024
Copy link

Pull request has been marked as stale since there are no activities, and this will be closed in 5 days if there are no further activities

@github-actions github-actions bot added the stale Stale PR or Issue label Sep 26, 2024
@radurentea radurentea added ongoing Ongoing Issue or PR, this label will be used for issue or PR which is to be excluded by stale bot and removed stale Stale PR or Issue labels Sep 30, 2024
@brianignacio5 brianignacio5 added this to the 1.9.0 milestone Oct 23, 2024
@radurentea radurentea force-pushed the enhance/--no-reset-for-monitor branch from c396701 to 9c7161d Compare October 23, 2024 11:28
@Fabricio-ESP Fabricio-ESP changed the title Add validation for debug session status for monitor start with no reset flag [VSC-1412] Add validation for debug session status for monitor start with no reset flag Oct 23, 2024
Copy link
Collaborator

@Fabricio-ESP Fabricio-ESP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed the message is only printed once not in the output.
Tested on Windows and Linux.

@radurentea radurentea merged commit 608a45e into master Oct 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ongoing Ongoing Issue or PR, this label will be used for issue or PR which is to be excluded by stale bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants