Hi,
Using R7FA6E10F2CFP, FSP Configurator Version 5.5.0 and IAR EWARM 9.20.2. This problem is reproducable with a very simple project without any OS.
We are using the r_agt timer to measure the pulse period of an input signal (frequency 100Hz ... 5kHz) connected to pin P404, by getting interrupts on falling edges and timer overflows. The interrupts are handled in a function based on the "AGT Input Capture Example" in the r_agt documentation.
This works fine most of the time, but every now and then it happens that there is no interrupt when a falling edge occurs. This has been verified using an oscilloscope and some debugging code.
It seems like the falling edge interrupt is missing in cases when the timer overflow interrupt (TIMER_EVENT_CYCLE_END) occurs at (or very close to) the falling edge (TIMER_EVENT_CAPTURE_A).
In the generated interrupt service routine agt_int_isr() in r_agt.c, it is checked if there was a timer overflow or not, but it is not explicitly checked if there was a falling edge.What happens if both timer overflow and falling edge are active at the same time?Is agt_int_isr() then called twice (does not seem so), or can it somehow be checked if both interrupts are active?
If there is no obvious explanation for this, I can try to create a simple project for the FPB-RA6E1 development board to demonstrate the problem.
Below is the FSP configuration: