Gary-Hobson commented on PR #18150:
URL: https://github.com/apache/nuttx/pull/18150#issuecomment-3798266529
Since the timer interrupt uses the exception_direct method in the latest
code, it cannot obtain the thread's PC within the interrupt. As a result, all
timer-sampling-based gprof features fail to work correctly. The timer interrupt
needs to be changed to the exception_common method.
For chips using SysTick, you only need to change the two occurrences of
NVIC_IRQ_PENDSV to NVIC_IRQ_SYSTICK in
nuttx/arch/arm/src/armv[6/7/8]-m/arm_vectors.c.
For example, for mps2-an500 (Cortex-M7), the modified result is as follows:
```c
--- a/arch/arm/src/armv7-m/arm_vectors.c
+++ b/arch/arm/src/armv7-m/arm_vectors.c
@@ -101,7 +101,7 @@ const void * const _vectors[] locate_data(".vectors")
/* Vectors 2 - n point directly at the generic handler */
- [2 ... NVIC_IRQ_PENDSV] = &exception_common,
- [(NVIC_IRQ_PENDSV + 1) ... (15 + ARMV7M_PERIPHERAL_INTERRUPTS)]
+ [2 ... NVIC_IRQ_SYSTICK] = &exception_common,
+ [(NVIC_IRQ_SYSTICK + 1) ... (15 + ARMV7M_PERIPHERAL_INTERRUPTS)]
= &exception_direct
};
```
--
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]