-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mpfs improve isr and error handling #225
Conversation
3033286
to
f75c0a6
Compare
Now I guess it is ready for review |
…andling - Remove unnecessary looping in the interrupt handling - Recover properly from the rx overflow error - Check the RXMOF bit always to sychrnonize the RX frames to recover from any errors - Clear the interrupts in a single place after the irq handler is finished Signed-off-by: Jukka Laitinen <[email protected]>
…when in ERROR_ACTIVE state Having error interrupts enabled while in ERROR_PASSIVE will cause interrupt storms, for example bus error would be always asserted if the can is / gets disconnected. Signed-off-by: Jukka Laitinen <[email protected]>
f75c0a6
to
431b72d
Compare
Some more testing, looks promising. The input from @vnopanen is that the drone has gone through flight test, and running on table without crashes/jams. On desk another unit w. saluki-pi has gone through 16 hours of uav communication: UAVCAN node status: CAN1 status: ESC outputs: Online nodes (Node ID, Health, Mode): uavcan: cycle time: 50490729 events, 3433106204us elapsed, 67.99us avg, min 14us max 62608us 215.078us rms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good simplification for the interrupt handling routine 👍 . I didnt find any questionable changes that could affect the previous functionality. Only one test that we need to conduct is https://github.com/tiiuae/mpfs_canfd_uavcan_example/tree/canfd_driver_test
it tests diff bitrate and classic / canfd payloads. the UAVCAN test only uses classic CAN.
Merging this now, as it is fixing the rl issues found. Need to still run the tests @haitomatic pointed out, and if any issues are found, open new jira tickets of of those |
yes, @vnopanen is conducting that test. Will open jira ticket if any issue found |
Summary
This re-writes the ISR handling of can driver to improve real-time response and avoid lock-ups.
Also RX data buffer handling is made safe, the frame consistency is checked on every read from the RX buffer.
Impact
Fixes hangs
Testing
On-desk trials