stm32: add support for CAN on N6 and enable on OPENMV_N6#19334
Open
dpgeorge wants to merge 7 commits into
Open
stm32: add support for CAN on N6 and enable on OPENMV_N6#19334dpgeorge wants to merge 7 commits into
dpgeorge wants to merge 7 commits into
Conversation
Signed-off-by: Kwabena W. Agyeman <kwagyeman@live.com>
Signed-off-by: Kwabena W. Agyeman <kwagyeman@live.com>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Changes: - Use the same deep-tx-queue logic as the STM32H7. - Use `time.sleep_ms()` instead of `pyb.delay()` (the latter is not available on all stm32 boards). This test now passes on OPENMV_N6. Signed-off-by: Damien George <damien@micropython.org>
So that CAN3 has a chance of working. Signed-off-by: Damien George <damien@micropython.org>
These aren't technically needed, but good to make sure they are populated. Signed-off-by: Damien George <damien@micropython.org>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19334 +/- ##
==========================================
+ Coverage 98.47% 98.49% +0.01%
==========================================
Files 176 176
Lines 22845 22911 +66
==========================================
+ Hits 22497 22566 +69
+ Misses 348 345 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code size report: |
Octoprobe PR report
Failures |
Contributor
|
Nice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a continuation of #19316, to get CAN working on STM32N6, and enable it on OPENMV_N6.
Currently it supports only CAN1, but CAN2/CAN3 will follow in a separate PR.
Testing
Tested CAN1 on OPNEMV_N6. The following tests run and pass:
extmod_hardware/machine_can_timings.pyports/stm32/pyb_can.pymulti_extmod/machine_can_*.py(8 tests, run against PYBV10 in both directions with CAN tranceivers)All other CAN tests skip (mainly because there's only one CAN peripheral enabled).
Also tested on NUCLEO_H723ZG, to make sure the modified
pyb_can.pytest didn't regress.Trade-offs and Alternatives
N6 is basically the same as H7, and I configured it to use the same buffer settings as H7. That allows a second CAN peripheral to work (eventually, once support is added). Maybe one day the CAN API can be extended to allow all the buffers to be allocated to one peripheral, or that could be done at compile time. But for now one CAN is allocated 50% of buffer resources.
Generative AI
Not used.