stm32: Fix Classic CAN issue where initialising CAN1 corrupts CAN2.#18992
stm32: Fix Classic CAN issue where initialising CAN1 corrupts CAN2.#18992projectgus wants to merge 2 commits intomicropython:masterfrom
Conversation
|
@chrismas9 if you get a chance then I'd be interested to know if the new unit tests added here pass on your boards (can run with Still waiting for an F413Z board to arrive so I can finish this. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18992 +/- ##
=======================================
Coverage 98.46% 98.46%
=======================================
Files 176 176
Lines 22784 22784
=======================================
Hits 22435 22435
Misses 349 349 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
On Classic CAN hardware only, the problem was CAN1 init would clear all filters including CAN2 filter range. Includes expanded unit tests to cover arbitrary pairs of CAN instances. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
eab0e62 to
1078d7d
Compare
|
Code size report: |
This turned out not to be needed for the bugfix in previous commit, but seems like a good practice anyway. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1078d7d to
6137e28
Compare
|
@projectgus I hope I built it properly. I haven't done this before. I cloned your repo, switched to |
|
Huh, thanks @chrismas9 that's interesting. Good that the results from your test code and the new unit test seem to agree that the problem on F413 is orderings 1,2 and 1,3. My F413 board should arrive soon, so I'll probably hold off on looking at this further until then. |
|
I have three CANbus drivers I can connect to the F413. I can do an external CAN test when you are ready. It sends on each port and listens on th eother two. |
Summary
This PR is marked draft until I get some hardware to address the last item.
Testing
ports/stm32/pyb_can*.py extmod_hardware/machine_can*.pyunit tests,multi_extmod/machine_can_*.py multi_pyb_can/*.pymulti-tests.Trade-offs and Alternatives
Generative AI
I did not use generative AI tools when creating this PR.