Lenoids opened a new pull request, #18899: URL: https://github.com/apache/nuttx/pull/18899
Implement up_backtrace() for TriCore by walking the CSA chain and collecting return addresses from upper CSA A11 register. ## Summary Add backtrace support for TriCore architecture. Users can use up_backtrace to find the current active call stack, which is quite useful for debugging, like sched_backtrace() and sched_dumpstack(). This feature depends on the TriCore CSA chain, where the upper CSA A11 register saves the return address of each function call. ## Impact Depends on TriCore CSA hardware support. No impact on other architectures. ## Testing example: sched_dumpstack() could output the backtrace if this feature is enabled. ``` sched_dumpstack: backtrace|56: 0x8001debe 0x80013e14 0x80011e18 0x8002e108 0x80030c22 0x80033ff0 0x80033fa0 ``` ostest passed on a2g-tc397-5v-tft ``` nsh> uname -a NuttX 12.13.0 59d9f632fe-dirty May 19 2026 12:47:11 tricore a2g-tc397-5v-tft nsh> ostest (...) End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 1e128 1e128 ordblks 3 3 mxordblk 17240 17240 uordblks 4c78 4c78 fordblks 194b0 194b0 user_main: scheduler lock test sched_lock: Starting lowpri_thread at 97 sched_lock: Set lowpri_thread priority to 97 sched_lock: Starting highpri_thread at 98 sched_lock: Set highpri_thread priority to 98 sched_lock: Waiting... sched_lock: PASSED No pre-emption occurred while scheduler was locked. sched_lock: Starting lowpri_thread at 97 sched_lock: Set lowpri_thread priority to 97 sched_lock: Starting highpri_thread at 98 sched_lock: Set highpri_thread priority to 98 sched_lock: Waiting... sched_lock: PASSED No pre-emption occurred while scheduler was locked. sched_lock: Finished End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 1e128 1e128 ordblks 3 3 mxordblk 17240 17240 uordblks 4c78 4c78 fordblks 194b0 194b0 user_main: nxevent test End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 1e128 1e128 ordblks 3 3 mxordblk 17240 17240 uordblks 4c78 4c78 fordblks 194b0 194b0 Final memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 1e128 1e128 ordblks 2 3 mxordblk 19500 17240 uordblks 4be0 4c78 fordblks 19548 194b0 user_main: Exiting ostest_main: Exiting with status 0 ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
