2024-09-04 04:40 AM
I have the following problem with my STM32H743:
I want to use the ADC3 for an injected conversion, but the ADC3 interrupt does not call the
This is what the SysTick_Handler looks like at the moment:
__irq void SysTick_Handler() {
volatile int ipsr = __get_IPSR();
if (ipsr == 15) {
// do the systick thing
} else if ((ipsr == 143) && (ADC3->ISR & ADC_ISR_JEOS)) {
ADC3->ISR = ADC_ISR_JEOS;
// do the ADC thing
}
}
Does anyone have an idea, what could cause this?
Solved! Go to Solution.
2024-09-05 06:18 AM
143 - 15 = 128. So it's off by 128, I'm sure that's not a coincidence.
I would say that's an issue with SCB->VTOR not being set to a multiple of the vector table length.
If my interpretation of your screenshot is correct, you have SCB->VTOR = 0x08020200. Perhaps this isn't valid and it needs to be a multiple of 0x400. I'm not going to dig into documentation but that seems probable given the symptoms. Try 0x08020000 or 0x08020400.
2024-09-04 06:17 AM
> ADC3->ISR = ADC_ISR_JEOS;
Put a breakpoint on this line and, when it gets hit, show the value of the SCB->ICSR register in a screenshot, along with SCB->VTOR and the relevant entries in there for the 15th and 143rd interrupt addresses.
2024-09-04 08:15 AM
Use a debugger to step through the code and inspect the exact state when the SysTick_Handler is invoked. Check the state of all registers, particularly IPSR and ICSR, to see what might be causing the jump to the SysTick_Handler instead of ADC3_IRQHandler.
2024-09-05 12:20 AM
The active exeption at this breakpoint is the ADC3 interrupt and the VTOR value seems to align with the observed vector table offset:
The vector table entries for SysTick_Handler and ADC3_IRQHandler are highlighted.
2024-09-05 06:18 AM
143 - 15 = 128. So it's off by 128, I'm sure that's not a coincidence.
I would say that's an issue with SCB->VTOR not being set to a multiple of the vector table length.
If my interpretation of your screenshot is correct, you have SCB->VTOR = 0x08020200. Perhaps this isn't valid and it needs to be a multiple of 0x400. I'm not going to dig into documentation but that seems probable given the symptoms. Try 0x08020000 or 0x08020400.
2024-09-05 06:41 AM
0x08020400 worked, thanks! :)