-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
risc-v/backtrace: Support backtrace dump during IRQ #15815
risc-v/backtrace: Support backtrace dump during IRQ #15815
Conversation
[Experimental Bot, please feedback here] Yes, this PR description meets the NuttX requirements. It clearly explains the change, its impact, and provides sufficient testing information to evaluate the functionality. The use of specific scenarios and pass/fail results is particularly helpful. It could be slightly improved by including snippets of the before/after backtrace output (even abbreviated) to demonstrate the actual change. |
@nuttxpr test milkv_duos:nsh |
[Experimental Bot, please feedback here] Build and Test Successful (milkv_duos:nsh)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regression Test is successful on Real Hardware: Oz64 SG2000 RISC-V SBC. Thanks :-)
8aac8a4
to
0baab2c
Compare
I have added a backtrace example output on the PR description. |
About breaking this up in smaller PRs. |
it's enough to split the big change into the indeepent patch. |
6656d9f
to
7ebfe0f
Compare
Please check if this separation is enough. I can open a new PR if it makes more sense. |
Adds support for backtrace when the system crashes during IRQ for RISC-V. Tested with SMP, no SMP and no interrupt stack.
7ebfe0f
to
5cf2e43
Compare
@nuttxpr test milkv_duos:nsh |
[Experimental Bot, please feedback here] Build and Test Successful (milkv_duos:nsh)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested OK on Real Hardware: Oz64 SG2000 RISC-V SBC. Thanks :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @fdcavalcanti :-) Just a git commit -s
and we are ready to go :-)
Summary
This PR adds support for backtrace on RISC-V on certain build settings explained below.
Up to this point, it was not printing anything useful during crashes.
Impact
Adds backtrace for task and IRQs when the RISC-V system crashes.
Testing
Tested on Espressif RISC-V devices and rv-virt.
All tests are based on:
The test is executed as follows: build, run ostest and test the backtrace in two different ways:
*p = 0
; inside a simple test program.*p = 0;
.The backtrace is verified manually using
tools/btdecode.sh
.Test Scenario 1
Command:
qemu-system-riscv32 -semihosting -M virt,aclint=on -cpu rv32 -bios none -kernel nuttx -nographic
Test Scenario 2
Command:
qemu-system-riscv32 -semihosting -M virt,aclint=on -cpu rv32 -smp 2 -bios none -kernel nuttx -nographic
Test Scenario 3
Command:
qemu-system-riscv32 -semihosting -M virt,aclint=on -cpu rv32 -bios none -kernel nuttx -nographic
In this case,
CONFIG_INIT_STACKSIZE
must be increased since we don't have the interrupt stack.Example output
btdecode
output: