I've got an STM32H747IGT6 which has a C4 and a C7. The C4 is locked in a tight loop grabbing a value from the ADC, processing it, and outputting the result to the DAC (nothing fancy there). I'm trying to increase the speed of the loop, and what I'm seeing is that a lot of interrupts are firing, slowing things down.
In my regular (non-ISR) code when I disable IRQs for a few lines of code and right before re-enabling IRQs store the value of SCB->ICSR, it's nearly always 0x400000 which, if I'm reading the manual correctly, means ISRPENDING is true but VECTPENDING is zero.
What does it mean when ICSR is 0x400000? How can I have ISRPENDING but not VECTPENDING?
TL;DR
I've got timer 5 running at full speed (240 MHz) for timing purposes and code that looks like this:
while (!LL_ADC_IsActiveFlag_EOC(ADC1)) {}
__disable_irq();start_timer = TIM5->CNT;
__disable_irq();
start_timer = TIM5->CNT;
LL_ADC_ClearFlag_EOC(ADC1);
adc_data = LL_ADC_REG_ReadConversionData32(ADC1); data = ((float)adc_data) / 65536.0f; // Normalize from 0..0xFFFF (-4 to 4V) to 0..1
adc_data = LL_ADC_REG_ReadConversionData32(ADC1);
data = ((float)adc_data) / 65536.0f; // Normalize from 0..0xFFFF (-4 to 4V) to 0..1
end_timer = TIM5->CNT; uint32_t icsr = SCB->ICSR; __enable_irq();
end_timer = TIM5->CNT;
uint32_t icsr = SCB->ICSR;
__enable_irq();
When I run this with IRQs disabled (as shown) the code takes 6-8 ticks (25-33 nsec) but if I don't disable IRQs, the exact same code takes 6-146 ticks (25-608 nsec). In my code I'm only enabling 3 interrupts, and have checked that none of them are firing, so I'm trying to figure out what else is happening in this chip!