Closed tridge closed 3 years ago
Interesting! We could always give it a 32bit system timer by sacrificing something else.
Interesting! We could always give it a 32bit system timer by sacrificing something else.
yes, but I'd rather fix the bug
I think this graph proves that it really is a delay in wall clock time, and not just an error in accounting (ie. not a slip in our time measurment): a GPS sample happened to be due during the 68ms gap, and that sample was delayed. If we just had an accounting error then we would have seen the gap between the two final GPS points in that graph separated by 200ms. This shows the GPS sample really was delayed (by 40ms)
the bug really has to either be in on of the following:
Could this cause a flyaway? There was a report of someone with a flyaway on 4.1 using this board when switching to auto.
@andyp1per, I think that's unlikely. So far I've only heard of it causing an internal error because the position controller is more strict in 4.1 about timing and it logs this internal error if there is more than a 13ms delay.
We believe this was fixed with #18416 - strictly by the issue title this is all done. Better fixes are coming.
We have 3 examples now of logs showing long loops on MatekH743 boards. They look like this:
the really notable feature of this issue is that the MaxT is always very close to 68036 us. That is 65536 + 2500, where 2500 is the normal loop time at 400Hz. These boards have 16 bit system timers (only a few boards have 16 bit system timers) which means the low level system timer wraps at 65536us, so I think the bug is likely in the handling of that wrap in hrt.c. I can't yet see the bug, but we should look at it carefully