fdcavalcanti opened a new pull request, #15815:
URL: https://github.com/apache/nuttx/pull/15815

   ## 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:
   
   - defconfig: rv-virt:nsh
   - CONFIG_SCHED_BACKTRACE=y
   - CONFIG_FRAME_POINTER=y
   - CONFIG_DEBUG_SYMBOLS=y
   
   The test is executed as follows: build, run ostest and test the backtrace in 
two different ways:
   
   - Task exception: simply do `*p = 0`; inside a simple test program.
   - IRQ exception: set up an interrupt handler and trigger the IRQ. Inside the 
interrupt routine, do `*p = 0;`.
   
   The backtrace is verified manually using `tools/btdecode.sh`.
   
   ### Test Scenario 1
   
   - CONFIG_SMP=n
   - CONFIG_ARCH_INTERRUPTSTACK=2048
   
   Command: `qemu-system-riscv32 -semihosting -M virt,aclint=on -cpu rv32 -bios 
none -kernel nuttx -nographic`
   
   - backtrace: PASS
   - ostest: PASS
   
   ### Test Scenario 2
   
   - CONFIG_SMP=y
   - CONFIG_SMP_NCPUS=2
   - CONFIG_ARCH_INTERRUPTSTACK=2048
   
   Command: `qemu-system-riscv32 -semihosting -M virt,aclint=on -cpu rv32 -smp 
2 -bios none -kernel nuttx -nographic`
   
   - backtrace: PASS
   - ostest: PASS
   
   ### Test Scenario 3
   
   - CONFIG_SMP=n
   - CONFIG_ARCH_INTERRUPTSTACK=0
   - CONFIG_INIT_STACKSIZE=4096
   
   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.
   
   - backtrace: PASS
   - ostest: PASS


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to